Installing Home Assistant with HACS and Tailscale

Introduction
In this guide, we will see how to install Home Assistant using Docker, how to add the HACS (Home Assistant Community Store) plugin to extend functionality with custom components, and how to use Tailscale to securely connect without the need for port forwarding. With this setup, you will be able to easily manage Home Assistant, access it remotely securely, and without complications.
Advantages of this setup:
- Advanced security with Tailscale (VPN) and Home Assistant.
- Easy management with Docker for Home Assistant and HACS.
- Secure remote access without port forwarding.
Prerequisites
Before you start, make sure you have:
- A local server to run Home Assistant (could be a PC, Raspberry Pi, Intel NUC, etc.);
- Docker and Docker Compose installed on the server;
- A GitHub account (required for installing HACS);
- Tailscale to create a secure VPN for remote access.
1. Installing Docker and Docker Compose
If Docker and Docker Compose are not already installed, follow these steps to install them:
Installing Docker:
|
|
Installing Docker Compose:
|
|
Verify that Docker and Docker Compose are installed correctly:
|
|
2. Installing Home Assistant with Docker
Creating the configuration directories
To keep everything organized, create a folder for Home Assistant’s data:
|
|
Creating the Docker Compose file for Home Assistant
Inside the folder you just created, create a file named docker-compose.yml
with this configuration:
|
|
Starting the Home Assistant container
Start the Home Assistant container with the command:
|
|
Now, Home Assistant will be running and accessible at http://localhost:8123
.
3. Installing HACS (Home Assistant Community Store)
To expand Home Assistant’s functionality, you can use HACS, which allows you to add community integrations and components.
Download and install HACS
Run the following script to download and install HACS:
|
|
Restart Home Assistant
After installing HACS, restart the Home Assistant container to apply the changes:
|
|
Add HACS to Home Assistant
- Go to Settings > Devices & Services.
- Click the “+” button at the bottom and search for HACS.
- Follow the instructions to link your GitHub account and complete the installation.
Now you can access all the Home Assistant community integrations and components through HACS.
4. Configuring Tailscale for Secure Access
To ensure that access to Home Assistant is secure even remotely, we use Tailscale, a VPN that allows you to access your devices securely, without port forwarding.
Installing Tailscale
Install Tailscale on the server and the devices from which you want to access Home Assistant.
- Install Tailscale on the server:
|
|
- Install Tailscale on the devices (PC, smartphone, etc.):
Download Tailscale from the official site for all the devices you want to use to access Home Assistant.
Connect the server to the Tailscale network
Run the command sudo tailscale up
to connect your server to the Tailscale network. After logging in, you will get a private IP for your server.
Access Home Assistant via Tailscale
Now you can access Home Assistant using the private Tailscale IP, without port forwarding. For example, access Home Assistant via:
|
|
5. Secure Remote Access without Port Forwarding
Thanks to Tailscale, there is no need to do port forwarding on your router. You can access Home Assistant from any device with Tailscale installed, securely, via the private VPN.
6. Conclusion
Now you have a secure and scalable Home Assistant setup with HACS for integrations, and remote access through Tailscale without port forwarding. This setup allows you to:
- Access Home Assistant securely and remotely without exposing the server to the internet.
- Easily manage your system with Docker and HACS.
- Keep your system secure thanks to the Tailscale VPN.
Additional resources:
With this guide, you’ve learned how to set up Home Assistant with the HACS plugin and secure remote access using Tailscale. Enjoy your home automation setup!
Need help?
If something isn’t working as it should, don’t worry, you’re on the right track. Double-check to make sure the prerequisites are met and start with a clean environment. If you’re still having trouble, feel free to leave a comment so I or someone else can help you out.