Every VPS with SSH open to the internet gets probed. Within hours of putting a fresh server online, the auth log fills with login attempts from bots trying common usernames and weak passwords. The question is not whether to block them, but which tool to use. This crowdsec vs fail2ban comparison looks at both from the point of view of a small VPS owner: how much RAM they use, how hard they are to set up, and how well they actually stop the noise.
Both tools read your logs and ban IP addresses that misbehave. The difference is what happens after the ban. Fail2ban works alone on your server. CrowdSec adds a shared layer: when your server spots an attacker, it can warn other servers, and it learns from attacks other people have already seen.
CrowdSec vs Fail2ban: how they work
Fail2ban watches a log file, matches lines against a pattern, and runs a firewall rule when an IP crosses a threshold. The classic setup is an SSH jail: five failed logins in ten minutes, and the IP is blocked for an hour. It is a small Python daemon with no database and no network calls. The fail2ban setup guide for protecting SSH against brute-force attacks walks through the basic install, and the approach has barely changed in years because it does not need to.
CrowdSec splits the job into pieces. An agent parses logs and detects attacks, a local API stores decisions, and a bouncer applies them to the firewall. On top of that, a console can share your signals with a community blocklist, so your server can block IPs that attacked someone else an hour ago. That shared intelligence is the main selling point, and also the main source of extra moving parts.
Neither tool replaces the basics. Key-only SSH login still matters more than either one, and the guide to hardening SSH on Ubuntu 24.04 with key-only login and fail2ban covers the combination that stops most brute-force attempts before any ban tool gets involved.
Resource use on a 1–2 GB VPS
On a small VPS, memory is the first constraint. Fail2ban is light: a single daemon that typically uses tens of megabytes of RAM and almost no CPU when idle. It wakes up when log lines arrive, matches a few regular expressions, and goes quiet again. On a 1 GB server running WordPress and MySQL, you will not notice it.
CrowdSec is heavier. The agent, the local API, and the bouncer are separate processes, and the local API keeps its decisions in a database. On a 2 GB server this is fine. On a 1 GB server that is already tight, the extra 100–200 MB of RAM is real money in the sense that it is memory your database or PHP workers cannot use. If your server already swaps under load, adding CrowdSec before fixing the memory pressure is the wrong order of operations.
The honest rule: if RAM is your scarcest resource, Fail2ban wins. If you have 2 GB or more and the database is comfortable, CrowdSec’s extra footprint is affordable.
Setup effort: what installing each one looks like
Fail2ban installs from the Ubuntu repositories with one package and one config file. You copy the default jail file, enable the SSH jail, set a ban time, and restart the service. The whole job takes about ten minutes, and most of the time goes to reading the config comments. The walkthrough for installing and configuring fail2ban for SSH and Nginx on Ubuntu covers the exact commands, including the Nginx jail for web login pages.
CrowdSec takes longer. You add the vendor repository, install the agent, install a bouncer for your firewall, and enrol the instance. Then you pick collections for the services you run: SSH, Nginx, WordPress, and so on. Each collection is a bundle of parsers and scenarios, which is convenient, but it means you need to understand what each collection watches before you trust it. Expect 30–60 minutes for a first install, plus time to read the decisions it makes during the first day.
Upgrades differ too. Fail2ban updates through apt like any other package, and its config format has stayed stable. CrowdSec updates through its own repository, and major versions have changed the bouncer setup before, so upgrades deserve a few minutes of attention rather than a blind apt upgrade.
Blocking power: local bans vs shared intelligence
Fail2ban only knows what it has seen on your server. An attacker who tries your SSH port five times gets banned, then moves on to the next server. If that attacker comes back from a different IP the next day, Fail2ban has to learn the lesson again. This is fine for SSH, where the attack pattern is repetitive and the ban threshold is easy to tune.
CrowdSec’s crowdsec community blocklist changes the timing. Your server downloads lists of IPs that other CrowdSec users have reported, so an attacker that hammered a server in another country yesterday can be blocked at your firewall before it ever tries a password. In practice this cuts down the volume of log noise a lot, because the same botnets scan the whole internet in waves.
There is a trade-off. A shared list can include an IP you actually want to allow, for example a shared office NAT or a VPN exit node that one aggressive reporter flagged. CrowdSec lets you whitelist your own IPs, and you should do that before enabling the community blocklist. Fail2ban has no version of this problem because it never bans an IP it has not seen attack you directly.
For WordPress sites, both tools can protect the login page, but neither is a full WordPress security plugin. If your login page is the main target, read the guide to stopping WordPress brute-force attacks with fail2ban and strong passwords first; it covers the fail2ban jail for wp-login.php, which is usually the quickest win.
CrowdSec vs Fail2ban side by side
| Fail2ban | CrowdSec | |
|---|---|---|
| Memory use | Very low, one small daemon | Moderate, several processes plus a local database |
| Setup time | About 10 minutes from the Ubuntu repos | 30–60 minutes, plus picking collections |
| How it bans | Only IPs it has seen attack your server | Your own detections plus the shared community blocklist |
| Services covered | Any log file, configured jail by jail | Collections per service, including SSH, Nginx, WordPress |
| False positives | Rare, only your own traffic triggers a ban | Possible from shared lists, needs whitelisting |
| Best for | 1 GB VPS, SSH-only protection, set and forget | 2 GB+ VPS, several public services, heavy scanning |
Which VPS brute force protection fits your server?
Pick Fail2ban if your server is small, your main worry is SSH, and you want something you can install and mostly forget. It is the right answer for most single-site WordPress servers and for any server where RAM is tight. Pair it with key-only SSH login and a fail2ban ssh jail for the services you actually expose, and you have covered the realistic threat: automated bots guessing passwords.
Pick CrowdSec if you run several public services, you see constant scanning across SSH and the web server, and you have the RAM to spare. The shared blocklist earns its keep when the same botnet hits your ports day after day, because your server starts the day already knowing the worst offenders. It also fits if you manage more than one server, since the same decisions can be shared across your own machines.
There is a middle path. Run Fail2ban for SSH and add Nginx rate limiting for the web layer, which blocks the same kind of abuse without a second daemon. The guide to rate limiting Nginx to stop brute-force and scraping bots shows how to do that with a few lines of config.
Running either one well
Whichever tool you choose, three habits keep it useful. First, check the bans regularly in the first week. A new jail or a new collection can catch legitimate traffic, and the first week is when you find out. Second, keep a whitelist of your own IPs, your office, and any monitoring service that hits your server. Third, watch your logs, not just the ban count. Learn what a normal auth log looks like, so a real intrusion stands out instead of blending into the daily bot noise.
A ban tool is a filter, not a fix. It buys you quiet logs and fewer wasted login attempts. The security that actually keeps a server safe is still key-only SSH, updated software, and backups you have tested. Pick the tool that fits your server’s size and your patience for maintenance, set it up properly, and spend the time you save on the things that matter more.