Network Security Fundamentals for Self-Hosters
Self-hosting means your server is on the internet. Network security basics protect against the constant barrage of automated attacks.
Your Server Is Under Attack
Plug a server into the internet and within minutes, automated scanners start probing it. SSH brute force, port scans, vulnerability scanners — it's constant.
Layer 1: Firewall
Only Open What You Need
Default deny all incoming traffic. Explicitly allow:
That's it. Nothing else.
UFW (Uncomplicated Firewall)
The simplest Linux firewall:
ufw default deny incoming
ufw default allow outgoing
ufw allow 80
ufw allow 443
ufw allow 22
ufw enable
Layer 2: SSH Hardening
Disable Password Authentication
Use SSH keys only. Password brute force is the #1 attack vector.
PasswordAuthentication no
Disable Root Login
PermitRootLogin no
Use a regular user and sudo.
Change Default Port
Port 2222 (or any non-standard port)
Doesn't stop determined attackers but eliminates 90% of automated scans.
Rate Limit SSH
Use fail2ban to ban IPs after failed attempts.
Layer 3: Fail2ban
Automatically bans IP addresses that show malicious patterns.
Layer 4: Reverse Proxy Security
Security Headers
Add via Caddy or Nginx:
Rate Limiting
Limit requests per IP per second. Prevents brute force and simple DDoS.
Hide Server Information
Remove Server headers that reveal software versions.
Layer 5: Keep Everything Updated
Enable automatic security updates:
apt-get install unattended-upgrades
Update container images regularly. Old images have known vulnerabilities.
Layer 6: Monitoring
The Minimum Security Checklist
1. Firewall with default deny
2. SSH keys only, no root login
3. fail2ban active
4. All services behind HTTPS reverse proxy
5. Automatic security updates enabled
6. Regular backups (tested!)
TinyPod servers come pre-configured with firewall rules, SSH hardening, and Caddy's automatic HTTPS. Security defaults that don't require configuration.