×

Remote Access to Home Assistant Cheap, Simple, Secure Cloudflare #FromZeroToHomeAutomation #7

Welcome to the From Zero to Automatic Home series. I will take you with me on the adventure of creating an automatic home from scratch based on Home Assistant. I will try to include in this series all the things I do with my new equipment. I’m doing everything again! There will be a lot of it…


In this episode, we’ll walk through adding remote access to Home Assistant using the Cloudflared add-on and a purchased domain. Between the lines there are a lot of my comments and practical advice. The thumbnail for the material was created by Dall-E.

Purchasing a domain at home.pl – affiliate link:
https://marketing.tr.netsalesmedia.pl/ts/i5034390/tsc?amc=con.cubegroup.522467.531840.133430&rmd=3&trg=http%3A%2F%2Fhome.pl

Cloudflare account needed:
https://dash.cloudflare.com/

Link to paste into add-ons to add Cloudflared:
https://github.com/brenner-tobias/ha-addons

Code needed for configuration.yaml:
http:
ip_ban_enabled: true
login_attempts_threshold: 10
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24

Video in text form:
Welcome to SmarTube! In today’s short introduction, we’ll explore an easy, affordable, and secure method to enable remote access to your Home Assistant using Cloudflare. A simple but very useful setup to ensure you can access your Home Assistant from anywhere with an internet connection.


🔹 Why Remote Access?

Many people set up remote access to Home Assistant, but I’ve learned from experience. On my previous server, I lost access due to misconfigurations. Today, I’ll walk you through setting everything up step-by-step on my old system to ensure it works reliably.


🔹 Step 1: Purchasing a Domain

  1. Go to home.pl (link in the video description).
  2. Create your account or log in.
  3. Search for your desired domain. For example, I’ll use smarttube.pl.
  4. Check available domains and prices:
    • Most domains have a cost for the first year, but renewal prices may be higher.
  5. Add your domain to your cart and proceed to checkout.
  6. Use the payment method of your choice (e.g., Blik, credit card).

🔹 Step 2: Configuring Cloudflare

  1. Go to Cloudflare’s Website (cloudflare.com).
    • Log in to your account or create a new one if needed.
  2. In Cloudflare Dashboard:
    • Click on “Add Site.”
    • Enter your domain name (e.g., smarttube.pl) and continue.
    • Choose the Free Plan.
  3. Wait for Cloudflare to detect your domain’s DNS records.

🔹 Step 3: Updating DNS Servers

  1. In home.pl (your domain panel):
    • Find DNS Servers.
    • Change DNS servers to Cloudflare’s:
      • Copy the provided Cloudflare servers.
      • Set them in your domain panel under External DNS Servers.
  2. It may take some time (up to 24 hours) before changes propagate fully.

🔹 Step 4: Installing the Cloudflare Add-On in Home Assistant

  1. In Home Assistant:
    • Go to Settings > Add-ons.
    • In the Repositories tab, click three dots and add this repository:
      • [Repository link in the video description]
  2. Install the Cloudflare add-on.
  3. In Configuration, enter your domain name without the HTTP prefix (e.g., smarttube.pl).
  4. Save the configuration.

🔹 Step 5: Setting Up the File Editor Configuration

  1. Open File Editor in Home Assistant.
  2. Add the following lines to the configuration file (provided in the video description).
    • This code includes security features like banning IPs after multiple login attempts.

🔹 Step 6: Restart Home Assistant and Activate Cloudflare

  1. Restart Home Assistant.
  2. Go back to Add-ons > Cloudflare and click Start.
  3. A new window should prompt you to connect your Home Assistant instance to Cloudflare.
  4. Authenticate your connection and select your domain.

🔹 Step 7: Testing Remote Access

  1. Go to a new tab in your browser and enter https://your-domain.com (e.g., smarttube.pl).
  2. Log in to your Home Assistant instance.
  3. Use your mobile app to add this URL in the Home Assistant Companion App.
  4. With everything set up, you now have remote access to your Home Assistant from anywhere.

🚀 Why Use This Setup?

  • 🔐 Security: Cloudflare provides SSL certificates, ensuring HTTPS connections.
  • 🌍 Accessibility: Control your home from anywhere globally.
  • 💰 Cost-effective: Using Cloudflare and home.pl offers a reliable, cheap solution.

📌 Conclusion

With just a few steps, you’ve set up an affordable, fast, and secure remote connection to your Home Assistant. Now, whether you’re home or away, you can easily control and monitor your smart devices remotely.

If you have questions or run into issues, leave a comment below!
Don’t forget to subscribe and support the channel by using my affiliate link to home.pl. Your support helps me continue creating great content for SmarTube.


🎵 [Outro Music]
See you in the next video — take care and enjoy your automated home setup!

Post Comment