Skip to content

forain/autonomous

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Automation Stack

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

Requirements

  • Raspberry Pi 4 (aarch64)
  • Docker Compose or Podman with Quadlet support (Podman 4.4+)

Setup

  1. Clone the repo onto the Pi:

    git clone <repo-url>
    cd autonomous
  2. Create a .env file (not committed):

    MONGO_PASS=<strong-password>
    WEBPASSWORD=<pihole-admin-password>
  3. Start all services using either Docker Compose or Podman Quadlet:

Docker Compose

docker compose up -d

Podman Quadlet

Copy (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.service

The 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.

Services

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).

Resetting MongoDB

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

About

A home automation monorepo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages