LibrePortal
Sponsor
Install

CrowdSec

Intrusion Prevention

CrowdSec watches your server for people trying to break in, like password-guessing on SSH, and blocks them at the firewall. It also shares a blocklist of known attackers with thousands of other servers, so many are turned away before they try.

On this page
  1. At a glance
  2. What it's good for
  3. What the install sets up
  4. The community blocklist, and what it shares
  5. CrowdSec's online console
  6. Checking on it, and unbanning someone
  7. The Traefik bouncer key
  8. Good to know
  9. Settings
  10. In its config file
  11. Tools
  12. Works with
  13. Privacy and security
  14. What leaves this server
  15. What LibrePortal turns off
  16. Sources
  17. Under the hood

Good to know before you install

By default this shares the IP addresses and attack types it blocks with CrowdSec, which is what gets you its community blocklist; turning the community blocklist off stops all sharing but then only attacks seen on this server are blocked

At a glance#

What it is
Intrusion Prevention Security
Where it opens
Nothing to open It runs on the server itself, not in a container
Updates
Automatic A backup is taken first, and it rolls back if the update fails
Backups
Included Part of the daily backup when that's switched on
Copies
One per server

What it's good for#

Put any server on the internet and within minutes something starts trying passwords on it. CrowdSec reads your server's logs, spots patterns like "fifty failed SSH logins from one address", and bans that address at the firewall for a while. It's the modern cousin of fail2ban.

The other half is the community blocklist. Every CrowdSec server that takes part reports the attackers it sees, and in return gets a list of addresses that are attacking lots of servers right now. Yours can block those before they've knocked once.

If your server is only on your home network and never reachable from outside, CrowdSec has little to do. It earns its place as soon as anything is open to the internet, which is why the setup wizard suggests it with Traefik.

What the install sets up#

CrowdSec isn't a container. It's installed on the server itself from CrowdSec's own package repository, as two services:

  • the agent, which reads the logs and decides who to ban. LibrePortal gives it CrowdSec's standard Linux and SSH detections.
  • the firewall bouncer, which turns those decisions into firewall rules, so a banned address can't reach anything on the server at all.

If Traefik is installed, LibrePortal also puts a CrowdSec check in front of every app Traefik serves, so banned addresses get turned away at the web level too. Devices on your own network (addresses like 192.168.1.x) are never blocked there.

There's no web page and no login. You see it through its page in LibrePortal: the Services tab shows whether both services are running, and the Logs tab shows what they've been doing. The first install downloads CrowdSec's detection rules and location database, so allow a few minutes.

What it watches, and what it doesn't

The detections LibrePortal installs cover SSH and the system itself. CrowdSec doesn't read your apps' web logs yet, so it won't spot someone probing a web app for weaknesses on its own. Addresses from the community blocklist are still turned away from your apps, because that list doesn't depend on what your server has seen. To check: confirm whether Traefik access logs will be fed to CrowdSec (no acquisition or traefik collection is set up today); the catalogue description says it spots web exploits

The community blocklist, and what it shares#

Community blocklist (CAPI) is on to start with. It's a fair trade, and worth knowing about: in return for the list, your server sends CrowdSec anonymous reports of the attacks it sees, meaning the attacking address, what it tried and when. Nothing about you, your apps or your users goes with it. The install's last line says which way it's set.

If you'd rather not share anything, switch it off before you install, for example with sudo -u libreportal libreportal app install crowdsec 'CFG_CROWDSEC_COMMUNITY_BLOCKLIST=false'. Bear in mind that CrowdSec is ticked in the setup wizard's recommended apps, and installed from there it has the list on. At the moment the setting is only applied during the first install; changing it afterwards does nothing until CrowdSec is removed and installed again.

To check: CrowdSec's COMMUNITY_BLOCKLIST / CONSOLE_ENROLL / CONSOLE_TOKEN are only acted on in the first-install branch of crowdsec_install_host.sh; update if they're applied on later config changes

CrowdSec's online console#

