Linux VPS first-hour setup checklist
Update the system, create a normal user, switch to SSH keys, turn on a firewall and set up backups. That order covers the basics in under an hour. The commands below are for Ubuntu and Debian; AlmaLinux uses `dnf` instead of `apt`.
By VPSRely Editorial, Editorial team. Published . 7 min read.
1. Update the system
Log in over SSH as root, then run apt update && apt upgrade -y. Reboot if the update replaced the kernel.
2. Add a normal user
Run adduser deploy and usermod -aG sudo deploy. Use this user for daily work so you are not typing commands as root all day.
3. Use SSH keys instead of passwords
On your own computer, run ssh-keygen -t ed25519, then ssh-copy-id deploy@SERVER-IP. Test that you can log in with the key before changing anything else.
Then edit /etc/ssh/sshd_config, set PasswordAuthentication no and PermitRootLogin no, and run systemctl restart ssh. Keep your current session open while you test a second one, so a mistake does not lock you out.
4. Turn on a firewall
On Ubuntu, run ufw allow OpenSSH, then ufw allow 80,443/tcp if you serve a website, then ufw enable. Add other ports only when a service needs them.
5. Install security updates automatically
Run apt install unattended-upgrades. It installs security patches in the background so a forgotten server does not fall behind. You still need to reboot now and then for kernel updates.
6. Set up backups before you need them
Decide what matters: usually your database, uploaded files and configuration. Copy it off the server on a schedule, and test a restore once. A backup you have never restored is a guess.
Not sure the server is big enough? Read how much RAM a VPS needs. Plans and prices are on the Linux VPS page.