Checklist · 2026

VPS security checklist for 2026

15 essential security checks every VPS needs — whether you run on DigitalOcean, Hetzner, or any other provider. Each step includes the priority level, manual command, and whether it can be automated. Bookmark this page and work through it on every new server.

Updated April 2026·~5 min read·15 checks
22 min
to first attack on a new VPS
6
critical checks you must not skip
10 of 15
checks Defensia automates

15 security checks every VPS needs

Work through this list top to bottom. Critical items should be done immediately after deploying your VPS. Important items within the first day. Nice-to-have items when you have time. For detailed explanations of each step, see our full guide on how to secure a Linux server.

CriticalImportantNice to have
#Security checkPriorityDefensia
1Disable root SSH login
2Use SSH keys only-
3Enable firewall (UFW/firewalld)-
4Update all packages-
5Enable automatic security updates-
6Install intrusion detection
7Configure WAF for web servers
8Scan for malware
9Check for CVE vulnerabilities
10Set security headers on web server-
11Secure database ports
12Enable geoblocking if applicable
13Set up monitoring and alerts
14Review file permissions-
15Run a security audit
1

Disable root SSH login

Critical

Root is the most targeted username. Disabling root login forces attackers to guess both a username and a password, effectively doubling the difficulty of a brute force attack.

sudo sed -i "s/#PermitRootLogin yes/PermitRootLogin no/" /etc/ssh/sshd_config && sudo systemctl restart sshd
2

Use SSH keys only

Critical

SSH keys are cryptographically stronger than any password. A 4096-bit RSA key would take billions of years to brute force. Once keys are set up, disable password authentication entirely.

sudo sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/" /etc/ssh/sshd_config && sudo systemctl restart sshd
3

Enable firewall (UFW/firewalld)

Critical

A firewall blocks access to all ports except the ones you explicitly need (typically 22, 80, 443). Without a firewall, every service on your server is exposed to the internet.

sudo ufw default deny incoming && sudo ufw allow 22 && sudo ufw allow 80 && sudo ufw allow 443 && sudo ufw enable
4

Update all packages

Critical

Unpatched software is one of the top attack vectors. Exploit code for critical CVEs often appears within hours of disclosure. Update everything before doing anything else.

sudo apt update && sudo apt upgrade -y
5

Enable automatic security updates

Important

Manual updates are forgotten. Automatic security updates ensure critical patches are applied even when you are not watching. The risk of a broken update is far lower than the risk of an unpatched CVE.

sudo apt install unattended-upgrades -y && sudo dpkg-reconfigure -plow unattended-upgrades
6

Install intrusion detection

Critical

Even with SSH keys, attackers still attempt brute force attacks that fill your logs and consume resources. Intrusion detection blocks attackers after repeated failures, stopping them at the network level.

curl -fsSL https://defensia.cloud/install.sh | sudo bash
7

Configure WAF for web servers

Important

A firewall allows traffic on ports 80/443 but cannot inspect HTTP content. SQL injection, XSS, and path traversal attacks arrive as valid HTTP requests. A WAF detects and blocks these application-level attacks.

8

Scan for malware

Important

Web application vulnerabilities can lead to uploaded web shells, cryptominers, and backdoors. Regular scanning catches what preventive measures miss. Focus on upload directories and /tmp.

9

Check for CVE vulnerabilities

Important

Your installed packages may contain known vulnerabilities even after updating, especially for third-party software. CVE scanning matches installed versions against the NVD database.

10

Set security headers on web server

Important

Security headers like X-Frame-Options, X-Content-Type-Options, HSTS, and CSP protect against clickjacking, MIME sniffing, protocol downgrade, and cross-site scripting. They cost nothing and prevent entire classes of attacks.

11

Secure database ports

Important

MySQL (3306), PostgreSQL (5432), MongoDB (27017), and Redis (6379) should never be accessible from the internet. Bind to localhost and block the ports in your firewall.

12

Enable geoblocking if applicable

Nice to have

If your users are all in one region, blocking entire countries at the firewall level eliminates a large percentage of automated attacks. Most SSH brute force originates from a handful of countries.

13

Set up monitoring and alerts

Important