CrowdSec also runs a free website, app.crowdsec.net, where you can see your server's alerts on a dashboard. That's separate from the blocklist and off unless you ask for it. To join, make an account there, copy the enrolment key it gives you, and run on the server:

sudo cscli console enroll <your key>

Then accept the server on the website.

Checking on it, and unbanning someone#

CrowdSec's own cscli command is the way in. A few useful ones, run on the server:

sudo cscli decisions list
sudo cscli alerts list
sudo cscli decisions delete --ip 203.0.113.7

The first shows who is banned right now and for how long, the second what CrowdSec has spotted, and the third lifts a ban, which is the one you'll want if you lock yourself out from a hotel by getting your SSH password wrong too often. Bans end on their own after a few hours anyway.

The Traefik bouncer key#

Traefik checks each visitor with CrowdSec using a key that LibrePortal creates at install and keeps in a file only Traefik reads. If you think that key has leaked, or Traefik's CrowdSec check has stopped working, run Rotate Traefik Bouncer Key on the Tools tab. It issues a new key and restarts Traefik to load it, so your web apps blink for a few seconds while that happens.

Good to know#

  • It works alongside the server's firewall. CrowdSec's rules need to run before UFW's, or a connection UFW has already let in never reaches the ban. The install checks the order and says if it's wrong, with the fix.
  • Switching it off without removing it is one setting, applied with a reinstall: sudo -u libreportal libreportal app install crowdsec 'CFG_CROWDSEC_ENABLED=false'. Both services stop but CrowdSec stays installed, so setting it back to true is quick. To remove it completely, uninstall it from its page or run sudo -u libreportal libreportal app uninstall crowdsec.
  • Updates come as system packages. CrowdSec is installed from its own package repository, so a normal sudo apt upgrade on the server updates it along with everything else. LibrePortal's own updater leaves it alone, even though its page says Automatic: there's no container for it to check, so keep the server's packages up to date.
  • One per server. One agent watching the whole machine is the point.
  • Grafana dashboards come with it if you run Prometheus and Grafana and turn on its monitoring setting.

Settings#

In its config file#

CrowdSec's own settings aren't on the Config tab yet. They live in the app's config file, described here so you know they exist. How to change them.

SettingWhat it doesStarts as
Name
CFG_CROWDSEC_DISPLAY_NAME
What this app is called on your dashboards. Leave empty to use its usual name Empty
Show on the LibrePortal Dashboard
CFG_CROWDSEC_SHOW_ON_DASHBOARD
Whether this app gets a shortcut on the front page of the LibrePortal WebUI, separate from any Dashy dashboard
Choices: true, false
false

Tools#

CrowdSec's Tools tab has 1 button for jobs you'd otherwise need a terminal for. Each one runs as a task, so you can watch it on the Tasks page and read what it did. More about Tools.

Rotate Traefik Bouncer Key

Issue a new API key for the Traefik bouncer and restart Traefik to load it. Use this if the key is lost or may have been exposed. Traefik briefly rejects bouncer checks while it restarts.

Works with#

These are the other apps CrowdSec knows how to work with. Once it's installed, its page shows the same list with whether each one is connected. How this works.

  • Grafana: Shows dashboards for the apps that have one. works with every app
  • Prometheus: Collects metrics from the apps that can export them. works with every app
  • Uptime Kuma: Watches your apps and shows when one goes down. works with every app

Privacy and security#

Worth knowing CrowdSec blocks attackers by IP. In return for its shared blocklist it shares the address, type and time of each attack it blocks with CrowdSec; nothing about your own users.

What leaves this server#

  • Attacker IP, attack type and time go to CrowdSec while the Community blocklist setting is on (the default); off also stops the shared blocklist
  • Parser and scenario updates are pulled from CrowdSec's hub

What LibrePortal turns off#

Nothing needed switching off.

Licence: MIT. Audited: 21 October 2026. See the privacy of every app and the Promise.

Sources#

Under the hood#

  • It's installed on the server itself rather than in a container.
  • Its own project and documentation: www.crowdsec.net

Ports, settings, tools and connections on this page are read from LibrePortal v0.10.97's app catalogue each time the guide is built.

Next steps