Installing Home Assistant Core on Ubuntu Server 22.04

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 :slight_smile:

hass
1 Like

Which guide would that be?

This guide assumes that you already have an operating system setup and have installed Python 3.11

The latest version is 3.12 and HA is giving a warning when using 3.11.

There are links at the bottom of the documentation page you linked to. Please use them to either update the document or suggest an update.

1 Like

Tried this and it worked fine.
Any way to get supervised instead of core using this method?

Thank you for the guide. When I reboot, and try to start hass, I get the prompt to provide a password for the user homeassistant. I then added a password.
Also, I had a few errors when I tried to start hass.

code:
homeassistant@selbynas:/home/papa$ hass
Command ā€˜hassā€™ not found, did you mean:
command ā€˜cassā€™ from snap cass (0.17.2)
command ā€˜assā€™ from deb irpas (0.10-9)
command ā€˜passā€™ from deb pass (1.7.4-6)
command ā€˜sassā€™ from deb ruby-sass (3.7.4-5)
See ā€˜snap info ā€™ for additional versions.
homeassistant@selbynas:/home/papa$

Thank you for any suggestions.

Welcome to the forum, @php4u :wave:t3:

Please note that the above ā€œguideā€ is more than 4 years old. You will find more actual guides on the net. Just use your favorite search engine.

Regarding CLI-commands for Home Assistant: There is no cli-command with "hass".

When using the SSH command line (CLI) use the "ha" command instead.

For more information about common cli-commands look here.

Do you really need Ubuntu? I run my Home Assistant server on an Intel NUC i3 with HAOS flashed to the boot device. Reboot and youā€™re done.

No virtuals or containers to further complicate the installation. Flash, reboot, done.

Stephen, great input. Iā€™m running the same hardware and tired of doing the Ubuntu update dance. Seems Iā€™m always fighting drivers in the Vbox. Can you dual boot? i.e. HA or Ubuntu
Using my i3 NUC may be overkill, but if it streamlines thingsā€¦ I like the idea! Thanks

Donā€™t know and donā€™t care to.
In other words- why?

My home would feel crippled if I shut down the Home Assistant server to run Ubuntu. Yes, some may say the i3 is overkill for Home Assistant, but I have 50 integrations, hundreds of entities and lots of other stuff connected to Home Assistant. My database (home-assistant_v2.db) is over 380Gb which alone would bring down a Raspberry Piā€¦ Restarts take ten to fifteen seconds vs a minute or two in the Raspberry. Overkill? I wonā€™t hit any hardware limitations for a long, long time.

For Ubuntu stuff I have another Intel NUC i5 that runs my NAS and I can SSH into it or use Teamviewer to see the UI. (All of my servers are in my basement). For some quick Linux stuff, there is always the Linux for Windows tool.

Run proxmox. You can HAOS in one VM and Ubuntu in another.

Thanks to all for the response. The reason I would dual boot (and I probably wonā€™t) is because my current ā€œbackbone automationā€ is running on an ISY994i talking to a PLM, with HA as a front-end. At some point I will probably roll all my automation, scenes and programs to HA, yet at this time itā€™s my ISY is so damn stable and works standalone even if the internet/network goes down. So if I needed to jump out of HA for a day, everything runs pretty well sans the detailed sensor info and stunning UI on tablets around the house. Migrating everything will take time, however Iā€™ll probably have my ISY sit in the background, offline, should I need it. Since I really have no real use for the NUC, Iā€™m leaning towards loading the HA OS directly on it and connecting it to my NAS for backups. Not sure how I missed the fact that I can do thisā€¦old age and old habits I guess. Again, thanks to all for the input!

I use the Samba Share add-on for this.

1 Like

No, itā€™s not the date is Mar 19 2024

Yes, there is, when you use a pure Core install as this topic is about.

That only applies when using Home Assistant OS