Installation · Home Assistant

Installing Ubuntu Server.

Reading time
~16 min · 3,345 words
FAQ
0 questions
Status
Draft 1 · under review
Section
All Home Assistant pages

Ubuntu Server is the operating system the collective recommends for hosting Home Assistant on a repurposed desktop, repurposed laptop, or mini PC. It is free, open-source, widely supported, and well-documented. This page walks through the installation step by step — downloading the installer, creating a bootable USB stick, running the installer, partitioning the drive, configuring the network, creating the initial user, and preparing the system for the Home Assistant install that follows. The installation takes 30 to 60 minutes the first time and less after the grower has done it once. The result is a clean Ubuntu Server installation ready for Docker and Home Assistant.

Why Ubuntu Server specifically.

Several Linux distributions work for hosting Home Assistant. The collective recommends Ubuntu Server for specific reasons.

Long-term support (LTS) releases. Ubuntu Server publishes an LTS release every two years (22.04, 24.04, 26.04, and so on). Each LTS release receives five years of standard support and up to ten years of extended support. This is exactly the cadence a grower wants for a production system — stable, long-maintained, without frequent major version upgrades.

Broad hardware support. Ubuntu works on essentially all modern x86 hardware and on ARM platforms including the Raspberry Pi. The installer detects hardware correctly in nearly all cases. Rarely does a Home Assistant host need special driver work beyond what Ubuntu provides out of the box.

Familiar to the broader ecosystem. Docker, Home Assistant Supervised, ESPHome, Frigate, Ollama, and most other relevant software is tested and documented on Ubuntu. Tutorials, Stack Overflow answers, and community guides usually address Ubuntu specifically. A grower running into a problem has a better chance of finding a direct answer when running Ubuntu than when running a less-common distribution.

Debian-derived package management. Ubuntu uses `apt` for package installation, inherited from Debian. The command pattern is simple (`sudo apt install docker.io`) and well-understood. Package repositories are extensive and current.

Home Assistant Supervised support. Home Assistant Supervised officially supports only Debian (currently Debian 12). Ubuntu Server is a Debian derivative and works in practice, but it is not an officially supported Supervised platform — the Supervisor will mark it as unsupported. For a fully supported Supervised install, use Debian; Ubuntu remains an excellent choice for the Docker Compose path. The Supervised installation is tested against specific Ubuntu LTS versions and generally works reliably on them.

Other good choices exist — Debian directly is excellent, Proxmox is appropriate for grower who want virtual machine hosting, Fedora works for readers who prefer it — but Ubuntu Server is the collective's default recommendation because it hits all of the above cleanly.

Ubuntu Desktop is not recommended for a Home Assistant host. Ubuntu Desktop includes a graphical environment that consumes resources the Home Assistant workload does not need and adds software that is irrelevant to server duty. The Server variant is smaller, more efficient, and more appropriate.

Which Ubuntu version.

The current LTS version is Ubuntu 24.04 LTS (Noble Numbat), released in April 2024.

For a new installation, use the current LTS. Non-LTS interim releases receive only nine months of support and require frequent upgrades — unsuited for a production monitoring system.

Previous LTS releases (22.04 Jammy Jellyfish, 20.04 Focal Fossa) are still supported through their defined lifecycles and remain viable for installations that were created on those versions. For a new install, start with the current LTS.

Before starting.

Have the following ready before beginning.

The target hardware. A repurposed desktop, repurposed laptop, or mini PC as covered in the hardware sub-section. The hardware should have been evaluated (storage health, RAM test, thermal check) per the [Repurposing a Desktop Computer](/home-assistant/hardware/repurposed-desktop) or [Repurposing a Laptop](/home-assistant/hardware/repurposed-laptop) or [Using a Mini PC](/home-assistant/hardware/mini-pc) page.

A USB stick of 4 GB or larger. Used for the installer. Any existing data on the stick will be destroyed, so pick a stick the grower is willing to erase.

