Skip to content

semka95/rootless-nextcloud-compose

Repository files navigation

Steps to run Nextcloud in rootless docker:

  1. Copy systemd service file to default folder and run it:
cp nextcloud-rootless-compose.service ~/.config/systemd/user/
systemctl --user enable --now nextcloud-rootless-compose.service
  1. Open port 80 and 443:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# or if you are using iptables
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
sudo iptables-save > /etc/iptables/rules.v4

This compose file based on example from oficial nextcloud docker repository, link. I chose compose file with mariadb and nginx proxy.

Before running rename all .exapmle files, leave redis-session.ini empty, set all environment variables in nc.env and web.env.

Also, you should run cronjob on machine, not docker. Run crontab -e and insert this, change nextcloud container name:

*/5 * * * * DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock docker exec -u www-data:www-data NEXTCLOUD_CONTAINER_NAME php ./cron.php 

Database and proxy run in separate service, so I can use it in other services. Check out this repository for more information.

Install preview generator app and add cronjob:

*/50 * * * * DOCKER_HOST=unix:///run/user/$(id -u)/docker.sock docker exec -u www-data:www-data rootless-nextcloud-compose_app_1 php ./occ preview:pre-generate

This will prevent server crashing when generating a lot of previews wnen opening folder with a lot of images.

Links

About

Rootless Nextcloud Docker Compose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published