On a new Ubuntu or Debian VPS, first verify the machine and recovery access, establish a working administrator account, review updates and network exposure, and prepare backups. Deploy applications after those basics work. Do not disable an existing login method until a replacement has been tested in a fresh session.
1. Confirm which machine and image you received
Match the address and service identifier against your provider’s trusted control panel. Verify the SSH host fingerprint through a trusted channel where available. An unexpected host-key change on an existing service needs investigation; do not simply remove the warning because a tutorial says to reconnect.
cat /etc/os-release
uname -r
hostnamectl
ip -br address
df -h
free -hRecord the OS release, hostname, addresses and expected resource allocation. Provider images can include cloud-init, custom networking or management agents. Inspect before removing packages or replacing configuration files that may support recovery or provisioning.
2. Prepare administrator and console access
- Verify how to open the provider console or rescue environment and which credentials it requires.
- Create or identify a named administrator with sudo access using the distribution’s account tools.
- Install that administrator’s public SSH key; keep the private key on the client.
- Open a second session using the intended key and verify sudo works.
- Retain the original session while applying the staged hardening checklist.
The VPS security guide covers effective SSH configuration, firewall ordering and lockout recovery. Follow that sequence before disabling passwords or root login; included files and Match rules can change which settings take effect.
3. Review and apply supported updates
# Ubuntu/Debian: inspect first, then approve the package changes
sudo apt update
apt list --upgradable
sudo apt upgradeReview the proposed changes and configuration prompts rather than adding automatic acceptance to an unfamiliar image. A kernel or service update may require a reboot or restart. Keep recovery access available, plan an appropriate maintenance interval and verify a fresh login and required services afterward. Do not mix third-party repositories for a different distribution release.
4. Inventory listeners before exposing applications
sudo ss -lntup
systemctl --failed
timedatectl statusConfirm time synchronization because logs, certificates and scheduled work depend on consistent time. Check both provider and guest firewalls, preserving the actual SSH port before enforcing inbound restrictions. A service listening locally is not proof it should be reachable from the Internet.
5. Establish recovery and monitoring
| Item | Acceptance check |
|---|---|
| Access | A fresh administrator login works and console recovery is understood |
| Updates | Supported repositories and any required reboot are accounted for |
| Exposure | Only intended listeners are public |
| Backup | Independent destination, credentials and restore procedure are recorded |
| Monitoring | Application checks and notifications can reach the responsible person |
| Deployment | Service account, persistent paths and rollback release are defined |
Keep application data separate from replaceable release files, document service startup and protect secrets. Reinstalling the OS is a destructive recovery action for local data; ensure a usable independent copy exists before considering it.
Use VPS backups and monitoring next. Compare VPS plans around the complete application stack and the administration responsibilities you are ready to own.
Sources and references
Hosting documentation. The original publication date was not recorded; the maintained update date is shown above.
Related articles
- How to Secure a Linux VPS Without Locking Yourself OutEstablish console recovery and a verified SSH key login before tightening authentication and firewall rules on Ubuntu or Debian.5 min read
- VPS Backups: Snapshots, Offsite Copies and Restore TestsBuild a recovery plan around consistent application data, independent storage and a restore procedure you can execute without the original VPS.3 min read
- KVM VPS Networking: IP Addresses, Ports and FirewallsTrace a failed connection from the guest listener through routing and firewall layers without replacing provider network settings blindly.3 min read
