Contribute to flor0/nextcloud-docker development by creating an account on GitHub.
For years I've been running my Nextcloud on bare metal. Now I finally decided to switch it to docker. I looked into Nextcloud All-In-One and it seems easy to deploy but it lacks configuration options like multiple domain names and putting it behind a traefik reverse proxy is kind of a pain to set up.
You can check out my solution on GitHub. I decided on a docker compose setup with nginx, php-fpm and redis(redis is now replaced by KeyDB) in separate containers. Obviously it's for experts but it's a lot more configurable. than AIO. It's also just as easy to migrate to as with any bare metal setup and just as configurable.Yes it's still a pain to set up, but better than the bare metal version lol
What do you guys think about putting the different components (webserver, php, redis, etc.) in separate containers like this, as compared to all in one? Feedback is greatly appreciated!
People usually come here looking for advice on how to replace their dockerized nextcloud setup with a bare-metal setup. Now you came along presenting a solution to do the reverse! Bravo!
What do you guys think about putting the different components (webserver, php, redis, etc.) in separate containers like this, as compared to all in one?
I actually has a similar setup, but with nextcloud apache container instead of php-fpm, and in rke2 instead of docker compose.
Thanks for the kind words! Could you link me to the apache container you use? I would like to replace nginx since it's not officially supported but still need to do some research on apache
I'm currently using nextcloud:26-apache from here because some nextcloud apps I use is not compatible with v27 and v28 yet. The apache version is actually less hassle to use because nextcloud can generate .htaccess configuration dynamically by itself, unlike php-fpm version where you have to maintain your own nginx configuration. The php-fpm version is supposedly faster and scale better though, but chance that you won't see that benefits unless your server handles a large amount of traffics.
Seems similar to what I'm doing but it uses the nextcloud:fpm-alpine image, which is community maintained. It's a valid approach but I prefer to tweak my php-fpm config myself. By using their docker image you basically lose a bunch of freedom to configure your setup, but it's easier to set up for sure
NextCloud’s trusted_proxies setting supports CIDR notation, so it mught be better to set the subnet of Traefik’s network as opposed to the IP address. That way, if you ever need to do anything with the container (I.e. upgrade traefik), the IP can change but the subnet is less likely to change.
True. That's a good improvement. Thanks a lot! By the way do you know if the nextcloud trusted_proxies setting allows for hostnames such as "traefik" as compared to just IP addresses?
What do you guys think about putting the different components (webserver, php, redis, etc.) in separate containers like this, as compared to all in one?
It's much better to separate them. You can update them separately, you can configure and fine-tune them separately, you can reuse the images for different apps, you can reuse a container for multiple apps etc.
Not to mention not having to rebuild the all-in-one image yourself, which can get very finicky.