Docker compose repo for home server based on a raspberry Pi with a couple of handy services. Included services:
- Heimdall (Application dashboard and launcher)
- Pi-hole (A black hole for Internet advertisements)
- Homeassistant (Open source home automation that puts local control and privacy first. )
- InfluxDB (Database that stores and queries any type of time series data)
- MariaDB (Relational database)
- Node-RED (Browser-based flow editing)
Install Raspbian Lite on the SD-card/SSD-drive through Raspberry Pi Imager
Edit /boot/config.txt
and add this line:
gpu_mem=16
After booting your device, run the basic updates/upgrades:
sudo apt-get update
sudo apt-get upgrade
Start the Docker installer
curl -sSL https://get.docker.com | sh
Set Docker to auto-start
sudo systemctl enable docker
The Docker client can only be used by root or members of the docker group. Add pi or your equivalent user to the docker group:
sudo usermod -aG docker pihome
Install portainer volume
docker volume create portainer_data
Install portainer
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
- Go to your portainer instance: https://pihome.local:9443
- Go to stacks
- Click "Add stack"
- Add a name "pihome"
- Choose repository as build method
- Repository URL: https://github.com/glamorous/pihome
- Repository reference: refs/head/master
- GitOps updates: true
- Fetch interval: 5m
- Environment variables
- Upload the secrets.env and adjust where needed (only first time, otherwise manual adding)
- Deploy the stack
- Go to http://pihome.local:8086 and follow onboarding
- Choose a username and password
- Choose "home" as your organisation name
- Choose "homeassistant" as your bucket name
- Click "Quick start"
Instead of username and password, we need tokens for applications that will use InfluxDB (such as Home assistant)
- Click "API tokens" on first menu item
- Click "Generate API token" - "Custom API token"
- Click a name, for example "homeassistant" and choose the correct rights for the selected bucket
- Home assistant will need write access!
- Copy the token so you can add it to your config of the application
Open HomeAssistant configuration.yaml
file and add:
influxdb:
api_version: 2
ssl: false
host: localhost
port: 8086
token: !secret INFLUXDB_TOKEN
organization: !secret INFLUXDB_ORG
bucket: !secret INFLUXDB_BUCKET
Open HomeAssistant secrets.yaml
file and add:
INFLUXDB_TOKEN: YOUR_API_TOKEN_FROM_PREVIOUS_STEP
INFLUXDB_ORG: home
INFLUXDB_BUCKET: homeassistant
- Create "node-red" user with an administrator role in Home Assistant
- Login with new user
- Create a long-lived access token
- Click Menu -> Manage Palette -> Install
- Search for node-red-contrib-home-assistant-websocket and install
- Configure/Add Home Assistant server by selecting node and "Add a server" en fill on details and live access token.