Skip to content

Instantly share code, notes, and snippets.

@simon04 simon04/Caddyfile
Last active Apr 18, 2020

Embed
What would you like to do?
Nextcloud via Docker and Caddy

This runs Nextcloud as Docker container (using the fpm image) and serves it via Caddy

systemctl --user daemon-reload
systemctl --user start docker-nextcloud.service
sudo systemctl start caddy.service

Run the following command via the host cron for Nextcloud's background jobs (neither AJAX nor Webcron fetch RSS feeds for Nextcloud news):

docker exec --user www-data nextcloud-systemd php /var/www/html/cron.php

To update Nextcloud, run docker pull nextcloud:fpm followed by systemctl --user restart docker-nextcloud.service.

# /etc/caddy/Caddyfile
cloud.example.com {
root /srv/http/nextcloud/
fastcgi / localhost:7070 php {
root /var/www/html/
}
timeouts 30m
}
# .config/systemd/user/docker-nextcloud.service
[Unit]
Description=Docker Nextcloud
[Service]
Restart=always
ExecStart=/usr/bin/docker run \
--name=nextcloud-systemd \
--rm \
-p 7070:9000 \
-v /srv/http/nextcloud:/var/www/html \
-v /home/simon/nextCloud.d/config:/var/www/html/config \
-v /home/simon/nextCloud.d/data:/var/www/html/data \
-v /home/simon/Fotos:/Fotos \
nextcloud:fpm
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.