Automation

Home Assistant on Linux: Set Up Your Local Server

Find out how to install Home Assistant on Linux, step by step. Set up your local server, free your smart home from the cloud, and enjoy complete privacy!

Published: 06/21/2026
7 views
Share:
Home Assistant on Linux: Set Up Your Local Server

Have you ever gotten frustrated trying to turn off the living room light with your phone, only to have the app freeze because the internet went down? Or woken up in the middle of the night to find all the lights in the house on because the manufacturer’s servers in China rebooted?

That’s the harsh and frustrating reality for anyone who relies exclusively on the cloud for a smart home. But what if I told you there’s a permanent solution to this?

Home Assistant is the perfect solution for anyone who wants total control over their own home, without relying on servers on the other side of the world or unstable internet plans. And the best way to run this technological marvel is by setting up your own local server using Linux.

In this article, I’ll show you exactly how to install Home Assistant on Linux in a straightforward, no-nonsense way. You’ll learn how to set up an incredibly fast, secure, and fully customized automation hub.

Whether you have an old computer gathering dust in a drawer or want to invest in a dedicated setup for your smart home, this definitive guide is for you. Pour yourself a cup of coffee, get comfortable, and let’s transform your relationship with home automation today!

What Is Home Assistant, Really?

If you’re just entering the wonderful world of smart homes, you may have already heard of names like Alexa, Google Home, or Tuya. They’re all very well-known ecosystems packed with features.

However, they have a major flaw: most of the time, they need to send your command to a server on the internet before sending the signal back to your light bulb. This causes delays and creates extreme dependency.

Home Assistant is an open-source system created specifically to eliminate this problem. It acts as the central brain of your home, connecting devices from completely different brands on a single control panel.

No More Dependence on the Internet

Imagine that your internet service provider is undergoing maintenance and has left your entire neighborhood offline overnight. With traditional systems, your lights, outlets, switches, and cameras become very expensive and useless decorations.

With Home Assistant running locally in your home, everything continues to work perfectly. Your phone sends the command to the router, which communicates directly with the local server. The magic happens in milliseconds.

Taking Your Data Privacy Seriously

Do you like knowing that giant tech companies are actively monitoring what time you turn on the TV, when you turn off the bedroom light, or when you leave for work? Probably not, right?

Since your new server will run on your own network, your data and daily routines never leave your home. It’s the perfect blend of the convenience of automation and the security of total privacy.

Why choose Linux for your server?

Could you install this system on a Windows machine or even an older macOS system? You could, but it’s definitely not ideal for this scenario.

Linux is the undisputed king when it comes to home or business servers. The world’s largest companies use Linux to keep their systems up and running, and the reasons for this are very simple to understand.

Stability That Gives You Peace of Mind

A home automation server needs to stay on 24 hours a day, 7 days a week, without interruption. It doesn’t take vacations and can’t fall asleep on the job.

Windows, for example, has the annoying habit of rebooting on its own in the middle of the night to install updates, which can disrupt your morning automation routines. Linux is incredibly stable and only reboots when you tell it to.

Minimal use of system resources

You know that old laptop or desktop PC gathering dust in the back of the closet because it got too slow? It could be the perfect, speedy machine for your new project.

Linux systems, especially the server-focused versions (the ones without that heavy graphical window interface), run incredibly smoothly on very old computers. You save money and recycle technology at the same time.

Basic Requirements: What Do You Need?

Before we really get down to business, let’s gather the ingredients for our tech recipe. Don’t worry—you don’t need a state-of-the-art supercomputer for this.

The ideal hardware for your project

You can use a Raspberry Pi (a credit-card-sized minicomputer), a mini PC (those small boxes from brands like Beelink or Dell), or any old laptop.

The important thing is that the machine has at least 2GB of RAM and about 32GB of free storage space. A golden tip: always opt for an SSD instead of an old hard drive. An SSD ensures the system runs like a charm.

The software needed to make it work

In this guide, we’ll focus on the cleanest, most modern, and recommended installation method for Linux systems: using the famous Docker. If you don’t know what it is, don’t worry.

Docker creates virtual, isolated “boxes” (containers) within the system. This means that Home Assistant will run inside them without messing with the other files on your computer. We’ll use Ubuntu Server or Debian as our base operating system.

Step-by-Step: Installing Home Assistant on Linux

It’s the moment of truth! If you’ve never used Linux commands in your life, just take a deep breath and trust the process. I’ll walk you through the most basic commands step by step.

The sense of accomplishment you’ll feel when you see your control panel working beautifully in the end will be worth every second you invest. Ready to get started?

Step 1: Set Up Your Operating System

First, you need to install Ubuntu Server on your chosen computer or mini PC. Just download the free installation image from the official Ubuntu website, burn it to a USB drive using a program like Rufus (on Windows), and follow the easy on-screen steps.

After installing the system and connecting the machine to the internet via an Ethernet cable (avoid Wi-Fi for servers!), open the command terminal.

Before installing anything new, the golden rule of Linux is to update the system. Type the following command and press Enter: sudo apt update && sudo apt upgrade -y. This ensures that everything has the latest security patches.

Step 2: Install the powerful Docker

As we just discussed, Docker will be the official home for our Home Assistant. Installing it on Ubuntu is very simple thanks to an official script from the developers that does all the hard work for you.

In your black Linux terminal, type this command exactly as shown: curl -fsSL https://get.docker.com -o get-docker.sh and press Enter. This downloads the installation file.

