Hello, since the current guide to installing Home Assistant Core on Linux is outdated, I decided to write my own. This guide is using Home Assistant 2024.3.1 and Python 3.12.
Before you start, make sure your system packages are up to date
sudo apt update && sudo apt upgrade -y
Download the repository to install Python dependencies
sudo add-apt-repository ppa:deadsnakes/ppa
Then, you can install the basic Python 3.12 packages
sudo apt install python3.12 python3.12-dev python3.12-venv
Install required dependencies for Home Assistant Core
sudo apt install -y bluez libffi-dev libtiff5 \
libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \
libopenjp2-7 libturbojpeg0-dev tzdata ffmpeg liblapack3 \
liblapack-dev libatlas-base-dev
Not required, but itās a good practice to reboot after major changes
sudo reboot
With dependencies in place, create dedicated user account for Home Assistant
sudo useradd -rm homeassistant
sudo chsh -s /bin/bash homeassistant
Add the dialout group for the account youāve just created
sudo usermod -aG dialout homeassistant
Create a new directory for storing Home Assistant data
sudo mkdir /srv/homeassistant
Assign the ownership of this directory to Home Assistant account
sudo chown homeassistant:homeassistant /srv/homeassistant
Switch to your Home Assistant account
sudo -u homeassistant -H -s
Navigate to the main directory
cd /srv/homeassistant
Initialize your Python virtual environment
python3.12 -m venv .
Add source to your environment
source bin/activate
Install the wheel package
python3.12 -m pip install wheel
Install the Home Assistant
pip3.12 install homeassistant
Again, not required, but you can reboot
sudo reboot
Now start your Home Assistant instance
hass