Skip to content
VDS · Operating systems

Ubuntu: specifics and first steps

Setting up Ubuntu 22.04, 24.04, and 26.04 on a server: updates, snap and PPA, firewall, automatic patches, and the messages that scare you at login.

Updated August 23, 2026

Ubuntu is the most documented server OS on the internet: you can find almost any guide specifically for it. 22.04, 24.04, and 26.04 are available.

First commands

apt update && apt upgrade -y
apt install -y curl git nano ufw htop
timedatectl set-timezone Europe/Moscow
hostnamectl set-hostname my-vds
lsb_release -a

If the kernel was updated during the update, reboot: reboot.

What you see on login

Ubuntu prints a greeting with statistics and sometimes a line like “N updates can be applied immediately” or an offer for an Ubuntu Pro subscription. These are informational messages, not an error. Updates are installed with a regular apt upgrade; no subscription is required.

You can remove the extra noise by disabling unnecessary parts of the greeting in /etc/update-motd.d/.

Snap and PPA

MechanismWhen to use
aptThe main path, always start with it
snapWhen the package isn't in the repository or you need a specific recent version
PPAOfficial project repositories, not random ones

Working with snap:

snap list
snap install certbot --classic
snap refresh

Adding a PPA:

add-apt-repository ppa:ondrej/php
apt update

Don't add PPAs one after another “just in case”. Someone else's repository can replace a system package and break updates. One project — one repository, and preferably the official one.

User and sudo

adduser artem
usermod -aG sudo artem

Unlike Debian, sudo is already installed in Ubuntu. Check login and permissions from a new window without closing the current session.

Firewall

ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
ufw status numbered

Delete an extra rule: ufw delete 3 using the number from the last command. If you accidentally cut off your SSH access, the text console in the panel will help.

Automatic patching

In Ubuntu the package is already installed; enable it like this:

dpkg-reconfigure -plow unattended-upgrades
systemctl status unattended-upgrades

Some updates require a reboot. Indicator:

ls /var/run/reboot-required

If the file exists, plan for a reboot.

Choosing a version

For a server, choose LTS: 22.04 or 24.04. Version 26.04 will work if you need fresh packages and are prepared for the fact that some third-party repositories don't support it yet.

Upgrading between releases is done via do-release-upgrade, but on a production machine it's a risk: VPS has no copies or snapshots, so there's nowhere to roll back to. First, copy the data to your own machine — scp and rsync — or simply reinstall the system with the version you need.

Guest agent

apt install -y qemu-guest-agent
systemctl enable --now qemu-guest-agent

Without it, the panel won't show used space and won't perform a graceful reboot.

Next — first-hour checklist.