Back to Article List

CrowdSec vs fail2ban: Which one should you run?

CrowdSec vs fail2ban: Which one should you run? - CrowdSec vs fail2ban: Which one should you run?

I installed fail2ban on my first VPS in 2013 and on every server I built for the next eleven years, mostly on muscle memory. In 2024 I moved my own boxes to CrowdSec and haven't regretted it, with one exception I'll get to. This comparison is written from that seat: someone who knows jail.local by heart and still respects fail2ban, yet thinks most servers in 2026 should be running the other thing.

The tools get lumped together because they share a reflex: count failures in the logs and ban the IP behind them. Underneath that they're built on opposite assumptions. fail2ban assumes your server defends itself with what it alone can see. CrowdSec assumes defense is a shared problem, and that an IP brute forcing someone else's box at 5 AM shouldn't get a fresh start on yours at 4. If you want the deeper tour of that model, my what is CrowdSec explainer covers the full architecture; here I'll stay on the comparison.

fail2ban jails vs CrowdSec scenarios

A fail2ban jail pairs a filter (a regex over log lines) with an action (usually an iptables command), all configured in INI files. It's a beautifully small design and it hasn't meaningfully changed since 2004, which is both a compliment and the problem. Development has slowed with it: the fail2ban repository is still maintained, but the last tagged release, 1.1.0, landed in April 2024. Over two years ago now.

CrowdSec splits the same job into stages. Parsers turn logs into events, YAML scenarios (mostly leaky buckets) detect behavior, a local API turns alerts into decisions and separate bouncers enforce them at the firewall, the web server, the CDN or wherever else an enforcement point makes sense. Detection rules come from a hub instead of your own regex, the engine shares confirmed attacks with the network and pulls back a curated community blocklist. Side by side:

fail2banCrowdSec
DetectionRegex filters per jailHub scenarios (YAML, behavior based)
EnforcementActions run local firewall commandsSeparate bouncers, local or remote
HTTP/WAF layerNone, log parsing onlyAppSec component: inline WAF with virtual patching
IP reputationNone, local knowledge onlyCommunity blocklist via CAPI
Multi-serverNothing built inOne LAPI, many bouncers
Default ban10 minutes4 hours
StackPython, GPLv2, v1.1.0 (Apr 2024)Go, MIT, v1.7.8 (May 2026)


That last row carries real information. fail2ban changes slowly because it's essentially finished, and it's been kept patched for years by a very small circle of maintainers. CrowdSec ships several engine releases a year with a company's payroll behind it, and its detection content updates weekly through the hub without any engine release at all. Which cadence you prefer depends on how you feel about relying on a venture-backed vendor, and I'll be straight about it: that dependency is the one strategic risk in the CrowdSec column. The MIT-licensed engine would survive the company. The network effect wouldn't.

Where CrowdSec wins

The community blocklist is the headline and it deserves to be. The week I switched my first box over, cscli metrics showed the majority of dropped traffic came from IPs the network already knew, addresses that fail2ban would have given three free SSH attempts each. fail2ban punishes attackers after they've tried you. CrowdSec mostly refuses them the first attempt, and CrowdSec's own "not your typical fail2ban clone" post made this argument back in 2022; four years of network growth later it holds up better, not worse.

The decoupled remediation matters more than it sounds. Detect on the web node, enforce on the iptables firewall bouncer of every box in the fleet, or push the ban into Cloudflare so the request never reaches you at all. And the observability gap is real: cscli alerts inspect shows you the exact log lines behind a ban, while with fail2ban I spent years reverse engineering bans out of fail2ban.log and grep. The console extends that view across machines, one timeline for the whole fleet, and fail2ban has no equivalent surface at all.

Scenario quality is the quieter win. Hub scenarios are maintained by people who watch the whole network's telemetry, so they catch slow brute force spread over hours, HTTP probing across many paths, credential stuffing and distributed scans that a per-jail regex simply can't express. My jail.local never grew those. It just accumulated the same six jails everyone copies from the same blog posts. The hub also keeps pace with what people deploy now, Traefik, Caddy, HAProxy and Nginx Proxy Manager all have collections, while fail2ban's stock filter directory still reads like a 2015 hosting stack.