A computer other than the target. Used to download the Ubuntu installer and write it to the USB stick. Any reasonably recent computer running Linux, macOS, or Windows works.

A monitor, keyboard, and mouse. For the target machine during installation. After installation the target runs headless, but the install process requires local input.

An ethernet cable. Connecting the target to the local network. The Ubuntu Server installer can use WiFi, but a wired connection is faster and more reliable during install.

Time. Allow 60 to 90 minutes for a first-time install. Subsequent installs typically take 30 to 45 minutes.

Downloading and verifying the installer.

The Ubuntu Server ISO is available at [https://ubuntu.com/download/server](https://ubuntu.com/download/server). Download the current LTS version for the target hardware architecture (AMD64 for Intel and AMD x86 machines; ARM64 for Raspberry Pi 4/5 and similar).

The ISO is approximately 2 GB. Download time depends on the connection; on a typical broadband connection, a few minutes.

After the download completes, verify the checksum. This confirms the download is intact and has not been corrupted or tampered with. The Ubuntu download page lists the SHA256 checksum of each ISO. On Linux or macOS:

```bash sha256sum ubuntu-24.04-live-server-amd64.iso ```

On Windows (PowerShell):

```powershell Get-FileHash -Algorithm SHA256 ubuntu-24.04-live-server-amd64.iso ```

The output should match the checksum published on the Ubuntu download page. If the checksums differ, the download is corrupt or compromised — delete it and download again.

Creating the bootable USB stick.

Several tools write an ISO to a USB stick. Any of these works:

Balena Etcher (Linux, macOS, Windows). Simple graphical tool that handles the write reliably. Available at [etcher.balena.io](https://etcher.balena.io). The usual choice for first-time users.

Raspberry Pi Imager (Linux, macOS, Windows). Originally for writing Raspberry Pi OS images; also handles Ubuntu Server and most other Linux ISOs. Available at [raspberrypi.com/software](https://www.raspberrypi.com/software/).

Rufus (Windows). Windows-specific tool. Free and fast. Available at [rufus.ie](https://rufus.ie).

Command-line `dd` (Linux, macOS). For readers comfortable with the command line:

```bash sudo dd if=ubuntu-24.04-live-server-amd64.iso of=/dev/sdX bs=4M status=progress oflag=sync ```

Where `/dev/sdX` is the USB stick's device path. Be extremely careful with the device path — writing to the wrong device destroys the data on it. `lsblk` before and after inserting the USB stick identifies the correct path.

Whichever tool is used, the process is the same at a high level: select the Ubuntu Server ISO as the source, select the USB stick as the destination, confirm, wait. Writing a 2 GB ISO to a USB 3 stick takes about two minutes; to a USB 2 stick, five to ten minutes.

Once the write completes, the USB stick is ready to install from.

Preparing the target machine's BIOS/UEFI.

Before the target machine boots from the USB stick, its firmware settings need verification.

Enter the BIOS/UEFI setup. Power on the machine and press the key to enter setup — typically F1, F2, F10, F12, or Delete, depending on the manufacturer. The splash screen usually shows which key. If the machine boots past the splash screen before the key registers, hard-power-off and try again.

Boot mode: UEFI preferred. Modern systems should use UEFI (not legacy BIOS mode). The Ubuntu installer supports both, but UEFI is cleaner. Check the boot mode setting and confirm it is UEFI. For very old systems where only legacy BIOS is supported, that works too.

Secure Boot: either setting works. Ubuntu 24.04 supports Secure Boot. If the machine has Secure Boot enabled and the grower prefers to keep it enabled, leave it on. If troubleshooting install problems, temporarily disabling Secure Boot is a reasonable diagnostic step.

Boot order: USB first. Set the boot order so the USB stick boots before the internal hard drive for this first boot. Some machines have a one-time boot menu (often F12 at the splash screen) that lets the user choose the boot device for a single boot without changing the permanent boot order — often easier than reordering the persistent boot list.

Wake-on-LAN: enable if desired. For a headless Home Assistant host, Wake-on-LAN allows remote power-on over the network. Enable it in BIOS if planning to use it.

Power-on after power loss: enable. Configure the BIOS to boot automatically when AC power is restored after a power failure. This setting is often labeled "AC Power Recovery," "After Power Loss," "Restore on AC," or similar, and should be set to "On" or "Power On" or "Last State." Without this setting, a power failure leaves the machine off when power returns, and the Home Assistant host stays down until someone presses the power button manually.

Save the changes and exit. The machine should now boot from the USB stick.

Running the installer.

Insert the USB stick in the target machine and power it on. The Ubuntu installer's GRUB menu appears. Select "Try or Install Ubuntu Server" and wait for the installer to load. The installer is text-based and navigated with arrow keys, Tab, and Enter.

The installer walks through several screens.

Language selection. Choose the installation language. English is the default.

Keyboard configuration. Select the keyboard layout matching the physical keyboard. The installer can detect the layout automatically or the grower can choose from a list.

Installation type. Choose "Ubuntu Server" (not the minimized version, unless there is a specific reason to prefer it).

Network configuration. The installer detects available network interfaces and prompts for IP configuration.

For a wired ethernet connection (recommended), the interface typically gets an IP from DHCP automatically. Accept the DHCP-assigned address for now; a static IP or DHCP reservation is easier to configure after the install is complete.

If using WiFi (not recommended for a Home Assistant host), select the WiFi interface, choose the network, and enter the password.

Proxy configuration. Unless the network requires an HTTP proxy, leave this blank.

Mirror. Accept the default or the one suggested by the installer, which is usually a geographically close Ubuntu mirror.

Storage configuration. The most important screen. The installer offers several options:

"Use an entire disk" — Erases the entire drive and installs Ubuntu with a standard partition layout. The right choice for a fresh install on a machine that will only run Ubuntu. Select this option and the installer handles partitioning automatically.

"Custom storage layout" — For readers who want specific partition schemes. The default layout is fine for most Home Assistant deployments; custom layouts are appropriate for readers with specific experience and reasons.

The installer then shows the proposed partition layout and asks for confirmation. For a standard graybox deployment on a 256 GB or larger SSD, the default layout works well.

Specific partition notes:

"Set up this disk as an LVM group" — the installer offers LVM (Logical Volume Manager) by default. LVM adds flexibility for later storage changes (resizing partitions, adding storage, taking snapshots) at minimal cost. Leave it enabled unless there is a reason not to.

Encrypt the LVM group — offered in some installer versions. Full-disk encryption adds a boot-time passphrase requirement, which is problematic for a headless server. Leave this off for a Home Assistant host unless the threat model specifically calls for it.

Profile setup. Create the initial user account.

Your name — the grower's full name or similar. Used for display purposes only.

Server name — the hostname. Choose something memorable and descriptive: `homeassistant`, `graybox`, `farm-controller`, or similar. Lowercase, no spaces, no special characters except hyphens.

Pick a username — the login name. Lowercase, short. `admin`, `pi`, the grower's first name, or similar.

Pick a password — a strong password that the grower will remember. The collective recommends a password manager for generating and storing this.

SSH setup. The installer prompts whether to install the OpenSSH server. Select "Yes" — remote administration of the Home Assistant host will be through SSH from another computer. The installer also offers to import SSH keys from GitHub or Launchpad; readers with SSH keys on one of those services can add them here for key-based login.

Featured server snaps. The installer offers optional "snap" package installations. Decline all of them — for a Home Assistant host, none of the offered snaps are needed, and adding unused software only creates maintenance surface.

Installation. The installer now writes Ubuntu to the drive. This takes 10 to 30 minutes depending on hardware speed. Progress appears on screen.

Reboot. When installation completes, remove the USB stick and reboot. The machine boots into the freshly installed Ubuntu Server.

First login and initial configuration.

The installed Ubuntu Server boots to a text-mode login prompt. Log in with the username and password created during installation.

Check that everything worked. A few quick commands confirm the install is healthy:

```bash

# Ubuntu version and system information lsb_release -a uname -a

# Hostname hostname

# IP address ip a

# Storage layout df -h ```

If the outputs look reasonable (Ubuntu 24.04 LTS or current LTS, the hostname chosen during install, an IP address on the expected network, disk usage that matches the drive capacity), the installation succeeded.

Update the system. Before doing anything else, update all installed packages to current versions:

```bash sudo apt update sudo apt upgrade -y sudo reboot ```

The first `apt update` refreshes the list of available packages. `apt upgrade` installs the updated versions. `sudo reboot` reboots the machine to apply any kernel updates. The update process takes 5 to 20 minutes depending on how many updates are available and network speed.

Log in again after reboot. The system is now fully updated and ready for further configuration.

Configuring a static IP or DHCP reservation.

The Home Assistant host needs a consistent IP address on the local network so that dashboards, integrations, and mobile apps can find it reliably.

The easier approach for most home and small farm networks is a DHCP reservation — the network router always assigns the same IP address to the Home Assistant host based on its MAC address. This is configured in the router's admin interface and requires no changes on the Ubuntu machine. The specifics vary by router; consult the router's documentation.

If a static IP is preferred (for a network without DHCP reservation support, or for a more fixed configuration), Ubuntu Server uses Netplan for network configuration. Edit `/etc/netplan/50-cloud-init.yaml` or the installer-created file. The specific file name varies; `ls /etc/netplan/` lists the files present.

A static IP configuration might look like:

After editing, apply the configuration:

```bash sudo netplan apply ```

Verify the new IP address:

```bash ip a ```

If the machine is now unreachable, the configuration is probably wrong. Either the installer-time IP still works through the previous configuration (try logging in at the old IP), or a local console login through the attached monitor and keyboard lets the grower edit the Netplan configuration back to working.

Securing SSH.

SSH (Secure Shell) is how the grower administers the Home Assistant host remotely. By default, Ubuntu's SSH server is reasonably secure, but a few additional steps improve it.

Use SSH key authentication. Password-based SSH login is permitted by default but less secure than key-based authentication. Generate an SSH key pair on the computer the grower uses for administration (Linux, macOS, or Windows PowerShell):

```bash ssh-keygen -t ed25519 -C "grower-admin" ```

Accept the default file location and set a passphrase (or not — passphrases on SSH keys are secure but add friction).

Copy the public key to the Home Assistant host:

```bash ssh-copy-id username@homeassistant-ip ```

Replace `username` with the username created during install and `homeassistant-ip` with the host's IP address. Enter the user's password when prompted.

After the key is copied, test key-based login:

```bash ssh username@homeassistant-ip ```

The login should succeed without a password prompt (or with just the SSH key's passphrase, if one was set). Key-based authentication is working.

Disable password-based SSH login. Once key-based login is confirmed working, edit the SSH server configuration:

```bash sudo nano /etc/ssh/sshd_config ```

Find the `PasswordAuthentication` line, change it to `PasswordAuthentication no`, and save the file. Find any `PermitRootLogin` line and confirm it is set to `prohibit-password` or `no` (never `yes`).

Restart the SSH service:

```bash sudo systemctl restart ssh ```

From now on, SSH login requires the key. This is a meaningful security improvement.

Configure a firewall. Ubuntu includes `ufw` (Uncomplicated Firewall). For a Home Assistant host on a trusted local network, basic firewall configuration allows SSH and Home Assistant traffic and denies everything else:

```bash sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow ssh sudo ufw allow 8123/tcp # Home Assistant sudo ufw enable ```

Additional ports are opened as services are added. Mosquitto (MQTT) needs 1883 and possibly 8883. Grafana needs 3000. The specific ports needed depend on what the grower runs on the graybox.

For networks where stricter firewall policy is needed (a VLAN-isolated Home Assistant network, for example), more restrictive rules are appropriate. For typical home or small farm networks, the basic configuration above is usually enough.

Setting the time zone.

Home Assistant automations that trigger on times of day or sun events need the correct time zone. Set it with:

```bash sudo timedatectl set-timezone America/Chicago ```

Replace `America/Chicago` with the appropriate time zone. `timedatectl list-timezones | grep -i CITY` helps find the right identifier for a given location.

Disabling suspend on lid close (laptops only).

If the target machine is a laptop that will run with the lid closed, the default behavior (suspending on lid close) is wrong. Edit `/etc/systemd/logind.conf`:

```bash sudo nano /etc/systemd/logind.conf ```

Set:

``` HandleLidSwitch=ignore HandleLidSwitchDocked=ignore HandleLidSwitchExternalPower=ignore ```

Restart the service:

```bash sudo systemctl restart systemd-logind ```

The laptop now runs normally with the lid closed. Covered in more detail on [Repurposing a Laptop](/home-assistant/hardware/repurposed-laptop#the-lid-close-problem-and-the-fix).

Preparing for the Home Assistant install.

Ubuntu Server is now installed, updated, and configured. The next step is installing Home Assistant.

Two main paths, each covered on a dedicated page:

[Installing Home Assistant on Ubuntu with Docker](/home-assistant/installation/ha-docker) — the graybox approach. Home Assistant plus Mosquitto plus a database plus ESPHome plus related services, all in Docker containers, managed through Docker Compose. The collective's recommended path for growers who want multipurpose hardware.

[Installing Home Assistant Supervised](/home-assistant/installation/supervised) — the Supervisor approach. Home Assistant with the full Supervisor running on Ubuntu, giving the grower the same experience as Home Assistant OS (add-on management through the Home Assistant interface, automatic updates, built-in backup) while keeping Ubuntu underneath for other services.

Either path continues from the point where Ubuntu Server is installed and reachable. The grower chooses based on preference and operational style.

Common issues.

A few things occasionally go wrong during install.

Boot from USB doesn't work. Check BIOS boot mode (UEFI vs. legacy), check boot order, check that Secure Boot settings allow the installer. Try a different USB port (some older systems won't boot from all ports). Try writing the ISO to a different USB stick in case the stick is bad.

Installer doesn't detect storage. Some older RAID controllers or unusual storage configurations need drivers not included in the installer. Check BIOS for storage mode (AHCI is typically what's wanted, not RAID). For machines that previously ran Windows with Intel Rapid Storage Technology, switching from RAID to AHCI mode usually resolves this.

No network during install. If DHCP doesn't work during install, configure a static IP manually in the network configuration screen. Verify the ethernet cable is connected and the network is live. WiFi installs sometimes have driver issues with specific wireless chipsets; wired ethernet avoids these.

Installer hangs. Rare but occurs. Usually indicates a specific hardware problem (failing RAM, disk issues, power instability). Run diagnostic tests on the hardware before retrying.

First boot fails with GRUB error. Usually indicates a boot configuration problem, often from a mismatch between UEFI and legacy boot modes. Boot from the install USB in rescue mode, mount the installed system, and reinstall GRUB. Ubuntu community documentation covers this scenario in detail.

SSH login fails. Confirm the SSH service is running (`sudo systemctl status ssh` shows "active (running)"), confirm the username and password are correct, confirm the target IP is correct, confirm the firewall allows SSH (`sudo ufw status`).

For most install problems, searching the specific error message in the Ubuntu community forum (askubuntu.com or ubuntuforums.org) finds helpful threads. Ubuntu's deployment is wide enough that almost any specific problem has been encountered and discussed.