Hi, I had a Nextcloud installation coexisting peacefully on a subdomain with the main website, and wanted to move to a new server. As part of the server move I wanted to containerize Nextcloud and chose to try the official Nextcloud Docker image. However I chose to try following the guide at https://blog.ssdnodes.com/blog/installing-nextcloud-docker/ because it seemed like an alright step-by-step guide (I honestly found the official documentation to assume one knew quite a bit about both Docker and Nextcloud). However, since I already run an Nginx server on the host, I got
`ERROR: for nextcloud-proxy Cannot start service proxy: driver failed programming external connectivity on endpoint nextcloud-proxy (10266df6521e1510a8745c8c3facc68d8358cfd6034b2c8344723a679ad70a1c): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use
ERROR: for proxy Cannot start service proxy: driver failed programming external connectivity on endpoint nextcloud-proxy (10266df6521e1510a8745c8c3facc68d8358cfd6034b2c8344723a679ad70a1c): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use`
I only want the subdomain cloud.mydomain to direct traffic at Nextcloud, and the main site mydomain to well, go to the main site. Since the ports are already in use by Nginx serving the main site, I figured I should change the ports in the nextcloud-proxy config. So I changed my docker-compose.yml to say
6 image: jwilder/nginx-proxy:alpine
8 - “com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true”
9 container_name: nextcloud-proxy
11 - nextcloud_network
13 - 8080:80
14 - 65432:443
It made the Docker containers spin up successfully, however it still doesn’t work and I’m honestly lost. If you’ve read this far, thanks.
Okay, that could be done if I knew what I was doing. The article you linked to is soon to be six years old and requires me to download something from Github and run as root…
And now it just hangs at
2019/12/17 23:04:37 Generated ‘/etc/nginx/sites-enabled/default’ from 3 containers
2019/12/17 23:04:37 Running ‘/etc/init.d/nginx reload’
2019/12/17 23:04:37 Error running notify command: /etc/init.d/nginx reload, exit status 1
2019/12/17 23:04:37 Watching docker events
2019/12/17 23:04:37 Contents of /etc/nginx/sites-enabled/default did not change. Skipping notification ‘/etc/init.d/nginx reload’
Right now I’ve just got a question regarding files placement, it confused me a lot that it put quite a lot of files, like the config and data into a folder named ‘app’ in my home folder… in retrospect it’s obvious from this section:
So my current inquiry is whether I should change this, and if so to what? It seems counter-intuitive to have those files there, I was sure they would be located in /var/lib/docker/volumes/[my username]_nextcloud/_data/
Oh and I also wonder how to actually change to the right database that I have backed up, the guide that I’m using says:
Wait a minute for the SSL certificate generation process to finish, and then load up the domain name you chose in your browser. Enter your chosen admin username and password. Choose MySQL as the database in the configure database section. Type in the username, password, and database name you configured via the MYSQL_USER, MYSQL_PASSWORD, and MYSQL_DATABASE environment variable from earlier. Change the hostname value from localhost to db and click Finish Setup. The system then redirects you to the Nextcloud dashboard.
However after creating username and password I got no prompt to choose database type, database username, database password nor database name, nor hostname value, so I don’t know how to proceed with restoring the MariaDB database I have.
the first line - nextcloud:/var/www/html is sufficient.
but might be a bit inconvenient.
the indention to put things in ./app is to have all content that should be in a backup in an easy to access/find place. of course you can put that as well in /var/nextcloud/data/somwhere/else. you only have to remember where you put it and/or put the correct path in your backup script. if you have one.
you stop nextcloud.
restore the database.
restore the datadirectory and
start nextcloud again.
btw: i think the howto is outdated. now - if the MYSQL_xxx variables are defined - the entrypoint.sh runs a silent system setup.
Thanks again, I’m mainly wondering how to point the Nextcloud config to the correct MariaDB database - where does the database need to reside in the filesystem, and how do I make it use it instead of the sqlite database it’s currently using? Sorry for all the silly questions, but things being in containers make me really unsure where stuff is at and where I do the config changes needed.