Skip to content

Self Hosted

Setting up AdguardHome and PiHole on the bridge network

Last week I showed you how to run AdguardHome and PiHole using MacVLans. This way we didn't have to deal with any port conflicts and each dns server could be run simultaneously on its own IP address. However, it is undeniable that the MacVLan is a little bit trickier, so in this post we're going to set these up again, only one running at a time of course, in the bridge network, so that our actual server is also a DNS server.

Setting up NextCloud AIO

We already have Nginx set up as our reverse proxy so that changes the docker command a bit. NextCloud AIO is simply portainer-like container management for NextCloud containers. We simply run a docker run command to initial the AIO interface and from there we configure the containers. If you run most of your apps with docker compose, this is slightly annoying because you cannot manage your containers like you normally would, you have to do so through the abstraction of the AIO interface.

Setting up Loki/Grafana in Docker to analyze Nginx logs

To be honest, it's a little confusing how to get started because there are lots of instructions out there and docker compose files floating around that are outdated. Let's follow the official docs at https://grafana.com/docs/loki/latest/setup/install/docker/#install-with-docker-compose.

The docker compose file from the docs as of today is here: https://raw.githubusercontent.com/grafana/loki/v3.4.1/production/docker-compose.yaml. Note that the link is likely subject to change with new versions.

Nginx in Docker with GeoIP

To use the GeoIP2 module. We pretty much need to use a Dockerfile to start with the latest nginx, but then compile the GeoIP2 module from source. This is preferred because using precompiled binaries is actually challenging - we have to ensure we get the binary that was compiled with the same nginx version that we have. Compiling the module ourselves actually simplifies this process.

Nginx in Docker with Local Let's Encrypt Certs

Docker Project folder

├── docker
│   ├── nginx
│   │   ├── docker-compose.yml
│   │   ├── cloudflare.ini
│   │   ├── nginx.conf
│   └── └── (any additional confs for server blocks)
└────────────