Latest

Ubuntu Server 26.04 LTS for Docker: installation, static IP, SSH access and updates

First step of the Docker series: install Ubuntu Server 26.04 LTS on a mini PC or virtual machine, pick the right installer options, give the server a static IP with netplan, log in with SSH keys and keep the system updated before installing Docker.

By 7 min read
Ubuntu Server 26.04 LTS installed for Docker

Containers need a stable, up-to-date operating system that is always reachable at the same address. In this series we use Ubuntu Server 26.04 LTS, the long-term support release published in April 2026: it gets security updates for five years, until April 2031. It is the starting point of a seven-guide path that leads to Docker, the Portainer web interface and the first containerised services, such as AdGuard Home and Pi-hole.

What you get by the end of this guide: an Ubuntu server named docker, a static IP address on your home or office network, remote access with SSH and a key, and automatic security updates. The addresses in the examples (192.168.1.50 for the server, 192.168.1.1 for the router) are placeholders: replace them with your own.

Where to install it: mini PC, old PC or virtual machine

Docker does not need powerful hardware for light services such as a DNS filter. Ubuntu’s release notes give a minimum of 1.5 GB of RAM and 4 GB of storage for the Server edition; for a small lab with Portainer and a few containers, allow more.

Resource Ubuntu Server minimum Recommended for this series
CPU 64-bit (x86-64 or ARM64) 2 cores
RAM 1.5 GB 4 GB
Disk 4 GB 32 GB or more, ideally SSD
Network One network adapter Ethernet cable, not Wi-Fi

A mini PC, an old laptop with the lid closed or a virtual machine on Hyper-V, VMware or Proxmox all work. The cable matters: a DNS server that loses Wi-Fi takes the whole house offline.

Step 1: download the image and prepare a USB stick

  1. Download the Ubuntu Server 26.04 LTS ISO from the official page ubuntu.com/download/server. Pick your architecture: amd64 for ordinary PCs, arm64 for some mini PCs and ARM boards.
  2. For a physical PC, write the image to a USB stick with Rufus, balenaEtcher or Ventoy. For a virtual machine, attach the ISO as a virtual DVD drive.
  3. Boot from the stick (usually F12, F11 or Esc at power-on) and choose Try or Install Ubuntu Server.

Step 2: installer choices, screen by screen

The Ubuntu Server installer is text based: move with the arrow keys, Tab and Enter. These are the recommended choices for a Docker server.

Screen What to choose Why
Language and keyboard English and your real keyboard layout English messages are easier to search for; the layout must match the keyboard or your password will not match.
Installation type Ubuntu Server (not minimized) The minimized version drops useful troubleshooting tools.
Network Keep DHCP for now We set the static address afterwards, in a file you can read back and fix.
Proxy and mirror Leave empty and keep the suggested mirror Only needed on corporate networks with a proxy.
Storage Use an entire disk, with LVM LVM lets you grow the space later.
Profile Server name docker, a personal user (not admin or root) and a strong password This user gets administrator rights through sudo.
Ubuntu Pro Skip for now Free for personal use, but not needed in this series.
SSH Tick Install OpenSSH server So you can manage the server from your PC, without a monitor and keyboard attached.
Featured server snaps Select nothing, and especially not docker We install Docker from the official repository: Portainer’s documentation advises against the snap version of Docker on Ubuntu.

At the end choose Reboot Now, remove the stick and log in with the user you created.

With LVM, some installer versions do not assign the whole disk to the main volume. Check with df -h / and sudo vgs: if the VFree column shows free space, you can assign it like this:

sudo lvextend -r -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

That is the installer’s default volume name: check it first with sudo lvs.

Step 3: update and set the time zone

sudo apt update
sudo apt full-upgrade -y
sudo timedatectl set-timezone Europe/London
timedatectl

Use your own time zone (timedatectl list-timezones lists them). The correct time matters: container logs, certificates and AdGuard Home or Pi-hole statistics all rely on the server clock. If full-upgrade installed a new kernel, reboot with sudo reboot.

