Wanted to share a guide I made for running Nextcloud in Docker with Apache and Let's Encrypt

I’ve been using Nextcloud on my home server since version 15 was just released and so far I’m very happy with it. It went through many experiments and upgrades all the way up to 19.0.1 and so far nothing broke (yet).

When I first was deploying Nextcloud, I wanted to have it running inside three Docker containers: Apache, Nextcloud (nextcloud-fpm) and Postgres. Unfortunately, I couldn’t find any documentation on proper Apache configuration (with fast-CGI proxy, HTTPS, HTTP2, caching, proper security headers etc.), so I had to figure it out myself.

I keep the documentation for everything that I run on my small home server on GitHub here (the compiled HTML version is hosted using GitHub pages and available at ovk.github.io/silverbox.
And since a big part of it dedicated to installing and running Nextcloud, I thought I’d share it here.

Hopefully it can be useful to someone.

3 Likes

That is a heck of a guide! It looks to actually be a great overview of a whole home network that happens to include Nextcloud :stuck_out_tongue:

I plan to dig into it a bit more but I wanted to ask a question before I dived too far in & ask if you know of a ready-made Docker container that does Apache & certbot for nextcloud:fpm.

To explain, I want to do the same thing as you–separate nextcloud & database & webproxy. However I already have an existing database so I just need to install NC & a proxy with certbot! Since nextcloud:fpm exists, that “just” leaves Apache. As you know configuring Apache for NC isn’t trivial so I’d love to see if there’s an existing container that already did this?

Is your setup uncoupled enough to point to a container & an apache.conf file? Or is there more to it than that?