$linuxjunkies
>

How to Install Ubuntu Server

Install Ubuntu Server 24.04 with Subiquity, configure LVM and OpenSSH during setup, understand cloud-init, and harden the system before your first workload.

BeginnerUbuntuDebianFedoraArch9 min readUpdated June 7, 2026

Before you start

  • Ubuntu Server 24.04 LTS ISO downloaded from ubuntu.com
  • USB drive of 4 GB or larger to write the installer
  • Target machine with at least 2 GB RAM and 20 GB disk
  • SSH public key available if you want passwordless remote access from day one

Ubuntu Server uses the Subiquity installer, a fast, opinionated text-UI tool that replaced the old Debian-style installer starting with Ubuntu 20.04. A fresh install takes under 15 minutes on modern hardware. This guide walks through every screen, sets up LVM so you can resize volumes later, installs OpenSSH during setup, explains what cloud-init does on first boot, and locks down the basics before you put the machine on a network.

What You Need Before Starting

Download the latest LTS ISO from ubuntu.com/download/server. At the time of writing that is Ubuntu 24.04 LTS (Noble Numbat). Write it to a USB drive with dd or Balena Etcher. You need at least 2 GB RAM and 20 GB disk; 4 GB RAM and 40 GB disk is a comfortable minimum for a general-purpose server.

# Write the ISO to a USB drive (replace sdX with your device)
sudo dd if=ubuntu-24.04-live-server-amd64.iso of=/dev/sdX bs=4M status=progress oflag=sync

Boot the target machine from the USB. On most systems that means pressing F12, F2, or Del at POST to reach the boot menu.

Step 1 — Language and Keyboard

Subiquity opens in a terminal UI. Select your language (English is fine even for non-English systems — server locale rarely matters) and keyboard layout. Use arrow keys and Enter; Tab moves between controls.

Step 2 — Choose the Install Type

You will be offered Ubuntu Server or Ubuntu Server (minimized). Choose the standard option unless you are building a container base image. Minimized strips man pages, locales, and several utilities you will want for day-to-day administration.

Skip the "Search for third-party drivers" screen unless you have hardware (NVIDIA GPUs, certain RAID cards) that needs it. On a VM, skip it.

Step 3 — Network Configuration

Subiquity detects NICs automatically. If DHCP is available it configures the interface immediately — you will see an IP address appear under the interface name. For a server you probably want a static address. Select the interface, choose Edit IPv4, switch from Automatic (DHCP) to Manual, and fill in the address, gateway, and DNS fields. Example values:

  • Subnet: 192.168.1.0/24
  • Address: 192.168.1.50
  • Gateway: 192.168.1.1
  • Name servers: 1.1.1.1,8.8.8.8

Leave the proxy field blank unless your environment requires one.

Step 4 — Disk Layout with LVM

This is the most consequential screen. Select Use an entire disk and, critically, tick Set up this disk as an LVM group. LVM lets you extend logical volumes online later without repartitioning.

If you have sensitive data, also enable full-disk encryption (LUKS). You will enter a passphrase that must be typed at every boot — acceptable for a physical server, inconvenient for a headless remote machine unless you set up remote unlock via Dropbear or Tang/Clevis.

After confirming, Subiquity shows the storage summary. By default it creates:

  • A 1 GB /boot partition (plain ext4, outside LVM)
  • A small EFI system partition (if the machine uses UEFI)
  • A volume group (e.g., ubuntu-vg) consuming the rest of the disk
  • A logical volume ubuntu-lv mounted at /sized at roughly half the VG by default

That last point catches many people. Subiquity intentionally leaves free space in the VG. Either resize the LV now by selecting it and entering the maximum size, or do it post-install:

# After first login — extend the LV to use all free VG space
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

Confirm the storage layout and accept the destructive-write warning.

Step 5 — Profile and SSH Setup

Set your server's hostname, your full name, a username, and a strong password. Avoid using admin or ubuntu as the username — both are common brute-force targets.

On the next screen you are offered Install OpenSSH server. Check it. You can optionally import your SSH public key from GitHub or Launchpad by entering your username — Subiquity will fetch the key over the network and drop it into ~/.ssh/authorized_keys automatically. This is the safest way to enable key-based auth from day one.