And the category line moved with the AppSec component: enable it and the same engine is an IDS and a WAF at once. fail2ban only ever sees what a request left behind in a log, after the application already handled it. AppSec inspects the HTTP request on the way in and can block a known exploit before your app parses a byte of it, which is a different job from banning brute forcers and one fail2ban has never claimed to do. Comparing the two on log bans alone undersells half of what the engine does in 2026.

Throughput separates them too once volume climbs. fail2ban is a Python daemon running regexes in a single flow, which nobody notices on a personal box and everybody notices on a busy ingress. The Go engine parses in parallel, and CrowdSec cites production setups processing millions of log events an hour. That difference is invisible on four jails' worth of traffic. On a loaded reverse proxy it's the whole argument.

Remediation flexibility rounds out the list. fail2ban's action model tops out at running a firewall command, while a CrowdSec decision carries a type, so the same alert can produce a hard ban at the firewall or a captcha challenge at nginx depending on your profiles. On a shop or SaaS frontend that difference is money: a wrongly challenged human clicks through in five seconds, a wrongly dropped connection writes you an angry email.

Where fail2ban still wins

Zero external dependencies. fail2ban phones home to nobody, needs no account for anything and will never nudge you toward a console signup, which CrowdSec does do (mildly, but noticeably). Memory is smaller too; a Python daemon watching four jails undercuts the Go engine plus a bouncer, and on a 512 MB box that's not academic.

Packaging ubiquity counts too. fail2ban sits in every distro repo and every config management cookbook written since 2010, and when you inherit a legacy box it's usually already there, quietly doing its job. Ripping out working security to chase features is rarely the right call on someone else's server, and several client boxes in my care still run fail2ban for exactly that reason. Migration makes sense at reinstall time or when a fleet starts growing, and much less sense on a stable single machine that bothers nobody.

The mental model is also half the size and the install really is one line. Filter, action, jail, done. There's no LAPI to authenticate bouncers against and no hub versioning to track. When something breaks you read one log file. CrowdSec's extra moving parts are the price of its architecture, and you will meet the odd 403 between components; the CrowdSec troubleshooting cheat sheet exists because those errors repeat across installs. And decades of muscle memory count for something: half the sysadmins alive can write a failregex at gunpoint.

Threads like the r/selfhosted CrowdSec or fail2ban discussion from March 2025 land about where I do. The strongest argument in the fail2ban camp has little to do with features: people trust finished software they fully understand. That's a legitimate thing to value.

Honestly, I weigh the shared blocklist higher, because attacker infrastructure gets reused across millions of targets and local-only knowledge wastes that fact.

Migrating from fail2ban to CrowdSec

I've now done this migration on my own boxes and several client machines. It's an afternoon of work, most of which is deciding what your jails were actually protecting: an hour reading jail.local, an hour for install and collections and the rest for whitelists and watching alerts. (On a brand new server there's nothing to migrate at all: LumaDock's Ubuntu 24.04 + CrowdSec template, picked during ordering, boots with the engine and firewall bouncer already configured, and nginx and Apache variants exist too.)

Mapping common jails to collections

The standard jails all have direct equivalents. sshd maps to the crowdsecurity/sshd collection, which the install wizard picks automatically when it sees the service. nginx-http-auth and nginx-botsearch map to crowdsecurity/nginx plus crowdsecurity/base-http-scenarios, and the CrowdSec versions detect considerably more than the originals. Apache jails map to crowdsecurity/apache2 the same way. Postfix and Dovecot jails have their matching collections on the hub too.

recidive is the interesting one because there's no jail-shaped equivalent. Repeat-offender escalation lives in /etc/crowdsec/profiles.yaml, where you can extend ban durations for IPs that keep coming back, and in practice the community blocklist does most of that work for you, since a true recidivist is usually already on it. I ported my recidive logic in the first week, then noticed it almost never fired and deleted it.

Before trusting any mapping, replay your history against it. cscli explain takes a log file and shows which parsers matched and which scenarios would have fired:

