Home Assistant is an open-source project that is single-handedly taking home automation to the next level. It’s not just a platform to manage your home appliances locally but is also taking over voice assistant systems such as Google Home and Amazon Alexa.

Home Assistant can be installed on devices like Raspberry Pi or small PCs such as the Intel NUC. While the installation itself is straightforward, the official documentation and most tutorials prefer installing Home Assistant OS, which can be flashed like any other operating system. However, there are many cases where users prefer to install it as a standalone service or run multiple software applications on a single device.
This tutorial will guide you through installing Home Assistant Core on a Raspberry Pi 5.
Prerequisites:
We assume that you have already flashed Raspberry Pi OS. If not, please flash the OS; we recommend the Lite version.
Steps:
Install the Latest Version of Python in Raspberry Pi 5
Although Raspberry Pi OS comes with Python pre-installed, Home Assistant requires the latest version, and your installed version might be outdated.
Update System:
sudo apt update -y
sudo apt upgrade -y
Install Dependencies:
sudo apt install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git
Download Latest Python from the Website:
Visit the Python Download page to get the link for the latest source. As of this writing, the latest stable version is 3.13.3. Replace the link below if a newer version is available.
wget https://www.python.org/ftp/python/3.13.3/Python-3.13.3.tgz
Extract the Archive:
tar -xf Python-3.13.3.tgz
Prepare for Build: This will take some time, so please be patient.
cd Python-3.13.3
./configure --enable-optimizations
Build Python:
make -j 4
Install Python: We will use altinstall instead of install to prevent it from replacing the system’s default Python.
make altinstall
Verify Python: Check if the installation was successful.
python3.13 --version
This should output the Python version you just installed (e.g., Python 3.13.3).
Install Home Assistant Core on Raspberry Pi 5
Install Dependencies:
sudo apt install -y bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff6 libturbojpeg0-dev tzdata ffmpeg liblapack3 liblapack-dev libatlas-base-dev
Create a Local User Account:
sudo useradd -rm homeassistant -G dialout,gpio,i2c
Add the Home Assistant User to Sudo (for easier management later):
sudo usermod -aG sudo homeassistant
Create the Python Virtual Environment: Create the directory and change the ownership to the newly created homeassistant user.
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
Next, create and switch to a virtual environment for Home Assistant Core. This will be done as the homeassistant account.
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3.13 -m venv .
source bin/activate
Install wheel: Once the virtual environment is activated, install the wheel package.
python3.13 -m pip install wheel
Install Home Assistant Core: Wait patiently, as this will take some time.
pip3.13 install homeassistant==2025.4.2
Start Home Assistant Core for the First Time: This will complete the installation, automatically creating the .homeassistant configuration directory in the /home/homeassistant directory and installing any basic dependencies. Again, be patient.
hass
Once the instance is running, you can access Home Assistant by navigating to http://<Your_Raspberry_Pi_IP_Address>:8123 in your web browser.
Start Home Assistant Core Automatically After Boot
Perform these steps as your main user. If you are still logged in as the homeassistant user, exit by typing exit.
Create a New homeassistant Service:
sudo nano /etc/systemd/system/homeassistant.service
Add the Following Configuration:
[Unit]
Description=Home Assistant
After=network-online.target
[Service]
Type=simple
User=homeassistant
WorkingDirectory=/home/homeassistant/.homeassistant
ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant"
RestartForceExitStatus=100
Restart=on-failure
[Install]
WantedBy=multi-user.target
CTRL + S, CTRL + X to Save the file and exit the editor.
Enable and Start the Home Assistant Service:
sudo systemctl daemon-reload
sudo systemctl enable homeassistant
sudo systemctl start homeassistant
How to Update Home Assistant Core
From time to time, you’ll want to upgrade Home Assistant to the latest version for new features and bug fixes. Unfortunately, there is no way to upgrade Home Assistant from the dashboard when using the Core installation, so you’ll need to do it manually.
sudo systemctl stop homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
source bin/activate
pip3.13 install --upgrade homeassistant
Exit from home assistant user to back to your main user.
exit
sudo systemctl start homeassistant
Before upgrading, it’s a good practice to check the Home Assistant release notes for any new Python version requirements. You might need to install a newer version of Python before upgrading Home Assistant Core.