Without monitoring, you will not know about attacks until the damage is done. Real-time alerts via Slack, email, or Discord ensure you are notified of critical security events immediately.

14

Review file permissions

Nice to have

World-readable .env files, writable web directories, and incorrect SSH key permissions are common misconfigurations. A permissions audit catches issues that standard security tools overlook.

find /var/www -type f -perm -o+w -ls
15

Run a security audit

Nice to have

Security auditing tools check hundreds of configuration points: kernel parameters, file permissions, service configurations, and compliance benchmarks. Run monthly to catch configuration drift.

sudo lynis audit system

How long does this take?

2-4 hours
Manual hardening

SSH config, firewall setup, update configuration, WAF installation (ModSecurity + CRS), malware scanner setup, log monitoring, database hardening, security audit tools. Requires ongoing maintenance: rule updates, log reviews, regular scans.

30 seconds
With Defensia

One command covers items 1, 6, 7, 8, 9, 10, 11, 12, 13, and 15 from the checklist. You still need to do items 2-5 (SSH keys, firewall, updates) manually — those are one-time server configuration tasks.

Prioritized action plan

If you only have 15 minutes, do the critical items. They block the most common attack vectors.

Critical — do immediately

~15 minutes
Disable root SSH login (PermitRootLogin no)
Switch to SSH key authentication (PasswordAuthentication no)
Enable firewall — allow only ports 22, 80, 443
Update all packages (apt upgrade / dnf update)
Install intrusion detection (fail2ban or Defensia)
Restart SSH service to apply changes

Important — within the first day

~1 hour
Enable automatic security updates
Configure WAF if running a web server
Run initial malware scan
Scan for CVE vulnerabilities in installed packages
Add security headers to nginx/Apache
Verify database ports are not exposed
Set up Slack/email alerts for security events

Nice to have — when you have time

~30 minutes
Enable geoblocking for non-global services
Review file permissions across web directories
Run Lynis or OpenSCAP security audit

Save this checklist

Bookmark this page and revisit it every time you deploy a new VPS or perform a quarterly security review. The checklist covers both the initial hardening and the ongoing checks you need to repeat.

For automated checking, Defensia's security posture score (0-100, A-F grade) continuously evaluates your server against these criteria and surfaces issues in the dashboard. No manual scans needed.

Frequently asked questions

How do I secure a VPS for the first time?

Start with the 6 critical items in this checklist: disable root SSH login, switch to SSH keys, enable a firewall, update all packages, install intrusion detection, and restart SSH. These can be done in 15 minutes and block the majority of automated attacks. Then work through the important items within the first day.

What's the most important VPS security step?

If you can only do one thing: enable a firewall and block all ports except the ones you need. A close second is installing intrusion detection for SSH brute force protection. Together, these two steps eliminate over 90% of your attack surface.

How often should I run this checklist?

Run the full checklist on every new VPS deployment. Then revisit quarterly: re-run security audits (Lynis), verify configurations have not drifted, check for new CVEs, and review firewall rules. If you use Defensia, the security posture score tracks most of this continuously.

Does this checklist work for all Linux distros?

Yes. The principles apply to Ubuntu, Debian, CentOS, RHEL, Rocky Linux, AlmaLinux, Fedora, and Amazon Linux. The specific commands vary slightly (apt vs dnf, UFW vs firewalld), but the security checks are universal. Each step in the expanded details shows the appropriate command.

Can I automate this checklist?

Partially. Items 1-5 (SSH config, firewall, updates) are one-time server configuration tasks that you should do manually and verify. Items 6-15 (intrusion detection, WAF, malware scanning, CVE scanning, monitoring, audits) can be automated with Defensia — a single install command covers 10 of the 15 checks in this list.

Sources

  • Defensia telemetry: 4,200 average attacks/server/day across 9 monitored production servers (2026).
  • NIST National Vulnerability Database (NVD): CVE data and scoring.
  • CISA Known Exploited Vulnerabilities (KEV) catalog.
  • CIS Benchmarks for Linux server hardening.
  • OWASP Top 10 Web Application Security Risks (2021).

Automate 10 of 15 checks instantly

One command. Under 30 seconds. Free for one server.

$ curl -fsSL https://defensia.cloud/install.sh | sudo bash
Create Free Account

No credit card required.