Automation using docker compose in your NAS (raspberry pi, orange pi, nuc or delorean lol)
- Install docker
- Install docker compose
- Configure Github user if you need it (see Github section)
- Check
mount-hdd.shto mount your disk in NAS - Clone this repository
- Set static ip in the NAS (explained below)
- Configure your
.envfile with all variables required as described in.env.example - Run
docker compose up --build -dto start containers - Run
sh install-hacs.shto install HACS in Home Assistant container - Configure your router with the static ip assigned to NAS as DNS primary, necessary for pihole
- Configure all devices you need in Home Assistant
- Go to Cloudflare Tunnel Dashboard and expose all containers you want. You need a domain previously configured in Cloudflare
- Enjoy!
- Home Assistant (HACS)
- SFTPGo (secure file transfer)
- Homebridge (integrate devices with HomeKit)
- Cloudflared (Cloudflare Tunnel)
- Portainer (Manage containers)
- WatchTower (Update containers)
- PiHole (DNS filtering / ad blocking / privacy)
- Tailscale (VPN)
- WireGuard Easy (VPN) ...some day. CGNAT is too complicated.
- Addons for Home Assistant
- QBitTorrent
- Mosquitto (MQTT Broker for IOT)
sudo nmtui
Edit your connection with this values.
- address: 192.168.1.10/24 (static ip example)
- gateway: 192.168.1.1
- dns: 1.1.1.1
- dns: 1.0.0.1
ssh-keygen -t rsa -b 4096 -C "your@email.com"
Setting > SSH and GPG keys > New SSH key
Good job, you can now clone all repositories!
Go to Tailscale and create account. Move to Setting > Personal Settings > Keys > Generate auth key
Complete form and enable Reusable option. Remember auth key expire in 90 days (free mode). Add this key in your .env file.
After run docker containers go to Machines section, in homelab-docker machine > 3 dots > edit route settings > check if subnet routes and exit node is enabled.
Install tailscale app in your mobile, login with your account and enjoy!
Fix database, maybe you need in first time
docker exec -it pihole pihole -g
Go to Home Assistant > File Editor > configuration.yaml > Edit
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.20.0.0/24
ip_ban_enabled: true
login_attempts_threshold: 5
Up services
docker compose up --build -d
Check status
docker ps
Enter into container
docker exec -ti <container-name-or-id> /bin/bash
Stop services
docker compose down
See logs
docker compose logs -f <container-name-or-id>