sudo cscli explain --file /var/log/auth.log --type syslog

I ran that over a month of auth logs on the first migrated box and watched CrowdSec flag every IP my old sshd jail had banned, plus a handful of slow attackers it had missed entirely. Ten minutes, question settled. I'd call it the single most useful command of the whole migration.

Running both during the transition

Run them in parallel for a week or two, but stagger the roles. My approach: install CrowdSec without any bouncer first (detection only, instructions in the CrowdSec Debian install guide apply to Ubuntu too), leave fail2ban enforcing, then compare cscli alerts list against fail2ban's bans each morning. Once the alert stream looks sane, add the bouncer and stop fail2ban the same day.

Don't leave both enforcing long-term. Two daemons writing firewall rules makes "why is this IP blocked" a genuinely annoying question, and there's a subtler failure: when fail2ban bans an IP at three failures, CrowdSec's five-failure bucket never fills, so the attack never becomes a signal and never reaches the network. You end up feeding neither system well. Whitelist your own IPs in both tools before touching anything; the safe rollout guide is the order of operations I wish I'd followed the first time.

When cutover day arrives, the switch itself is two commands:

sudo systemctl disable --now fail2ban
sudo systemctl status crowdsec crowdsec-firewall-bouncer

fail2ban flushes its own iptables chains on stop, so there's no rule cleanup to chase. Keep the package and its config around for a month in case you want to diff behavior, then purge it.

The one thing I still miss

Honest gripe time. A client had an odd little Python app writing its own auth log in its own format, and in the fail2ban era I'd have protected it in ten minutes: one failregex in a filter file plus a jail stanza, then reload. In CrowdSec that job means writing a parser and a scenario, YAML files with grok patterns and bucket logic that no wizard generates for you. That first pair of files has a genuine learning curve.

Mine cost me most of an evening, the second custom scenario took twenty minutes, and I now prefer the format to regex, but a busy admin who just wants one odd app protected won't enjoy hearing "learn grok first". That client box kept fail2ban for exactly this reason and I didn't argue.

Verdict by use case

A single personal box with only SSH exposed: fail2ban is fine, with one 2026 caveat. Password auth on public SSH shouldn't exist anymore, and once you're key-only the classic brute force problem is mostly log noise rather than risk. At that point either tool is sweeping the porch, so pick on effort: fail2ban if it's already there, CrowdSec if you'd rather the noise also feed the shared blocklist. The moment that box grows a web app, the calculus flips and the WAF layer starts to matter.

A small fleet: CrowdSec, and the architecture matters more than the blocklist here. One LAPI with every bouncer enforcing the merged decision list means an attacker caught on the web node is banned on the mail server seconds later. fail2ban has no answer to fleet-wide state and after twenty years I don't expect one.

Public web apps: CrowdSec without much hesitation. The community blocklist refuses the background scanning before your app sees it, and hub scenarios express the distributed probing a per-jail regex can't. Add the AppSec WAF component on nginx and you get virtual patching for fresh CVEs on top, which is territory fail2ban never entered.

Air-gapped or restricted networks: fail2ban wins, and it isn't close. Cut off from CAPI, CrowdSec turns into a heavier fail2ban with YAML, so the lighter tool with zero external dependencies is the honest choice.

One caveat spans every pro-CrowdSec verdict above: you're taking a bet on a vendor. The MIT license protects the engine and nothing protects the network, which is run by a company that has to keep existing. I flagged that earlier and it belongs in the verdict too, because fail2ban asks you to bet on nothing beyond a handful of maintainers with two decades of momentum.

My working default in 2026 is simple. New server, CrowdSec. Inherited stable box where fail2ban is quietly doing its job, leave it until the next rebuild. And if you're genuinely torn, replay last month's auth log through cscli explain before deciding; the list of attackers each tool would have caught is better evidence than anything I've written here.

Your idea deserves better hosting

24/7 support 30-day money-back guarantee Cancel anytime
Billing Cycle

VPS.S1

$5.99 Save  17 %
$4.99 Monthly
  • 2 vCPU AMD EPYC
  • 2 GB RAMMEMORY
  • 30 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included

VPS.S3

