Stack for a Raspberry Pi home server running:
- UniFi Network Application — network controller for Ubiquiti devices
- MongoDB — database backend for UniFi (Raspberry Pi-compatible build)
- Home Assistant — home automation platform
- Mosquitto — MQTT broker
- Pi-hole — DNS-level ad blocking and local DNS/DHCP
- Raspberry Pi 4 (aarch64)
- Docker Compose or Podman with Quadlet support (Podman 4.4+)
-
Clone the repo onto the Pi:
git clone <repo-url> cd autonomous
-
Create a
.envfile (not committed):MONGO_PASS=<strong-password> WEBPASSWORD=<pihole-admin-password>
-
Start all services using either Docker Compose or Podman Quadlet:
docker compose up -dCopy (or symlink) the unit files to the systemd directory and start the services:
sudo cp quadlet/* /etc/containers/systemd/
sudo systemctl daemon-reload
sudo systemctl start unifi-db.service unifi.service mosquitto.service homeassistant.service pihole.serviceThe unit files use absolute paths hardcoded to /home/forain/Projects/autonomous. If the repo is cloned elsewhere, update WorkingDirectory and all Volume= and EnvironmentFile= paths in each .container file accordingly.
On first start, init-mongo.sh runs automatically inside the unifi-db container to create the UniFi database user. This only happens when ./unifi-db is empty.
| Service | Access |
|---|---|
| UniFi Network Application | https://<pi-ip>:8443 |
| Home Assistant | http://<pi-ip>:8123 |
| Pi-hole | http://<pi-ip>/admin |
Mosquitto listens on the host network (port 1883).
If the UniFi database needs to be recreated from scratch:
# Docker Compose
docker compose down
sudo rm -rf ./unifi-db
docker compose up -d
# Podman Quadlet
sudo systemctl stop unifi.service unifi-db.service
sudo rm -rf ./unifi-db
sudo systemctl start unifi-db.service unifi.service