Ubuntu Server installs and enables automatic security updates (the unattended-upgrades package). Check they are active:

systemctl status unattended-upgrades --no-pager

Step 4: give the server a static IP address

A server must always have the same address: devices will use it as their DNS server and your browser will use it to open Portainer. There are two ways:

  • DHCP reservation on the router (the simplest): on the router you bind the server’s MAC address to a fixed IP. Nothing changes on the server.
  • Static address on the server with netplan, if you cannot or do not want to touch the router.

Either way, choose an address outside the router’s DHCP range so it is never handed to another device. First check the network adapter’s name and current address:

ip -br a
hostnamectl
ip -br a shows adapter ens18 with address 192.168.1.50/24, hostnamectl shows Ubuntu 26.04 LTS
Here the adapter is called ens18: on your server it may be enp1s0, eno1 or similar. Reconstructed screenshot, example values.

Netplan reads the YAML files in /etc/netplan/. List them with ls /etc/netplan/: after installation there is usually 50-cloud-init.yaml. Back it up outside the folder, then edit it:

sudo cp /etc/netplan/50-cloud-init.yaml ~/50-cloud-init.yaml.bak
sudo nano /etc/netplan/50-cloud-init.yaml

Replace the content with this, adapting the adapter name, addresses and router:

network:
  version: 2
  ethernets:
    ens18:
      dhcp4: false
      addresses:
        - 192.168.1.50/24
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses: [192.168.1.1, 9.9.9.9]

Spaces matter in YAML: use spaces only, never tabs, and keep the indentation. /24 is the 255.255.255.0 mask used by most home networks. If the file already has other lines (for example renderer), keep them.

Now test the configuration safely:

sudo chmod 600 /etc/netplan/50-cloud-init.yaml
sudo netplan try

netplan try applies the new configuration and, if you do not press Enter within two minutes, reverts to the previous one: if you made a mistake and lose the connection, just wait.

sudo netplan try asks for confirmation before the timeout, then ip route shows the router as default gateway
If the network works, press Enter to confirm; ip route must show the router as the default gateway. Reconstructed screenshot.

If you reserved the address on the router and kept DHCP, skip this step: just reboot the server or renew its lease.

Step 5: log in with SSH from your PC

On Windows open PowerShell or Terminal (if you rarely use it, start with PowerShell for beginners) and connect:

ssh user@192.168.1.50

On first connection confirm the server fingerprint with yes. That works, but with a password. A key is safer and more convenient: you create it once on the PC and copy it to the server.

# on the Windows PC, in PowerShell
ssh-keygen -t ed25519
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh user@192.168.1.50 "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Now ssh user@192.168.1.50 should log in without the server password (at most it asks for the key passphrase, if you set one). Only after checking this, disable password logins:

echo "PasswordAuthentication no" | sudo tee /etc/ssh/sshd_config.d/10-keys-only.conf
sudo sshd -t && sudo systemctl restart ssh

sshd -t checks the configuration before the restart. Keep the current session open and test a new login from another window: if something is wrong, delete the file from the open session and restart ssh.

Step 6: the firewall, with an important caveat

Ubuntu ships ufw, a simple front end to the kernel firewall. You can enable it while allowing SSH:

sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status

Be aware, though: Docker’s documentation warns that ports published by containers bypass ufw rules. A port opened by a container is reachable even if ufw does not allow it. We cover how to handle this in the guide on Docker concepts and in the maintenance and security guide; for now remember that the real network firewall is still the router, and that no server port should be forwarded to the internet.

Final check

Check Command Expected result
System version lsb_release -d Ubuntu 26.04 LTS
Static address ip -br a The chosen address on the adapter
Internet access ping -c 3 ubuntu.com Replies with no loss
Disk space df -h / Almost all the disk available
SSH with key ssh user@IP from the PC Login without the server password

In the next guide we install Docker Engine and Docker Compose from Docker’s official repository and start the first container.

Sources