Mist Network
Kanalı takip et
Destek

VPS Security Checklist: 12 Steps to Harden a New Server

A fresh VPS is scanned by bots within minutes of going online. This 12-step checklist covers what to lock down in the first hour and what to keep doing every month.

Updated: 4 min read
VPS security checklist — hardening a new Linux server with SSH keys, firewall and updates

A VPS security checklist is the list of steps you run on every new server before you put anything important on it: lock down SSH, enable a firewall, keep the system updated, limit what runs and make sure you can recover. Automated bots start probing new IP addresses within minutes, so the first hour matters more than any later tuning.

The steps below assume a Linux VPS such as Ubuntu or Debian with root access. Commands are examples; adapt them to your distribution. Work through them in order and keep a second SSH session open while you change login settings, so a mistake cannot lock you out.

Why a new VPS needs hardening

A virtual private server gives you full control, which also means full responsibility. Unlike shared hosting, nobody patches your packages or watches your logins for you. The most common real-world compromises are not clever exploits but simple ones: weak SSH passwords, an outdated web app, an exposed database port or a forgotten test service.

Key takeaway: most attacks on a VPS are automated and opportunistic. Closing the easy doors — passwords, open ports, missing updates — stops the vast majority of them.

The first hour: 8 essential steps

  1. Update everything — run apt update && apt upgrade (or your distribution's equivalent) and reboot if the kernel changed.
  2. Create a non-root user — add a user with sudo rights and use it for daily work instead of root.
  3. Use SSH keys — generate a key pair on your computer and copy the public key to the server with ssh-copy-id.
  4. Disable password and root login — in /etc/ssh/sshd_config set PasswordAuthentication no and PermitRootLogin no, then restart SSH after testing the key login in a second session.
  5. Enable a firewall — with ufw, allow only what you need, for example ufw allow OpenSSH, ufw allow 80,443/tcp, then ufw enable.
  6. Turn on automatic security updates — on Debian/Ubuntu install and enable unattended-upgrades.
  7. Install fail2ban — it bans IPs that repeatedly fail to log in, slowing brute-force attempts.
  8. Set the time zone and hostname — correct timestamps make logs and certificates reliable.
Tip: keep your current SSH session open while you edit SSH settings, and test the new login in a separate window. If anything goes wrong, fix it from the session that is still connected.

Ongoing hardening: 4 more steps

  1. Remove what you do not use — uninstall unneeded packages and stop services you do not need. Check listening ports with ss -tulpn.
  2. Keep databases private — bind MySQL, PostgreSQL or Redis to 127.0.0.1 or a private network, never to the public internet.
  3. Back up off the server — copy backups to another location and test a restore. A snapshot on the same machine is not a backup.
  4. Watch logs and resources — review auth logs, set up simple uptime and disk-space alerts, and look into unexpected CPU spikes.

Checklist at a glance

AreaActionHow often
AccessSSH keys only, no root or password loginOnce, then review keys quarterly
NetworkFirewall with only required ports openEvery time you add a service
UpdatesAutomatic security updates plus manual upgradesAutomatic daily; manual monthly
Brute forcefail2ban or similarOnce, check bans occasionally
ServicesRemove unused software, bind databases locallyMonthly review
RecoveryOff-server backups with tested restoresDaily backups; restore test quarterly
WebHTTPS, updated CMS and pluginsWeekly

Securing the web layer

If the VPS hosts a website, the application is often the weakest point. Keep your CMS, plugins and frameworks updated, use HTTPS with a free certificate, and run each site under its own system user so one compromised site cannot read the others. Add a CAA record to your domain so only your chosen certificate authority can issue certificates, and point the domain correctly using our guide on pointing a domain to a VPS.

Store secrets such as API keys and database passwords in environment files with restricted permissions, never in a public web directory or a Git repository.

Watch out: security tools do not replace updates. A fully configured firewall still lets attackers reach an outdated web application on port 443. Patch first, then add layers.

Access for teams and multiple admins

Servers rarely stay single-user for long. As soon as a colleague, freelancer or deployment tool needs access, the way you hand out credentials becomes part of your security.

  • One key per person — every admin gets their own user account and SSH key. Never share a root password or a single key across a team.
  • Separate keys for automation — CI pipelines and backup jobs get their own restricted keys, limited to the commands or directories they need.
  • Remove access the same day — when someone leaves a project, delete their user and key immediately. Review authorized_keys files every quarter.
  • Log privileged actions — sudo records who ran what, which makes mistakes and incidents much easier to trace.
  • Protect the control panel too — your provider account can reinstall or delete the server, so give it a strong unique password and two-factor authentication where available.

What to do if you suspect a breach

  • Do not delete evidence straight away; take a snapshot or copy logs first.
  • Rotate every password and SSH key that touched the server.
  • Check for unknown users, cron jobs, SSH keys and processes.
  • When in doubt, rebuild from a clean image and restore data from a backup made before the incident.

A secure base with mistREG VPS

mistREG runs KVM VPS servers in Slovenia (EU) on NVMe SSD and AMD EPYC hardware. KVM gives each server its own kernel, so you can use any firewall, kernel setting or security tool you like. Provisioning is automatic: about 60 seconds after payment the IP address and root password appear in your panel, ready for the checklist above. Learn more in our guide to offshore VPS hosting.

~60 sto a running VPS
KVMfull virtualisation
NVMeSSD storage

Create an account, top up with crypto or card and pick a server on the plans section. Questions? Our team is on Telegram at @mistnetwork.

Frequently asked questions

What is the first thing to do on a new VPS?
Update all packages, then set up SSH key login with a non-root user and disable password and root login. These steps stop most automated attacks.
Should I change the default SSH port?
It reduces log noise from bots but is not real security. SSH keys, disabled password login and fail2ban matter far more.
Is ufw enough as a firewall?
For most single servers, yes. ufw is a simple front end to the Linux firewall; what matters is opening only the ports your services need.
How often should I update my VPS?
Security updates should install automatically every day. Review and apply other upgrades at least once a month and after major announcements.
Does a VPS provider back up my server?
Do not assume so. Keep your own backups in a separate location and test restoring them regularly.

Related articles

Mist NetworkMist Network