Next, run this command to start the installation: sudo sh get-docker.sh. That’s it! Your Docker will be downloaded and installed on your local server in just a few minutes.

Step 3: Running the Home Assistant Container

Now the real magic happens right before your eyes. With Docker ready to go, let’s have it fetch the latest stable version of Home Assistant from the internet and run it on your computer.

It’s just a single command, but it’s a bit long. You’ll need to pay close attention to type or paste everything exactly right.

In the terminal, paste the following text: docker run -d --name homeassistant --privileged --restart=unless-stopped -e TZ=America/Sao_Paulo -v /home/your_username/homeassistant:/config --network=host ghcr.io/home-assistant/home-assistant:stable

Important detail: replace “your_username” with the username you created on your Linux system. This command creates the configuration folder, sets the time zone to Brazil, and instructs the system to always restart the program automatically in case of a power outage.

Your first steps on the new local server

Phew! You can celebrate—the scariest part is over. Linux did all the heavy lifting behind the scenes, and now you’re the proud owner of a brand-new automation server.

But what now? How do we log into the system to start having fun automating the lights and creating fun buttons?

Accessing the Control Panel for the First Time

Go to any other computer, tablet, or phone connected to the same Wi-Fi network as your home. Open your favorite web browser (such as Google Chrome, Safari, or Edge).

In the address bar, type the IP address of your Linux server, followed by port 8123. It will look something like this: http://192.168.0.15:8123. Press Enter and wait for the page to load.

Setting Up Your Master Administrator Account

Once you’ve successfully accessed the page, you’ll be greeted by Home Assistant’s friendly blue welcome screen. It will politely ask you to create a username and a very strong password for your main account.

Next, it will ask you to set your exact location on the map. Don’t skip this step! This location is vital for the system to calculate, with mathematical precision, the sunrise and sunset times on your street—which is great for setting up lighting automations.

The Magic of Device Auto-Discovery

You know what’s really cool and surprising about this first login? As soon as you finish this quick initial setup, the system will immediately start aggressively scanning your Wi-Fi network for smart devices.

If you have LG or Samsung smart TVs, Philips Hue lights, Roku devices, modern printers, or connected speakers, it will find the vast majority of them 100% automatically. All you have to do is click “Set Up” in the boxes that appear and add everything to your new central dashboard.

Examples of automations that will change your routine

Having buttons on your phone is cool, but the real beauty of Home Assistant on Linux lies in its ability to create complex routines (automations) that work on their own for you.

Your imagination is the only limit here. I’ll give you two simple examples of automations you can create in just a few clicks on your new system to impress family and friends.

The Wonderful Automatic Movie Mode

You can create a rule where, whenever you press “Play” on Netflix on your living room Smart TV after 7 p.m., Home Assistant will automatically turn off the main ceiling light and turn on a LED strip behind the TV with a very dim blue light.

What if you pause the movie to grab some popcorn in the kitchen? The system detects the “Pause” and turns the lights back on at 30% brightness so you don’t trip over the furniture in the dark.

Presence Simulation for Safe Travel

Going on a long weekend trip and don’t want your house to look empty to anyone looking in from the street? The local server handles this with ease.

You can set up an automation that turns on the porch light when the sun sets, turns on the TV in the living room for two hours, and turns off the bedroom lights at random. To anyone looking from the outside, it always looks like someone is home, going about their business.

Golden Tips for Keeping Your Server Safe and Healthy

Having your own server at home gives you an incredible sense of technological power. But, as superhero movies say, with great power comes great responsibility.

To avoid headaches in the future and not waste hours on configuration, please take note of and follow these valuable tips very carefully.

Back up your system very frequently

Home Assistant lets you download a super-lightweight compressed file containing all your automations, passwords, and dashboard settings. It’s a lifesaver in case of problems.

Go to the Settings menu, then System, and find the Backups option. Make it a sacred habit to create a backup and save it to your personal laptop or Google Drive every single week. If the server’s SSD crashes, you can restore your entire smart home in five minutes on a new machine.

External Access with Maximum Security

Since our server runs strictly locally, by default, you can only access the dashboard and controls when you’re inside your home, connected to your Wi-Fi.

If you want to turn off a light you left on while you’re at work, please never open your router’s ports directly to the internet (that’s an open invitation to hackers).

Use modern, secure, and free solutions like Tailscale or Cloudflare Tunnels. They create a super-secure, encrypted tunnel between your phone on the go and your Linux system at home, without exposing your network to external threats.

Conclusion: Welcome to the Future of Home Automation

Building your own home automation server from scratch might seem like a daunting task at first. There are black screens, terminal commands, and new terminology.

But, as we’ve seen throughout this definitive guide, by using an older computer, leveraging the immense stability that Linux offers, and taking advantage of the unmatched convenience of Docker containers, the entire process becomes very logical and user-friendly—even for beginners.

From now on, you’ll never again be at the mercy of massive internet outages, chewed-through cables on the street, or providers with unstable signals. Your valuable data is safely stored within the security of your home, and your lights will turn on at the speed of light with no delay.

That, my friends, is the true and purest meaning of having a smart home worth its salt!

I sincerely hope this guide has given you the courage and the little nudge you needed to start your home automation project. Do you still have any questions about the Linux installation commands, or would you like some honest advice on which smart devices to buy first to get your project started?

Tell us in the comments below about your experience or what questions you have! I’d love to read your story and help you take the next steps on this fantastic technological journey.

Tags:
#Assistant #local server #smart home #home automation #Linux #Docker #Raspberry Pi #home automation

Comments

Comments temporarily disabled.