Home Server Security Basics: A Practical Hardening Checklist
A home server holds things you care about (family photos, documents, your smart-home controls), and once it’s connected to the internet, it’s scanned constantly by automated tools that don’t care whose server it is. CISA’s home network guidance makes the point directly: most attacks aren’t personal, and devices aren’t secure enough straight out of the box.
The good news is that home server security for a typical self-hoster is mostly about getting a short list of fundamentals right. This guide covers them in order of impact, with commands for Debian and Ubuntu-based servers checked against official documentation as of December 2026, and ends with a checklist you can work through in an afternoon.
Start with what’s reachable: your attack surface
NIST’s Guide to General Server Security (SP 800-123) frames server hardening around two ideas: fix known weaknesses (patching) and offer only the functionality each user actually needs (least privilege). Every open port and running service is something that must be patched and defended.
So the first exercise is an inventory. On the server, list what’s listening:
sudo ss -tulpn
Then check your router for port forwards and UPnP mappings. For every entry, ask: does anyone outside my home need this? CISA recommends removing unnecessary services and changing factory-default settings and credentials. A service you turn off can’t be exploited.
Rule 1: Keep admin interfaces off the internet
This is the single most important rule. Admin panels are high-value targets because one bug or weak password gives full control.
Never expose these directly: the Proxmox web UI (port 8006), TrueNAS or other NAS interfaces, router admin pages, the Docker API, Portainer, the Nginx Proxy Manager admin port, the Traefik dashboard, databases and SSH with password login.
Instead, reach them over a VPN. WireGuard or a mesh VPN like Tailscale lets your phone or laptop join your home network securely, so nothing administrative needs a public port. See our Tailscale vs WireGuard comparison for how to choose.
For services that genuinely must be public, such as a photo-sharing link for relatives, put them behind a reverse proxy with TLS and authentication. Our reverse proxy guide compares Caddy, Nginx Proxy Manager and Traefik and covers the safe defaults.
Rule 2: Use a firewall, and know Docker’s exception
CISA recommends a firewall at the boundary of your home network, which your router usually provides, and explains that firewalls can block traffic by address, application or port. Add a host firewall on the server too, so a misconfigured router or a compromised device on your LAN has less to reach.
On Ubuntu, ufw is the standard front end. A minimal policy that allows SSH only from your LAN (adjust the subnet to yours):
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow proto tcp from 192.168.1.0/24 to any port 22
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status verbose
Only add the 443/tcp rule if you run a public reverse proxy. Add the SSH rule before enabling the firewall if you’re connected remotely, or you’ll lock yourself out.
-p 127.0.0.1:8080:80 or "127.0.0.1:8080:80" in Compose, or don't publish them at all and route through a reverse proxy on a shared Docker network.Docker also notes that in releases older than 28.0.0, hosts on the same network segment could reach ports published to localhost, which is one more reason to keep Docker updated.
On Proxmox VE, use its built-in firewall at the datacenter or node level. Proxmox’s firewall documentation says remote administration needs rules allowing the web GUI on port 8006 and possibly SSH on port 22; restrict those rules to your admin network or VPN subnet rather than allowing them from anywhere.
Rule 3: Patch automatically
CISA calls regular software updates one of the most effective steps you can take. On Ubuntu Server, the unattended-upgrades package is installed by default and applies security updates automatically; Ubuntu’s documentation says security updates are enabled right after installation, and that the file /etc/apt/apt.conf.d/20auto-upgrades controls whether it runs and how often. If the package is missing, install it and confirm that file contains both settings with a value of 1 (daily):
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
Install the package with sudo apt install unattended-upgrades, and check /var/log/unattended-upgrades occasionally to see what it applied.
Operating system updates aren’t the whole story on a home server:
- Containers. Images don’t update themselves. Pin versions in your Compose files, check release notes, then pull and recreate on a schedule (weekly or monthly).
- Hypervisor and NAS. Proxmox and TrueNAS updates are applied through their own update tools; read release notes before major versions.
- Router and device firmware. Check for updates or enable automatic firmware updates where offered.
Rule 4: SSH with keys only
Password logins over SSH are the most brute-forced service on the internet. Switch to key-based authentication.
On your laptop, generate a key and copy the public half to the server:
ssh-keygen -t ed25519
ssh-copy-id user@server.lan
Confirm you can log in with the key, then disable passwords. In /etc/ssh/sshd_config (or a file in /etc/ssh/sshd_config.d/), set:
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no
The OpenSSH manual notes two things worth knowing here. The default for PasswordAuthentication is yes, so you must change it explicitly. And for each keyword, the first obtained value is used, so an earlier drop-in file in sshd_config.d can override what you set in the main file. Check the result, then restart while keeping your current session open:
sudo sshd -t
sudo systemctl restart ssh
sshd -t is test mode: it checks the configuration file before you apply it. Open a second terminal and confirm you can still log in before closing the first.
Rule 5: Ban repeat offenders with fail2ban or CrowdSec
If anything on your server is publicly reachable, add automated blocking.
| Feature | fail2ban | CrowdSec |
|---|---|---|
| How it detects | Scans log files such as /var/log/auth.log for repeated failures |
Behaviour-based detection from log processors, plus optional AppSec rules |
| How it blocks | Updates firewall rules to reject the offending IP for a set time | Remediation components (“bouncers”) at the firewall, proxy or app level |
| Shared intelligence | No, purely local | Optional: share detected attacks and receive a curated blocklist |
| Good for | Simple SSH and web-login protection | Multiple services, reverse proxies, community blocklists |
Both are reasonable. Remember that they reduce noise and slow attackers down; they don’t make an exposed admin panel safe.
Rule 6: Accounts, passwords and least privilege
- Change every default credential. CISA warns that default administrator passwords are often published online or printed on the device.
- Use unique, strong passwords stored in a password manager, and enable two-factor authentication wherever the app supports it (Proxmox, TrueNAS, Home Assistant and most reverse-proxy SSO tools do).
- Run daily tasks as a normal user and use
sudoonly when needed. NIST describes least privilege as granting each user or process only the rights required for its job, which limits damage if one is compromised. - Be careful with the Docker group. Docker’s security documentation says only trusted users should be allowed to control the Docker daemon, because anyone who controls it can mount the host’s root filesystem into a container and change it without restriction. Treat membership in the
dockergroup accordingly. - Segment risky devices. Put cheap IoT gadgets on a guest or separate network so a compromised camera can’t reach your server’s admin ports.
Rule 7: Backups you’ve actually restored
Security incidents, ransomware included, are often survivable only because of backups. Follow the 3-2-1 backup rule: three copies, two media, one offsite, with at least one copy the server itself can’t delete. Test restores regularly; a backup you haven’t restored is an assumption.
Home server security checklist
- Inventory listening ports (
ss -tulpn) and router port forwards; remove anything unneeded. - Disable UPnP on the router unless a specific device needs it.
- No admin interfaces (Proxmox, NAS, router, Docker tools, proxy dashboards) reachable from the internet.
- VPN set up for remote administration.
- Public services only behind a reverse proxy with TLS and authentication.
- Host firewall enabled; Docker admin ports bound to 127.0.0.1.
- Automatic security updates on; container and firmware updates scheduled.
- SSH keys only, root login disabled, config tested with
sshd -t. - fail2ban or CrowdSec in front of anything public.
- Default credentials changed; password manager and 2FA in use.
- 3-2-1 backups in place, with a restore tested in the last month.
If you’re still planning your build, our guide on how to set up a home server shows where these steps fit, and the networking section has more on VPNs, DNS and remote access.
Frequently asked questions
Is it safe to port-forward my home server?
Forwarding 80/443 to a well-maintained reverse proxy with TLS and authentication is a common, manageable risk. Forwarding admin panels, SSH with passwords, databases or NAS interfaces is not. If only you use a service, a VPN is safer than any port forward.
Do I need antivirus on a Linux home server?
CISA's home network guidance recommends antivirus on computers and mobile devices and notes signature-based tools can't stop new threats. On a Linux server, patching, minimal services, a firewall and backups give more protection; antivirus scanning is most useful on file shares used by Windows clients.
Should I use fail2ban or CrowdSec?
fail2ban is simple and local: it scans logs and bans IPs that fail too many logins. CrowdSec adds behaviour-based detection and shared blocklists from its community. Either is fine for a home server; neither replaces key-only SSH or keeping admin UIs private.
Why doesn't ufw block my Docker container's port?
Docker routes published container traffic in the nat table before it reaches the chains ufw uses, so ufw rules are effectively ignored, per Docker's documentation. Publish ports on 127.0.0.1 or keep containers on internal networks behind a reverse proxy.
Sources
- Home Network Security: CISA
- Understanding Firewalls for Home and Small Office Use: CISA
- Guide to General Server Security (SP 800-123): NIST
- Packet filtering and firewalls: Docker
- Port publishing and mapping: Docker
- Firewalls: Ubuntu Server documentation
- Automatic updates: Ubuntu Server documentation
- Proxmox VE Firewall: Proxmox Server Solutions
- Docker Engine security: Docker
- sshd_config(5): OpenBSD manual pages
- fail2ban (GitHub repository): Fail2Ban project
- Security Engine: introduction: CrowdSec
We research every guide from manufacturer documentation, government and standards bodies, and other primary sources, which are cited at the end of each article. We do not accept payment for coverage. Read our editorial policy to see how articles are researched, fact-checked and updated, or tell us if something is out of date.