In my perception the official examples did not provide a working home production ready Docker example to host a private NextCloud on your own server.
-
PostgreSQL backend and nginx Frontend: Based on NextCloud PostgreSQL Apache example
-
Letsencrypt SSL https-support
To get this running, have an installed docker-compose
available and:
-
register two dynamic domains i.e. at https://freedns.org
-
one for your nextcloud:
mynextcloud.mooo.com
-
one only to host Collabora:
myoffice.mooo.com
-
-
publicly expose TCP port 80 & 443 of your host in router
-
Adjust all
[##VALUES##]
in the files:docker-compose.yml
anddb.env
. Highly recommended: Uncomment theLETSENCRYPT_TEST=true
setting to test you deployment. -
Optional: I added/adjusted my
/etc/docker/daemon.js
to define a custom data storage location:{ "data-root": "/srv/dockerdata" }
and restarted the docker daemon -
Run
sudo docker-compose up --build
-
Access your installation at https://[##mynextcloud.mooo.com##].
-
Activate Collabora plugin in NextCloud und define https://[##myoffice.mooo.com##] as URL. Ignore the Saved with error: Collabora Online should use the same protocol as the server installation message.
-
For now and until the merge request #819 is merged into upstream you need to run
sudo docker-compose exec --user www-data app php occ config:system:set overwriteprotocol --value="https"
once or you will have problems to login i.e. via the Android app as described in my ticket for the Android app
Simply do the following. Due to the persistent Docker volumes this will retain all your data and even your running login sessions.
$ sudo docker-compose down
$ sudo docker-compose build --pull
$ sudo docker-compose up -d
I’m not sure, but after major release upgrade a subsequent sudo docker-compose exec --user www-data app php occ db:add-missing-indices
might be necessary or not. At least it won’t hurt. I also provided a upgrade-nextcloud
shell script I’m using for convenience.