Guides ยท Oct 5, 2026
Ubuntu 26.04 VPS Setup and Hardening Checklist
A practical first-hour checklist for a new Ubuntu 26.04 LTS VPS: updates, a sudo user, SSH keys, firewall, automatic updates and swap.
A fresh Ubuntu 26.04 LTS server is a blank slate: the system is minimal, nothing is configured for your workload, and it is already reachable from the whole internet. This checklist takes you from first login to a sensible baseline in about an hour. It works for any workload, whether you are hosting a website, a bot or a database.
You can deploy Ubuntu 26.04 on any Ubuntu VPS from the store. Pick the 26.04 image when ordering, or reinstall an existing server from the dashboard (reinstalling erases the disk, so copy your data first).
1. First login and updates
Your dashboard shows the IP address and the initial credentials. Connect and update:
ssh root@YOUR_SERVER_IP
apt update && apt full-upgrade -y
reboot
Reconnect after the reboot. A new kernel only takes effect after a restart, so do it now while nothing depends on the server.
2. Set hostname, timezone and locale
hostnamectl set-hostname my-server
timedatectl set-timezone UTC
timedatectl status
Using UTC on servers keeps log timestamps consistent when you work across machines. The timedatectl status output should show that the system clock is synchronized. Accurate time matters for TLS certificates, two-factor codes and log correlation.
3. Create your own admin user
adduser deploy
usermod -aG sudo deploy
Use this account for daily work and keep root for emergencies. Everything you do with sudo is logged, which helps when you wonder later what changed.
4. Install your SSH key and lock down SSH
From your own computer:
ssh-keygen -t ed25519 -C "my-laptop"
ssh-copy-id deploy@YOUR_SERVER_IP
Test the key login in a second terminal, then disable passwords and root login. The complete walkthrough, including testing the configuration before you restart SSH, is in our guide to securing SSH on a VPS.
5. Turn on the firewall
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable
Open further ports only when a service needs them (80 and 443 for a website, for example). The UFW firewall guide explains rate limiting, port ranges and how to review your rules.
6. Automatic security updates
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
Security updates are installed automatically, while feature updates stay manual. If you want the server to reboot itself for kernel updates, edit /etc/apt/apt.conf.d/50unattended-upgrades and set Unattended-Upgrade::Automatic-Reboot "true"; together with a quiet Automatic-Reboot-Time. Leave it off on servers where a surprise restart would hurt.
7. Check memory and add swap if needed
free -h
swapon --show
If you see no swap and your workload has memory spikes (builds, databases, game servers), add a swap file as a safety net. It takes two minutes with our swap file guide.
8. Install the basics you will actually use
sudo apt install -y curl wget git htop ncdu tmux unzip fail2ban
- htop shows CPU and memory per process.
- ncdu finds what is eating your disk (
ncdu /). - tmux keeps long commands running if your connection drops.
- fail2ban bans IPs that repeatedly fail to log in. Enable it with
sudo systemctl enable --now fail2ban.
9. Know what is listening
Every open port is attack surface. List the listening sockets and make sure you recognise each one:
sudo ss -tulpn
Anything bound to 0.0.0.0 or [::] is reachable from outside unless your firewall blocks it. Databases and admin panels should listen on 127.0.0.1 only and be reached through an SSH tunnel or a reverse proxy such as the one in our Nginx reverse proxy guide.
10. Plan backups and monitoring
Daily server backups are included with TidalVPS, but you should still keep your own copy of critical data off the server (see the restic backup guide). For monitoring, a simple uptime check from outside is worth more than a complicated dashboard: Uptime Kuma can run on a second small server and alert you when the first one stops answering.
11. A note on network-level attacks
Host hardening protects the server software. It does not stop a flood of junk traffic that fills the network pipe. That is handled before traffic reaches your server, which is why always-on filtering on a DDoS protected VPS is a separate layer from your firewall. Our guide to DDoS protection explains the difference.
Quick verification
lsb_release -d
sudo ufw status verbose
sudo sshd -T | grep -E "passwordauthentication|permitrootlogin"
systemctl is-active fail2ban unattended-upgrades
If password authentication and root login both show no, the firewall is active and the services report active, you have a solid baseline to build on. Save these commands as a script if you set up servers often.
Frequently asked questions
Should I use Ubuntu 24.04 or 26.04 for a new server?
Both are LTS releases. 26.04 is the newer one with a longer support runway, while 24.04 has had more time for third-party software to catch up. Check that the software you need supports 26.04, then prefer the newer release for new servers.
Do I need a firewall if my provider has DDoS protection?
Yes. Network-level protection filters floods before they reach the server, while a host firewall controls which of your services are reachable at all. They solve different problems.
Is fail2ban still necessary with SSH keys only?
It is optional once password login is off, but it keeps logs quieter and protects other services such as web logins.
How do I recover if I lock myself out?
Use the web console in your TidalVPS dashboard, which does not depend on SSH, and fix the configuration from there.
Related guides
- How to Secure SSH on a New VPS: Keys, Config and Fail2ban
- UFW Firewall on an Ubuntu VPS: Rules, Rate Limiting and Docker Caveats
- How to Add a Swap File on an Ubuntu VPS (and Tune It Properly)
Need a server for this?
Every TidalVPS VPS comes with full root access, unmetered traffic, daily backups and DDoS protection.