Essential security hardening for self-hosted WordPress on Ubuntu

ubuntulinuxsecuritywordpressapachehostingops

Hardening removes easy wins for attackers without making day-to-day ops painful. This guide covers firewall basics, Fail2ban, permissions, and why virtual patching matters when plugins lag behind fixes.

Firewall basics (UFW)

Fail2ban (abuse mitigation)

Permissions and filesystem hygiene

Virtual patching (important in 2026)

FAQ

Will UFW block my site?
No, if you allow 80 and 443 (and OpenSSH before enabling). Allow only what you need; deny by default is the goal.

What’s the first hardening step that doesn’t require new software?
Tighten permissions and ownership so the web user can’t write where it shouldn’t, and ensure wp-config.php isn’t web-readable.