$14.99 Save  33 %
$9.99 Monthly
  • 4 vCPU AMD EPYC
  • 6 GB RAMMEMORY
  • 70 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included

EPYC VPS.P1

$8.99 Save  22 %
$6.99 Monthly
  • 2 vCPU AMD EPYC
  • 4 GB RAMMEMORY
  • 40 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P2

$16.99 Save  24 %
$12.99 Monthly
  • 2 vCPU AMD EPYC
  • 8 GB RAMMEMORY
  • 80 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P4

$29.99 Save  23 %
$22.99 Monthly
  • 4 vCPU AMD EPYC
  • 16 GB RAMMEMORY
  • 160 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P5

$39.99 Save  25 %
$29.99 Monthly
  • 8 vCPU AMD EPYC
  • 16 GB RAMMEMORY
  • 180 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P6

$59.99 Save  25 %
$44.99 Monthly
  • 8 vCPU AMD EPYC
  • 32 GB RAMMEMORY
  • 200 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

EPYC VPS.P7

$69.99 Save  29 %
$49.99 Monthly
  • 16 vCPU AMD EPYC
  • 32 GB RAMMEMORY
  • 240 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G2

$24.99 Save  20 %
$19.99 Monthly
  • 2 vCPUAMD EPYC Genoa 4th generation 9xx4 with 3.25 GHz or similar, on Zen 4 architecture. AMD EPYC G4
  • 4 GB DDR5MEMORY
  • 50 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G4

$44.99 Save  22 %
$34.99 Monthly
  • 4 vCPUAMD EPYC processor with dedicated vCPU cores, on enterprise server hardware. AMD EPYC G4
  • 8 GB DDR5MEMORY
  • 100 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G6

$89.99 Save  22 %
$69.99 Monthly
  • 8 vCPUAMD EPYC processor with dedicated vCPU cores, on enterprise server hardware. AMD EPYC G4
  • 16 GB DDR5MEMORY
  • 200 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

Genoa VPS.G7

$159.99 Save  22 %
$124.99 Monthly
  • 8 vCPUAMD EPYC processor with dedicated vCPU cores, on enterprise server hardware. AMD EPYC G4
  • 32 GB DDR5MEMORY
  • 250 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6IPv6 is currently unavailable in France, Finland or the Netherlands. included
  • Free auto backupsIncludes one backup slot you can set to run daily, weekly or monthly.

AMD Ryzen VPS.R1

$16.99 Save  18 %
$13.99 Monthly
  • 1 dedicated CPU AMD Ryzen 9 7950X with 4.5 GHz or similar, on Zen 4 architecture. vCPU
  • 4 GB DDR5MEMORY
  • 50 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6 included IPv6 support is currently unavailable in France, Finland or the Netherlands.
  • Auto backup included

AMD Ryzen VPS.R2

$29.99 Save  17 %
$24.99 Monthly
  • 2 dedicated CPUs AMD Ryzen 9 7950X with 4.5 GHz or similar, on Zen 4 architecture. vCPU
  • 8 GB DDR5MEMORY
  • 100 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6 included IPv6 support is currently unavailable in France, Finland or the Netherlands.
  • Auto backup included

AMD Ryzen VPS.R4

$109.99 Save  18 %
$89.99 Monthly
  • 8 dedicated CPUs AMD Ryzen 9 7950X with 4.5 GHz or similar, on Zen 4 architecture. vCPU
  • 32 GB DDR5MEMORY
  • 400 GB NVMeSTORAGE
  • Unmetered bandwidth
  • IPv4 & IPv6 included IPv6 support is currently unavailable in France, Finland or the Netherlands.
  • Auto backup included

Q & A

Can I keep running both tools permanently?

Enforcing side by side, no. Two daemons writing firewall rules turns every "why is this IP blocked" into archaeology, and early bans from one starve the other's scenarios of the failures they count. A split by role does work long term: the client box from my gripe above runs fail2ban for one legacy app and CrowdSec for everything else, and it's been stable for over a year.

GPU products are in high demand at the moment. Fill the form to get notified as soon as your preferred GPU server is back in stock.