Table of Contents

OS Baseline Setup

A clean, hardened Ubuntu Server installation is the foundation for everything that follows.

What this page covers

  • Installing Ubuntu Server (LTS recommended)
  • Initial user and sudo configuration
  • SSH hardening: key-based authentication, disabling password login
  • Configuring swap
  • Firewall basics with ufw
  • Setting hostname and timezone

Ubuntu Server installation

This guide targets Ubuntu Server 22.04 LTS or 24.04 LTS. The minimal server image is preferred — no desktop environment is needed.

  1. Download the ISO from ubuntu.com or provision a VPS with Ubuntu Server pre-installed.
  2. Follow the installer prompts; create a non-root user with sudo privileges.
  3. On VPS providers, an SSH key is typically injected during provisioning — prefer this over a password.

SSH hardening checklist

  • Copy your public key to the server (ssh-copy-id or paste into ~/.ssh/authorized_keys).
  • Set PasswordAuthentication no in /etc/ssh/sshd_config.
  • Set PermitRootLogin no.
  • Restart sshd after changes.

Swap configuration

Swap is important on memory-constrained nodes, especially for K3s.

See Using Swap in Linux for the full walkthrough.