Back to feed
Dev.to
Dev.to
7/6/2026
The original title is "Self-Hosting Like a Pro, Part 1: Hardening a Fresh Ubuntu VPS"

The original title is "Self-Hosting Like a Pro, Part 1: Hardening a Fresh Ubuntu VPS"

Original: Self-Hosting Like a Pro, Part 1: Hardening a Fresh Ubuntu VPS

Short summary

Harden a fresh Ubuntu VPS in about an hour with non-root users, SSH key authentication, UFW firewall rules, and Fail2ban to automatically ban brute-force attackers. Part one of a four-part series documenting how to turn a €10/month VPS into production infrastructure. Covers essential security steps before deploying applications—protecting against the automated attacks that begin within minutes of your server getting a public IP.

  • Set up non-root user with sudo privileges to avoid dangerous root operations
  • Configure SSH key authentication and disable password/root login to prevent brute-force attacks
  • Use UFW firewall to block all inbound traffic except SSH, HTTP, and HTTPS
  • Install Fail2ban to automatically ban IPs that fail authentication multiple times
  • Enable automatic security updates to stay protected against known vulnerabilities

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more