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.
- Download the ISO from ubuntu.com or provision a VPS with Ubuntu Server pre-installed.
- Follow the installer prompts; create a non-root user with sudo privileges.
- 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-idor paste into~/.ssh/authorized_keys). - Set
PasswordAuthentication noin/etc/ssh/sshd_config. - Set
PermitRootLogin no. - Restart
sshdafter changes.
Swap configuration
Swap is important on memory-constrained nodes, especially for K3s.
See Using Swap in Linux for the full walkthrough.