Host VPS system: using Plesk 17.8.11 on top of Ubuntu 18.04 with Apache 2.4.29 and PHP 7.2.15.
I am a nextcloud newbie and a docker newbie who got some good advice from Reiner_Nippes within this thread. Since then Iāve been doing mostly copy/paste stuff from various articles, and Iām pretty sure I need some more help before Iāll be able to get this nextcloud installation working. I donāt even know the directory I need to put the .yml file in before entering the docker-compose up command, so I havenāt tried anything yet.
I created a ānextcloud_networkā docker network (bridge driver), and the .yml file Iām going to use looks like this so far:
I need to use port 3307 for the MariaDB (3306 is in use for my VPS accountās internal MySQL databases and my hosting provider recommended that I not change their transaction isolation setting from REPEATABLE-READ to anything else). Is that ā3307:3307ā ports line what I need? Is the āTRANSACTION_ISOLATION=READ-COMMITTEDā line appropriate?
I plan to run everything on https://subdomain.mydomain.com. I have existing letsencrypt certificates (installed via Plesk) for both mydomain.com and subdomain.mydomain.com, which seemed to work fine for the trial run I did with docker nextcloud:15.02 (using the SQLite db). How do I go about making this new docker-compose installation secure?
Assuming I can get this docker-compose up, how would I then go about backing up nextcloud and its database/data? I ask because my Plesk documentation contains this disclaimer: āDocker containers in Plesk cannot be migrated or backed up. However, you can back up data used by containers (see Volume Mapping below), or download snapshots.ā Iām guessing that such a disclaimer applies only to Plesk-based GUI administration, so could I still follow the cli commands outlined in Nextcloudās Server Admin Manual?
no. that what expose port 3307 from inside the container to the world.
a) no one is listening to this port
b) you donāt want to expose the database to the world.
c) because nextcloud is accessing the database through the internal docker network.
If you would like to see a complete list of available options, just run:
$ docker run -it --rm mariadb:tag --verbose --help
I guess there is a parameter port. Set this to 3307
btw: since nextcloud accesses the db through the docker network and you donāt expose the db to the host network. you donāt need to change the port. or?
Thanks very much for the information. Iāll try it without any special port configuration.
Iāll look through that chapter on configuring nextcloud without a cnf file, possibly posting again in this thread if I get confused about something or other. Perhaps that should be when I get confused
The log for the MariaDB contains the following warning: āYou need to use --log-bin to make --binlog-format work.ā I found a reference page for a --log-bin=datadir/'log-basename'-bin command, but Iām wondering how to tweak it to do what I want. Would I need to include the /mnt/mariadb-data path somehow?
The /var/www/nextcloud, /mnt/nextcloud-data and /mnt/nextcloud-config directories are empty, but the directory containing my docker-compose.yml file got seeded with an āappā directory which contains nextcloudās data, config, apps, custom_apps and themes directories. Is that to be expected according to the format of my .yml file, because I want the data and config directories to be under /mnt/nextcloud-data and /mnt/nextcloud-config (respectively) and I want the apps, custom_apps and themes directories to be under /var/www/nextcloud.
I copy/pasted those volumes for the nextcloud app, so I might not be doing it right. Thanks for any insight.
left side = host filesystem (or docker volume) / right side = container.
so:
because you use ./app/xxx on the left side. personally i would always use an absolute path (beginning with / ). not relative (beginning with ./ ) to the location where you are when you run the docker-compose command. cd /tmp ; docker up -d /path-to/nextcloud-compose.yml would put the app folder into /tmp.
When I run docker-compose up -d /path/to/docker-compose.yml I get the following error:
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
I confirmed by way of ls that I am entering the appropriate path in the part of the command where I substituted /path/to/ for this post. I tried running the docker-compose up command both with and without the filename, getting the same error each time. Obviously, Iām doing something wrong.
in one of this statments a " - " before my_network is missing. but thatās not the problem.
sorry. iām not using docker-compse frequently. (and i donāt have a installation at and.) so it was just a guess that one can call docker-compose with a file name to point at the compose-file.
use docker-compose --help to get the correct command to use a specific compose-file.
nevertheless since now you use absolute pathes you may use docker-compose up -d in the same path then your compose-file.
No need to apologize, Iām the one who feels sorry for taking up so much of your time. Thanks as well for those links. When I acquire some more server resources Iāll try implementing the BASE stack from that github page you provided.
I went ahead and entered docker-compose up -d without any errors. MariaDB didnāt start, though, and the log contains this information:
> Warning: skipping '!includedir /etc/mysql/mariadb.conf.d/' directive as maximum includerecursion level was reached in file /etc/mysql/mariadb.cnf at line 19
> Warning: skipping '!include /etc/mysql/mariadb.cnf' directive as maximum includerecursion level was reached in file /etc/mysql/conf.d/nextcloud.cnf at line 77
> Warning: skipping '!includedir /etc/mysql/conf.d/' directive as maximum includerecursion level was reached in file /etc/mysql/conf.d/nextcloud.cnf at line 78
> 2019-02-17 15:51:57 0 [Note] mysqld (mysqld 10.3.12-MariaDB-1:10.3.12+maria~bionic-log) starting as process 1 ...
> 2019-02-17 15:51:57 0 [ERROR] mysqld: File '/var/log/mysql/mariadb-bin.index' not found (Errcode: 13 "Permission denied")
> 2019-02-17 15:51:57 0 [ERROR] Aborting
Iām not sure what to do. Iād also like to clear those warnings if I can, especially since some of them are relevant to nextcloud.cnf.
carsten provides a new my.cnf that will include files in /etc/mysql/conf.d/
you copied this statement into a file in that directory. that gives an infinite include loop.
my guess is that you didnāt change the owner of /opt/mariadb on the host. iām not sure which uid the user mysql has. maybe chown -R 27:27 /opt/mariadb will help. (27 should be the default uid of the mysql user.)
if not: check the folder permisions with ls -l /opt/mariadb/log
then chmod 0777 /opt/mariadb/log
and start the container.
look which ids the files created in there have. use this id in the chown command and revert chmod 07xx /opt/mariadb/log. (replace the xx with the original values.)
Thanks very much for the continued advice. Iām getting closer, I can feel it.
Deleting the !include lines from nextcloud.cnf seemed to do the trick for those warnings, but Iām still having trouble when I try to get the MariaDB server up. I entered chown -R 27:27 /opt/mariadb and then entered ls -l /opt. The result for the mariadb directory was as follows:
drwxr-xr-x 5 27 sudo 4096 Feb 16 23:54 mariadb
That didnāt seem to me to be quite right, but I tried docker-compose up -d anyway and found another āpermission deniedā error in the MariaDB log.
I then tried something else based on a DuckDuck search I did for uid, so Iām sorry if I mucked things. I entered getent passwd from the command line and noticed this output for the mysql entry:
Iām sorry for continuing to be such a pain, but I have another hurdle to overcome. When I entered docker exec -it <containerName> /bin/bash I got the following response:
Error response from daemon: Container <containerID> is restarting, wait until the container is running
I waited & retried several times, each time getting the same response, and Iām not sure what to try next. Can I do some kind of docker run command on just the mariadb:latest image and then work with that container for changing necessary chown parameters? Iām guessing that such an approach wouldnāt help my docker-compose stuff.
Apologies for the thread bump, but I really would like to get Nextcloud up & running. Could someone suggest how I might overcome my newbie errors with this Docker Compose setup?