A raspberry pi compose stack for home automation.
- Home Assistant - used for home automation
- SWAG (Nginx Proxy Manager) - used for exposing services to the internet
- Portainer - Isolated - used for managing docker containers
- Watchtower - used for auto-updating docker containers
- WG-Easy (Wireguard) - used for VPN access to the network
- Speedtest Tracker - used for tracking internet speed
- This stack is targeted for a Raspberry Pi, but can be used in any other system and adapted easily if needed.
- This stack assumes that you have a domain and a dynamic DNS service to update your IP address.
- Some features are optional and can be removed if you don't need them.
- Speedtest Tracker - if you don't want to track your internet speed
- SWAG - if you don't want to expose services to the internet
- WG-Easy - if you don't want to access your network remotely via VPN
- Watchtower - if you don't want to auto-update your containers
-
Create tailscale account here.
-
Install tailscale on Raspberry Pi following the instructions here.
-
Start tailscale with
sudo tailscale up
-
Authenticate your device by following the link provided in the terminal.
-
Once authenticated, verify that your device is connected by running
tailscale status
-
If you want to access your devices via the Raspberry Pi, enable subnet routing by running
sudo tailscale set --advertise-routes=192.0.2.0/24(replace
192.0.2.0/24with your local network subnet) -
Fork the repository & clone it
-
Copy
portainer/docker-compose.ymlto your serverscp portainer/docker-compose.yml user@server:/path/to/stack
-
Start the stack with
docker-compose up -d
-
In order to expose home assistant to the Internet you will need a Tailscale funnel
Use the configuration tailscale.json as a starting point.
Create a folder
/docker/ts-homeassistanton your server and copy the file there.ssh user@server su mkdir -p /docker/ts-homeassistant exitscp tailscale/tailscale.json user@server:/docker/ts-homeassistant/tailscale.json
-
Go to the Tailscale admin console, navigate to "DNS" and enable "HTTPS Certificates".
-
Go to the Tailscale admin console, navigate to "Settings". On left select "Keys" and create an Auth Key with
-
Login to Portainer and setup a stack pointing to
hub/docker-compose.yml -
Configure the following environment variables required for the stack & deploy it:
STACK_TIMEZONE=Europe/Lisbon SPEEDTEST_TRACKER_APP_KEY=base64:YWJjZDEyMzQ= DOCKER_INTERNAL_SUBNET=123.0.0.0/24 TAILSCALE_AUTH_KEY=tskey-1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef HOME_ASSISTANT_HOSTNAME=homeassistant
- If you have issues with the bluetooth service, check the Bluetooth documentation.
This project is released under MIT License.
