A fresh virtual server is a blank page. A few careful hours at the start make the difference between a machine you forget about — in the good sense — and one that keeps surprising you.
Day one: access and updates
- Log in with an SSH key, not a password.
- Create a regular user and use sudo for administration.
- Install all pending updates and reboot.
- Enable unattended security updates.
ssh-copy-id you@your-server
sudo apt update && sudo apt full-upgrade -y
sudo apt install unattended-upgrades fail2banDay one: the firewall
Allow only what you need — usually SSH and the ports of the services you actually run — and block everything else.
Day two: backups and notes
- Set up nightly backups that leave the machine.
- Restore one file to prove that they work.
- Write a README describing what runs on the server and why.