What should I secure before my first VPS deployment?
Update the system, create a user, protect SSH, enable the firewall and backups.
Security on a VPS with root access is your responsibility. Complete these steps before exposing an application or a database.
Step-by-step procedure
-
Update the system
Install security updates at first login.
-
Create an administrator
Create a personal user, add it to sudo and test a second session before changing the root account.
-
Install the SSH key
Confirm that key-based login works, then disable SSH password authentication once you have a backup way to access the server.
-
Configure UFW
Allow SSH before enabling the firewall, then open only the ports you need.
-
Enable Fail2ban and backups
Monitor attempts, keep backups outside the VM, and test a restore.
Keep a console open
Test SSH in a second window before closing the current session or disabling password authentication.