team@tinypod.app
Securing Your Self-Hosted Services: A Complete Guide
Self-hosting means you're responsible for security. Firewalls, HTTPS, authentication, updates — here's everything you need to do.
securityhardeningself-hostingguide
Layer 1: Network
Firewall
Only open ports you need (typically 80, 443, 22)Use UFW or nftablesBlock all inbound by defaultRate limit SSHSSH Hardening
Disable password authenticationUse SSH keys onlyChange default port (optional, reduces noise)Use fail2ban to block brute forceConsider SSH certificatesLayer 2: HTTPS
Every service must be behind HTTPSUse Let's Encrypt with auto-renewalUse a reverse proxy (Caddy, Traefik, Nginx)HSTS headersRedirect HTTP to HTTPSLayer 3: Authentication
SSO
Use Authentik or Keycloak for single sign-on across all services.
2FA
Enable two-factor authentication everywhere possible.
Strong Passwords
Use Vaultwarden to generate and store unique passwords.
Layer 4: Updates
Keep your OS updated (unattended-upgrades on Debian/Ubuntu)Keep containers updated (Watchtower or manual updates)Subscribe to security mailing lists for software you runLayer 5: Backups
Automate backups (see our backup guide)Test restores regularlyStore backups off-siteEncrypt backupsLayer 6: Monitoring
Monitor for unauthorized access (fail2ban logs)Monitor resource usage (Grafana/Prometheus)Monitor uptime (Uptime Kuma)Set up alerts for anomaliesLayer 7: Container Security
Run containers rootless (Podman)Use read-only filesystems where possibleLimit container capabilitiesDon't run as root inside containersUse specific image tags, not :latestSecurity is layers. No single measure is sufficient, but together they make your self-hosted infrastructure robust.