Home Assistant ZeroTier add-on is available and I am going to show you how to set up a ZeroTier VPN in Home Assistant, so you will be able to access it securely from any device running windows, macOS, linux, iOS or Android.
With ZeroTier you don’t need static IP or dynamic DNSes and you don’t have to go through complicated certificate creation process. On top, that whole setup will cost you nothing.
Table of Contents
What is ZeroTier?
It is a company, and they have a flagship product called ZeroTier One. So, when I’m saying ZeroTier I’m actually referring to the ZeroTier One product. Clearing this out you may now wonder what is ZeroTier One?
What is ZeroTier One?
ZeroTier One is an open-source application that can be used to create secure and manageable networks where connected devices are treated like they’re in the same physical location and local network. ZeroTier provides a web based interface for network and clients management.
Unlike traditional VPN solutions, communications don’t need to pass through a central server or router — messages are sent directly from host to host and the result is very efficient and with minimal latency.
Home Assistant ZeroTier add-on
And here comes the Home Assistant in the whole picture. Thanks to Frenck, we have a Home Assistant ZeroTier One Community Add-on (link to GitHub page of the project). Using this add-on you can add your Home Assistant instance to the ZeroTier network and then to access it from anywhere in the world using virtually any modern device. Without any port forwards, payments, certificates and so on.
Let’s start a demo where:
- I will login to ZeroTier website and I will create and configure a ZeroTier network.
- After that, I will add my Home Assistant and my phone to the ZeroTier network, so they can communicate with each other regarding of their physical location and Internet connectivity.
ZeroTier Account creation
First, you need to setup a ZeroTier account:
- Go to https://zerotier.com and make an account.
You can use an existing Google, GitHub or Microsoft account to login or you can create a totally new one.
Create ZeroTier Network
After you logged in ZeroTier one way or another, go to Networks tab and create a new virtual Network by just clicking on Create a Network button.
A new network will be created instantly. This ZeroTier Network will have unique ID and a Name. The Network ID is one of the most important part of your ZeroTier network. Try to share your ZeroTier Network ID only with people you trust.
Configuring the ZeroTier network
Make sure that under Access Control section the Private Network option is set.
This ensures that only approved machines can connect to your network, and not just anyone who happens to know your ZeroTier Network ID! More on that later, because now I’m going to change the ZeroTier Network Name and subnet.
Under the Advanced section, I will choose a subnet that will be different with my existing local subnet.
I will leave all other settings as they are and I will add some clients/members for example my Home Assistant using the Home Assistant ZeroTier add-on and my Phone using the ZeroTier mobile app. I will start with Home Assistant.
Installation and starting ZeroTier Home Assistant add-on
The installation of this add-on is pretty straightforward and not very different in comparison to installing any other Home Assistant add-on.
In Home Assistant, go to: Configuration > Add-ons, Backups & Supervisor > Add-on Store and search for ZeroTier and install it.
Or you can click on the My Home Assistant button below and then search for ZeroTier.
When the Home Assistant ZeroTier add-on installation is finished, click on the Configuration tab of the add-on and add your ZeroTier network ID there.
In the above picture you can see how I added my Network ID in Home Assistant ZeroTier add-on configuration. You should do the same, but please, don’t forget to change the Network ID with yours.
When you are ready, go to Info tab of the Home Assistant ZeroTier add-on and click on the Start button. Optionally, in the Log tab you can hunt for errors or you can check if everything is OK.
Approve Home Assistant client in ZeroTier network
This is where all the beauty and simplicity of ZeroTier can be seen. To confirm adding Home Assistant instance in my ZeroTier network I just have to approve this client from the ZeroTier web interface.
Additionally, you can add short-name and/or description of the authorised client and basically that is it. The Home Assistant instance is now in the ZeroTier Network.
Adding my phone to ZeroTier network
I am going to add my phone in the ZeroTier network. Of course, I can also add any other device that I wish, but I think one more device just for the demo will be enough.
If you wish to do the same, perform the following steps:
- Download and install ZeroTier App from your mobile store.
- Open the App and enter your ZeroTier Network ID.
- Tap on the Enable Default Route switch and save the changes.
- In the main ZeroTier Mobile App screen, tap on the switch next to your Network ID to connect to the ZeroTier network.
- Authorize the new client from the ZeroTier Web Interface, exactly the same way as we did with Home Assistant instance.
Access Home Assistant using phone mobile data and ZeroTier
Time for a demo, where I will access my Home Assistant dashboard from my phone with Wi-Fi disabled. For that, I will just have to type my ZeroTier Home Assistant Instance IP and the default Home Assistant Port in my phone browser. I will do that while I’m using only mobile data to simulate the case when I’m outside of my local network.
Home Assistant login page is now accessible from my phone mobile data. Thanks to ZeroTier.
I want to ask you something! Are you using any kind of VPN and which one exactly? Let me know in the comments section bellow. I promise to ask you more questions… Just kidding I promise to respond you back, as I read all of the comments and actually reply to them.
And now, do not wonder what to read next and just click on my Home Assistant Categories section here on my website, where I’m having various of articles that you can have fun with.
Don’t forget to subscribe for my Newsletter, if you haven’t done that already.
I’m Kiril and I’m done writing. Bye!