Install and configure NextCloud.
services:
db:
image: mariadb:10.6
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
labels:
com.centurylinklabs.watchtower.enable: true
app:
image: nextcloud
restart: unless-stopped
ports:
- 8080:80
links:
- db
- redis
volumes:
- ./nextcloud:/var/www/html
- /media/documents/:/media/documents/
- /media/media/images/:/media/images/
- /media/share/:/media/share/
environment:
- MYSQL_PASSWORD=password
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_HOST_PASSWORD=password
labels:
com.centurylinklabs.watchtower.enable: true
redis:
image: redis
restart: unless-stopped
command: redis-server --requirepass password
labels:
com.centurylinklabs.watchtower.enable: true
Replace password with a secure password and adjust the /media/... to fit your needs.
If you're not running watchtower you can remove the labels:.
To start the stack, simply run the following command:
docker compose up -d