Subiquity offers a list of popular snaps: Docker, Nextcloud, Microk8s, etc. You can install them later with snap install. Skip this screen unless you specifically want one of them. Selecting extras here does not save time and slightly complicates a minimal first install.

Step 7 — Installation and Reboot

The installer copies files, runs curtin (the backend write tool), and configures the bootloader. On an SSD this takes 3–6 minutes. When it finishes, select Reboot Now and remove the USB drive when prompted.

First Login and cloud-init

Ubuntu Server runs cloud-init on every first boot, even on bare metal. cloud-init handles tasks like applying SSH keys, setting the hostname, and running any user-data scripts. You may see a brief delay at the login prompt while it finishes. Check its status with:

cloud-init status --wait

Output will be status: done when it completes. Logs are in /var/log/cloud-init.log and /var/log/cloud-init-output.log if you need to debug.

On a VM or cloud instance you can provide a user-data file to automate the entire post-install configuration — package installs, user creation, file writes — before the first interactive login. On bare metal, cloud-init simply finishes quickly and stays out of the way.

First-Login Hardening

Update everything immediately

sudo apt update && sudo apt full-upgrade -y

Enable automatic security updates

sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

Disable password-based SSH logins

Only do this after you have confirmed key-based login works in a separate terminal session.

sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
sudo systemctl restart ssh

Configure the firewall with ufw

sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status verbose

Set the timezone

sudo timedatectl set-timezone America/New_York
timedatectl status

Verification

Run these checks to confirm everything is healthy before you proceed with workload setup:

# System is fully updated
apt list --upgradable 2>/dev/null | grep -c upgradable

# LVM layout
sudo vgs && sudo lvs

# SSH service is active
systemctl is-active ssh

# Firewall status
sudo ufw status

# cloud-init finished cleanly
cloud-init status

Troubleshooting

"No boot device found" after reboot

The installer wrote a UEFI boot entry that your firmware ignores. Boot into your BIOS/UEFI setup, navigate to the boot order or UEFI boot manager, and add EFI/ubuntu/grubx64.efi from the system disk as the first entry. On some SuperMicro and HP servers this entry is simply missing from the list and must be added manually.

Subiquity hangs on "Updating package list"

The installer tries to reach the Ubuntu archive. If your network is not ready, it will stall. Go back to the network screen, verify the IP and gateway, then return. On an air-gapped machine, choose the option to skip network configuration — you can run apt update after configuring the network post-install.

SSH refuses password logins from day one

Ubuntu 22.04 and later ships with PasswordAuthentication no in a drop-in file at /etc/ssh/sshd_config.d/50-cloud-init.conf. If you have not imported an SSH key and you are locked out, you can boot to recovery, mount the filesystem, and edit or delete that file. Alternatively, attach a console (physical or virtual) and log in directly to add your key.

tested on:Ubuntu 24.04Ubuntu 22.04

Frequently asked questions

Why does the root logical volume only use half my disk after install?
Subiquity deliberately leaves free space in the LVM volume group so you can create additional logical volumes later. Run lvextend -l +100%FREE followed by resize2fs to expand the root LV to the full available space.
Can I automate the entire install without clicking through Subiquity?
Yes. Subiquity supports autoinstall, a YAML-based format you supply via a cloud-init user-data file or a kernel command-line parameter. It covers everything from disk layout to user creation and post-install scripts.
What is cloud-init doing on a bare-metal server where I have no cloud?
On bare metal cloud-init reads a local datasource, applies any SSH keys you imported during install, sets the hostname, and exits. The process takes only a few seconds and does not require any cloud infrastructure.
Should I use LVM encryption (LUKS) on a headless server?
Only if you have a way to enter the passphrase remotely at boot, such as Dropbear SSH in the initramfs or a Tang/Clevis network-bound disk encryption setup. Without that, an encrypted headless server will hang at every reboot waiting for a passphrase.
How do I switch from the installed snap version of a package to the apt version?
Remove the snap with snap remove <package> and then install the apt equivalent with apt install <package>. The snap and deb versions are independent; removing the snap does not automatically install the deb.

Related guides