VPS security checklist: A safer Ubuntu starting point
A VPS security checklist should establish tested administrative access, apply updates, restrict exposed services, protect independent backups, and make recovery practical. Change one control at a time and verify it before removing the old access path. This Ubuntu-focused checklist explains what to check, how to verify it, and when to stop before locking yourself out.
By Drew F. · Last updated: November 17, 2026
Before you change the server
These examples target Ubuntu Server 24.04 LTS with a working administrative account and sudo. Confirm the installed version with cat /etc/os-release. Other distributions, customized images, and systems with existing access policies require different steps. This is a baseline, not a compliance certification or a guarantee against compromise.
Take a recoverable backup before making changes. Confirm any console or recovery method offered for your service and test it while access works. Keep the current SSH session open and use a second terminal for login tests. If you cannot recover without SSH, resolve that before changing remote authentication or firewall rules.
For a server you have not connected to yet, start with the Ingen VPS setup guide. Do not combine a first login, authentication migration, and firewall redesign into one unverified change.
1. Apply updates with a maintenance plan
Refresh package metadata and review upgrades inside the VPS:
sudo apt update
sudo apt upgrade
Resolve repository errors and review prompts before accepting changes. Applications can restart during an upgrade; notify users and schedule a reboot if needed. Afterward, confirm that the application works, not merely that the package command exited successfully.
Inspect automatic-update configuration and logs rather than assuming it is active or covers every installed package. The Ubuntu automatic updates guide explains the supported configuration. Plan who reviews failures and who handles reboots. An unattended update policy without operational follow-through leaves gaps.
Before a risky upgrade, record versions and test recovery. Blindly downgrading packages is not a universal rollback strategy; restoration or an application-specific recovery procedure may be safer. Keep the previous working deployment and a compatible database recovery path where practical.
2. Test a regular administrative account and SSH keys
Use an individual account for administration. If deploy is the account name you want and it does not already exist, an administrator can create it and grant Ubuntu sudo access:
sudo adduser deploy
sudo usermod -aG sudo deploy
Follow the account prompts. Install your public SSH key in that account's ~/.ssh/authorized_keys using a trusted method, with correct ownership and restrictive directory/file permissions. Keep the private key on your local computer. Follow the Ubuntu OpenSSH setup instructions for key installation and configuration details.
From a second local terminal, explicitly test key authentication, replacing the address and account with your own:
ssh -o PreferredAuthentications=publickey -o PasswordAuthentication=no deploy@203.0.113.10
After login, run sudo -v and confirm administrative access. A key login without working sudo is not a replacement for the original administrator. Do not delete or disable a working account until you have tested its replacement and confirmed recovery access.
3. Validate SSH changes before applying them
Once key login and sudo work, review whether password and direct root SSH access are still needed. Typical key-only settings include PubkeyAuthentication yes, PasswordAuthentication no, KbdInteractiveAuthentication no, and PermitRootLogin no. Do not disable keyboard-interactive authentication if your approved login uses it for multi-factor authentication.
Read existing includes, image-provided files, and Match rules first. OpenSSH can use an earlier value rather than the file you edited last. The OpenSSH server configuration manual explains precedence and conditional settings.
Before changing a file, copy it to a known backup location. Then validate syntax and inspect the effective configuration:
sudo sshd -t
sudo sshd -T
The syntax check should produce no output and exit successfully. The second command prints effective settings; conditional configurations need checking for the intended connection context as well. Fix errors before applying the change. On Ubuntu, reload the validated configuration with sudo systemctl reload ssh, then repeat the second-terminal login test.
If it fails, keep the original session open, restore the changed file, validate again, and reload. Confirm the recovered login before closing either session. Changing the port alone is not a substitute for authentication controls.
4. Allow SSH before enabling a firewall
Inventory listening services first:
sudo ss -lntup
Read the local addresses and ports. A listener on all interfaces may be externally reachable depending on routing and firewall rules; a loopback listener is intended for local access. Identify what each process actually needs before opening ports.
For a fresh Ubuntu host using UFW, inspect existing rules with sudo ufw status verbose. If another firewall manager is in use, understand that configuration before introducing UFW. The example below assumes SSH really listens on TCP port 22; substitute the actual port before enabling restrictions:
sudo ufw allow 22/tcp
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
sudo ufw status verbose
Add required application rules before enabling the firewall, too. Verify the active status and expected allow rules, then test a new SSH connection. Test the application from outside the VPS for both IPv4 and IPv6 where configured. Do not publish a database port just because a web application needs to connect to it locally.
If you lose new connections, use the retained session or tested console to correct the rules. sudo ufw disable can temporarily remove UFW restrictions for recovery, but it also changes exposure; restore the intended policy promptly. Consult Ubuntu's firewall documentation before adapting rules to an existing server.
5. Check container ports and application privileges
Container publishing can bypass the UFW path you expected. Docker documents this interaction in its packet filtering and firewalls guide. Verify published ports from outside the host and use a deliberate network design rather than assuming a default-deny UFW policy covers every container.
Run applications with only the permissions they need. Keep secrets out of repositories, restrict environment-file access, and avoid exposing administrative panels publicly without appropriate access controls. Remove unused services after checking their dependencies. Maintain a record of previous settings so you can restore a needed service if a change breaks the application.
6. Back up data and prove you can restore it
Copy essential files, configuration, and database backups to an independent destination. Use the database's supported backup method; copying live database files without coordination can leave an inconsistent backup. Protect backup access with separate credentials and access appropriate to the data.
Test restoration somewhere safe. Record the backup timestamp, what you restored, and which application checks passed. A successful backup job is evidence of a copy operation, not evidence that the application can recover. Confirm retention and deletion policies, including whether a compromised production account could erase every backup.
Do not assume Ingen backup, snapshot, monitoring, or management features are included. Check your agreement and current service configuration. The VPS hosting page is a starting point for checking the service that supports your application; guest security still needs an explicit owner.
7. Review access, logs, and recovery regularly
Review authentication failures and unexpected services, investigate new privileged accounts, and remove departed administrators' keys. Set alerts that someone will receive and act on. Resource exhaustion can affect availability as well as security; the RAM and CPU guide explains what to measure before attributing slowdowns to insufficient capacity.
Repeat access and restore tests after major configuration changes. Assign a regular review for pending updates, backup failures, exposed ports, expiring credentials, and recovery documentation. Provider infrastructure protection and guest administration are different responsibilities; confirm the boundary in the service agreement rather than assuming either party handles everything.