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
5 proxy:
6 image: jwilder/nginx-proxy:alpine
7 labels:
8 - âcom.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=trueâ
9 container_name: nextcloud-proxy
10 networks:
11 - nextcloud_network
12 ports:
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:
volumes:
- nextcloud:/var/www/html
- ./app/config:/var/www/html/config
- ./app/custom_apps:/var/www/html/custom_apps
- ./app/data:/var/www/html/data
- ./app/themes:/var/www/html/themes
- /etc/localtime:/etc/localtime:ro
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.
short version:
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.
Failed to connect to the database: An exception occurred in driver: SQLSTAT
E[HY000] [1045] Access denied for user ânextcloudâ@â172.19.0.5â (using pass
word: YES)
Iâve tried both with and without password, with both lines, not quite sure whatâs wrong or how to debug it.
Thank you for all your patience helping me by the way, itâs highly appreciated.
Failed to connect to the database: An exception occurred in driver: SQLSTAT
E[HY000] [1045] Access denied for user ânextcloudâ@â172.19.0.5â (using pass
word: YES)
sudo docker exec --user www-data nextcloud-app php occ db:convert-type --password test --all-apps mysql nextcloud nextcloud-mariadb nextcloud
In Connection.php line 64:
Failed to connect to the database: An exception occurred in driver: SQLSTAT
E[HY000] [1045] Access denied for user ânextcloudâ@â172.19.0.5â (using pass
word: YES)