-
Set domain and eMail address in
.env
# General settings # Domain used for trusted domains (config.php) DOMAIN=localhost # Domains for TLS certificates. Items separated by comma + space: ", " TLS_DOMAINS="localhost, nextcloud.local" ADMIN_EMAIL=a@b.de
-
Create volumes
docker volume create nextcloud_caddy_data docker volume create nextcloud_data docker volume create nextcloud_db_data
-
Deploy Nextcloud
docker compose up -d --build
docker volume create nextcloud_caddy_data
docker volume create nextcloud_data
docker volume create nextcloud_db_data
Note: To use a local folder on your server (bind mount) for Nextcloud data, adapt the volume settings in
docker-compose.yml
.# ... volumes: nextcloud_caddy_data: external: true # Comment out and use code below to use a bind mount for data folder nextcloud_data: external: true # Use this, if using bind mount # nextcloud_data: # driver: local # driver_opts: # type: none # o: bind # device: "${PWD}/data" nextcloud_db_data: external: true # ...
Adapt .env
for your requirements.
# General settings
# Domain used for trusted domains (config.php)
DOMAIN=localhost
# Domains for TLS certificates. Items separated by comma + space: ", "
TLS_DOMAINS="localhost, nextcloud.local"
ADMIN_EMAIL=a@b.de
# Caddy TLS directive settings
# https://caddyserver.com/docs/caddyfile/directives/tls
# Use this for self-signed certificates, e.g. in your LAN
# CADDY_TLS="tls internal"
# Usage of own certificates
# CADDY_TLS="tls /certs/fullchain.pem /certs/key.key"
# Nextcloud
NEXTCLOUD_VERSION=27.1.3-fpm
NEXTCLOUD_ADMIN_USER=admin # Change username and password!!
NEXTCLOUD_ADMIN_PASSWORD=changeMe
# Nextcloud PHP settings
PHP_MEMORY_LIMIT=1024M
PHP_UPLOAD_LIMIT=16G
# DB
POSTGRES_VERSION=16-alpine
POSTGRES_DB=nextcloud # Change username and password!!
POSTGRES_USER=nextcloud
POSTGRES_PASSWORD=changeMe
# Docker settings
DOCKER_LOGGING_MAX_SIZE=5m
DOCKER_LOGGING_MAX_FILE=3
docker compose up -d --build
Your instance will be available after a couple of seconds unter https://localhost or https://DOMAIN, as specified in .env
.
Follow the steps to use a imaginary stack as your image preview provider.
- Deploy imaginary stack:
docker compose -f imaginary.yml up -d
ordocker stack deploy -c imaginary.yml imaginary
- Uncomment imaginary network in
docker-compose.yml
- Uncomment imaginary settings in
nextcloud.env
- Add Imaginary to preview provider in
config.php
- Re-deploy the stack
docker compose up -d --build
To store the nextcloud data in a host folder, e.g. to make backups easier, uncomment
this section in docker-compose.yml
:
volumes:
# ...
# Comment out and use code below to use a bind mount for data folder
# nextcloud_data:
# external: true
# Use this, if using bind mount
nextcloud_data:
driver: local
driver_opts:
type: none
o: bind
device: "${PWD}/data"
Create the folder on the host, in this example: mkdir data
.
Then you're ready to deploy the stack docker compose up -d --build
.