Ubuntu Server

The distribution most guides assume, with the details they leave out.

3guides Feed

Ubuntu LTS is the default assumption in most server documentation, which makes it the pragmatic choice even where a technical argument favours something else. Five years of security maintenance and a package for nearly everything is a reasonable trade.

Reach for the LTS release for anything that will still be running next year. Reach for an interim release only when you need a kernel or a package version the LTS does not have, and accept a nine-month support window if you do.

The 24.04 release changed two things that quietly break older instructions. SSH is socket-activated, so the listening port is owned by ssh.socket and editing Port in sshd_config no longer does what tutorials say. And the logging story has moved toward journald, so guides that assume /var/log/auth.log exists — fail2ban’s default jail among them — need adjusting.

Beyond that, most Ubuntu-specific trouble is resource limits. File descriptor ceilings inherited from a systemd unit rather than your login shell. inotify watcher limits that dev servers and log shippers exhaust. Values set with sysctl -w that vanish on reboot because they were never written to /etc/sysctl.d/.

Unattended upgrades are worth enabling on every host and worth configuring deliberately: security pocket on, automatic reboot off unless a reboot at 06:00 is genuinely acceptable, and /var/run/reboot-required watched from wherever you watch things.

Articles here state which release they were verified on, because the answer has changed more between 22.04 and 24.04 than the version numbers suggest.

Start here

How to Secure a VPS That Runs Docker Containers

SSH hardening, a default-deny firewall, and the fix for the problem that catches almost everyone — Docker publishing container ports straight past UFW into the public internet.

Intermediate · 4 min read

Beginner to advanced

A reading order that builds Ubuntu knowledge in the sequence it is actually needed.

  1. Start How to Secure a VPS That Runs Docker Containers 4 min
  2. Build How to Fix the Docker Too Many Open Files Error on Ubuntu 4 min
  • intermediate

    How to Secure a VPS That Runs Docker Containers

    SSH hardening, a default-deny firewall, and the fix for the problem that catches almost everyone — Docker publishing container ports straight past UFW into the public internet.

    4 min
  • intermediate

    How to Deploy n8n on an Ubuntu VPS with Docker

    A production n8n install on Ubuntu 24.04 using Docker Compose, PostgreSQL and Caddy for automatic TLS — with the encryption key, webhook URL and backup steps most quickstarts leave out.

    5 min

Common problems

Failure modes that come up repeatedly with Ubuntu, and where each one is solved.

Changing the SSH port has no effect on 24.04
SSH is socket-activated. The listening port belongs to `ssh.socket`, so editing `Port` in sshd_config alone does nothing.
fail2ban starts but never bans anything
On installs without rsyslog there is no /var/log/auth.log for the default jail to read. Set `backend = systemd` in jail.local.
sysctl changes disappear after reboot
Values set with `sysctl -w` are not persisted. Write them to a file in /etc/sysctl.d/ and apply with `sysctl --system`.

Latest Ubuntu guides

Browse the archive
  • intermediate

    How to Secure a VPS That Runs Docker Containers

    SSH hardening, a default-deny firewall, and the fix for the problem that catches almost everyone — Docker publishing container ports straight past UFW into the public internet.

    4 min
  • intermediate

    How to Deploy n8n on an Ubuntu VPS with Docker

    A production n8n install on Ubuntu 24.04 using Docker Compose, PostgreSQL and Caddy for automatic TLS — with the encryption key, webhook URL and backup steps most quickstarts leave out.

    5 min

Recently updated

  • intermediate

    How to Secure a VPS That Runs Docker Containers

    SSH hardening, a default-deny firewall, and the fix for the problem that catches almost everyone — Docker publishing container ports straight past UFW into the public internet.

    4 min
  • intermediate

    How to Deploy n8n on an Ubuntu VPS with Docker

    A production n8n install on Ubuntu 24.04 using Docker Compose, PostgreSQL and Caddy for automatic TLS — with the encryption key, webhook URL and backup steps most quickstarts leave out.

    5 min

Frequently asked questions

LTS or the latest interim release for a server?

LTS. Five years of standard security maintenance, and every piece of third-party documentation is written against it. Interim releases are supported for nine months, which is a short upgrade treadmill for a server.

Should I use the docker.io package from the Ubuntu archive?

No. It lags upstream and does not track the Compose v2 plugin the way Docker's own apt repository does. Add Docker's repository instead.

How do I know a security update needs a reboot?

The file `/var/run/reboot-required` exists when one does, and `/var/run/reboot-required.pkgs` lists why. Check it from monitoring rather than by logging in.

Sources

  1. Ubuntu Server documentation Canonical Primary source
  2. systemd.exec manual page systemd Primary source
  3. Ubuntu release cycle Canonical Primary source