Nextcloud in a Container

Nextcloud is running as a docker container in my Home Lab.

I used to store the data separately from the server it was running on. See Nextcloud Storing Data on NAS

Maintenance

  • When upgrading, make sure to not skip version numbers such as going from 15 directly to 17. Furthermore make sure to rebuild the nextcloud-app container with docker-compose up -d --build.

Nextcloud Docker Commands

Nextcloud Docker Commands

# connect to the mysql database
docker --context server exec --user www-data -it nextcloud-app bash
 
# or run an occ command
docker --context server exec --user www-data -it nextcloud-app php occ status
 
# run upgrade migrations
docker --context server exec --user www-data -it nextcloud-app php occ upgrade -v
 
# set maintenance mode
docker --context server exec --user www-data -it nextcloud-app php occ maintenance:mode --on
docker --context server exec --user www-data -it nextcloud-app php occ maintenance:mode --off
 
# connect to the database
docker --context server exec --user www-data -it nextcloud-db mysql -u root -p'MYDBPASSWD' -D nextcloud
Link to original