Back

How to Install Ubuntu on a VPS Step-by-Step (2026)

Articles

06/03/2026

Ubuntu VPS • Fresh Install • 2026 Edition

How to Install Ubuntu on a VPS Step-by-Step (2026)

This beginner-friendly guide shows exactly how to install (or re-install) Ubuntu on a VPS in 2026: pick the right Ubuntu version,
deploy from a provider image, connect with SSH, complete first-boot setup, update packages, secure SSH, configure a firewall, and verify
your server is ready for websites, bots, APIs, and applications.

by Hamza

When people say “install Ubuntu on a VPS,” they usually mean one of two things: (1) choosing an Ubuntu image while creating a new server,
or (2) rebuilding an existing VPS (reinstalling the OS from scratch). In both cases, the result is the same: a clean Ubuntu system running
in the cloud, ready for your projects.

Ubuntu is one of the most popular VPS operating systems because it has great documentation, strong security defaults, and excellent support
for popular stacks like Nginx, Node.js, Python, Docker, and databases. In this guide, we’ll focus on a simple setup that beginners can follow,
while still applying best practices used in production.

What You’ll Learn

  • Which Ubuntu version to choose for a VPS in 2026
  • How to deploy Ubuntu from a VPS provider’s OS image
  • How to rebuild/reinstall Ubuntu on an existing VPS
  • First login checklist: updates, users, SSH keys, firewall
  • Common mistakes and how to avoid locking yourself out

1) Choose the Right Ubuntu Version (2026)

For most VPS projects, you want an Ubuntu LTS release. LTS (Long Term Support) versions are designed for stability,
security patches, and long-term usage. That’s ideal for servers because you don’t want surprise breaking changes every few months.

Ubuntu 22.04 LTS

Great compatibility and widely supported by guides and hosting images. Excellent if you want “safe and proven.”

Ubuntu 24.04 LTS

Newer packages and modern defaults. Choose this if your provider supports it and you want the latest LTS base.

If you’re unsure, choose the newest available LTS image offered by your VPS provider. It’s usually the best balance for 2026.

2) Deploy Ubuntu on a New VPS (Most Common Method)

Most VPS providers don’t require you to “install” Ubuntu manually like you would on a physical PC. Instead, they provide prebuilt OS images.
You select Ubuntu from a dropdown, click Create, and within minutes you get a working server.

Recommended settings

  • OS: Ubuntu 22.04/24.04 LTS
  • Plan: 1 vCPU + 1–2GB RAM for starter projects
  • Region: closest to your users
  • Login method: SSH key (recommended)
  • Backups: enable if available

Avoid beginner problems

  • Don’t forget to save the root password (if your provider uses it)
  • Don’t open random ports “just in case”
  • Enable backups or create a snapshot before big changes

Once your VPS is created, you’ll receive a public IP address. Next step: connect using SSH.

3) Connect to Ubuntu via SSH

SSH is how you remotely access your VPS. If you used SSH keys, your local machine authenticates using your private key.
If your provider uses passwords, you’ll use the password they provided.

ssh root@YOUR_SERVER_IP

Tip: On your first connection, you may see a “host authenticity” warning. This is normal. Verify the IP is correct, then continue.

4) First Boot Checklist (Do This Immediately)

A fresh Ubuntu VPS is usually minimal. The goal of this section is to make it secure and comfortable to manage.
These steps prevent most security issues for new servers.

A) Update packages

sudo apt update && sudo apt upgrade -y

B) Install basic utilities

sudo apt install -y curl wget unzip git nano ufw

C) Set timezone (optional but recommended)

sudo timedatectl set-timezone Africa/Casablanca
timedatectl

5) Create a Non-Root User (Production Best Practice)

Working as root is dangerous because one wrong command can destroy your system. Create a normal user and use sudo only when needed.

adduser hamza
usermod -aG sudo hamza

Now test login as the new user:

ssh hamza@YOUR_SERVER_IP

6) Secure SSH (Disable Root Login + Prefer Keys)

SSH is the main entry point to your VPS. Securing it properly prevents the most common attacks. In 2026, the best approach is:
SSH keys + root login disabled + (optional) disable password login.

A) Edit SSH config

sudo nano /etc/ssh/sshd_config

B) Set these values

PermitRootLogin no
PasswordAuthentication no

Only disable passwords if you already confirmed SSH key login works, otherwise you can lock yourself out.

C) Restart SSH

sudo systemctl restart ssh

7) Enable Firewall (UFW)

Firewalls are essential. A clean rule: open only what you use. Start by allowing SSH, then enable the firewall.
If you host a website later, add ports 80 and 443.

SSH access

sudo ufw allow OpenSSH

Enable and check

sudo ufw enable
sudo ufw status

8) Optional: Add Fail2ban for Extra Protection

Fail2ban monitors logs and bans IP addresses that repeatedly fail login attempts. It’s a great “set it and forget it” tool.

sudo apt install -y fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban

9) Verify Ubuntu is Working Correctly

Now you should confirm your server is healthy: check versions, disk usage, memory, and that SSH stays accessible.

System info

lsb_release -a
uname -a

Resources

df -h
free -h

Conclusion: Your Ubuntu VPS is Ready for Real Projects

Installing Ubuntu on a VPS in 2026 is mostly about choosing the right image and doing a strong first-boot checklist:
update packages, create a non-root sudo user, lock down SSH, and enable a firewall. After that, your server becomes a stable base for
websites, APIs, Telegram/Discord bots, Docker projects, and more.

If you want a reliable VPS to deploy Ubuntu and start building, you can explore
Retzor VPS hosting
for scalable VPS plans made for developers and businesses.

© 2026 • Ubuntu VPS Installation Guide
Retzor Reviews