# How to install and activate crowdsec in pangolin

**URL:** <https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437>\
**Category:** Guides & Tutorials\
**Tags:** pangolin, crowdsec\
**Created:** [August 6, 2025, 9:58am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437 "2025-08-06T09:58:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Runningman](https://forum.hhf.technology/user_avatar/forum.hhf.technology/runningman/32/2977_2.png) [@Runningman](https://forum.hhf.technology/u/Runningman)\
**Post date:** [August 6, 2025, 9:58am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/1 "2025-08-06T09:58:47Z")

</div>

# How to install and active crowdsec in pangolin

## Prerequisits: Succesful installation of pangolin + DNS entries

### Domain and DNS entries:

For beginners: You should own a fresh domain name with no other A records than these 2, pointing to your VPS IP (example):

 ![pangolin-DNS](https://forum-cdn.hhf.technology/original/2X/8/8e91d60a8cf7a05e4565de3b51ebaa5fe0cc5e5e.png)

### Succesful installation of pangolin

- You should already have pangolin installed as written in the [Docs](https://docs.digpangolin.com/self-host/quick-install).

- And you should have gotten this message at the end of installation, like this:

_Installation complete!_

_To complete the initial setup, please visit:_

_[https://pangolin.geekgully.de/auth/initial-setup](https://pangolin.geekgully.de/auth/initial-setup)_

_Diesen Link aufrufen und admin account anlegen!_

### Web-Interface of pangolin

You sould have visited the Web-Interface of your pangolin instance at least once, you should have setup the organisation already. No need to have a site yet.

## Installation of crowdsec

### Installation procedures

Start the installer of pangolin again like this:

`sudo ./installer`

You should see the following text:

_Welcome to the Pangolin installer!_

_This installer will help you set up Pangolin on your server._

_Please make sure you have the following prerequisites:_

- _Open TCP ports 80 and 443 and UDP ports 51820 and 21820 on your VPS and firewall._
- _Point your domain to the VPS IP with A records._

_[http://docs.fossorial.io/Getting%20Started/dns-networking](http://docs.fossorial.io/Getting%20Started/dns-networking)_

_Lets get started!_

_Would you like to run Pangolin as Docker or Podman containers? (default: docker):_

**Here you respond with ENTER**

You receive this text now:

_Looks like you already installed, so I am going to do the setup…_

_=== CrowdSec Install === Would you like to install CrowdSec? (yes/no) (default: no):_

**Respond with YES**

Next:

_This installer constitutes a minimal viable CrowdSec deployment. CrowdSec will add extra complexity to your Pangolin installation and may not work to the best of its abilities out of the box. Users are expected to implement configuration adjustments on their own to achieve the best security posture. Consult the CrowdSec documentation for detailed configuration instructions. Are you willing to manage CrowdSec? (yes/no) (default: no):_

**Respond with YES**

Next:

_Detected values: Dashboard Domain: [pangolin.geekgully.de](http://pangolin.geekgully.de) Let’s Encrypt Email: [mail@geekgully.de](mailto:sh@neticens.de) Badger Version: v1.2.0 Are these values correct? (yes/no) (default: yes):_

**Respond with YES if it’s correct**

Next:

_Installation complete!_

_To complete the initial setup, please visit:_

_[https://pangolin.geekgully.de/auth/initial-setup](https://pangolin.geekgully.de/auth/initial-setup)_

Now crowdsec is installed, congratulations!

### crowdsec acitivation:

Execut these two commands now to activate crowdsec:

`docker compose down`

`docker compose up -d`

### Is all working correctly?

To see if crowdsec is working correctly, send this command:

`docker exec crowdsec cscli bouncers list`

When you see a text output like this, all is working well:

```auto
---------------------------------------------------------------------------------------------------------------
 Name IP Address Valid Last API pull Type Version Auth Type
---------------------------------------------------------------------------------------------------------------
 traefik-bouncer 172.18.0.4 ✔ 2025-08-05T13:55:54Z Crowdsec-Bouncer-Traefik-Plugin 1.X.X api-key
---------------------------------------------------------------------------------------------------------------

```

## Crowdsec dashboard

If you already have a login to the [crowdsec dashboard](https://www.crowdsec.net/), you can add this crowdsec instance to the dashboard. If not, use the link to register first.

### Add pangolin to your crowdsec dashboard

#### Show enrollment key

Klick in your crowdsec dashboard on the button _“Enroll command”_, you will see a window with a command like this:

```auto
sudo cscli console enroll -e context <MyEnrollemtKey>

```

Copy the part at the end, after “context”, which is marked **MyEnrollmentKey**

#### Enroll command

Now execute the following command in your ssh console on the VPS to add your pangolin instance with crowdsec to your dasboard, add the Key to the end of the command:

`docker exec crowdsec cscli console enroll <MyEnrollmentKey>`

#### crowdsec Dashboard

Switch to your crowdsec dashboard now, you will see a popup like this after a view moments:

 ![pangolin-enrollment](https://forum-cdn.hhf.technology/original/2X/0/0317003de2fc4041e9a1fff2051cd33d086b38e3.png)

**Klick to accept it.**

After a view seconds, you see your pangolin instance in the corwsec dashboard, like this:

 ![pangolin-dashboard](https://forum-cdn.hhf.technology/original/2X/e/e1c0906d0676c0655d37f316bc6257f51a4d61b0.png)

## Now you’re set and ready!

You have your pangolin instance with crowdsec added to the dashbord and you can watch which treads for your pangolin instance arise.

_Note at the end:_

_@hhf.technoloy created a traefik dashboard to visualize what happends in you pangolin instance, I will write a guide for it later._

---

<div class="post-metadata">

**Author:** ![hexagram1959](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/h/9d8465/32.png) [@hexagram1959](https://forum.hhf.technology/u/hexagram1959)\
**Post date:** [August 8, 2025, 9:18am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/2 "2025-08-08T09:18:28Z")

</div>

Is it normal that I have 3 bouncers?

 ![image](https://forum-cdn.hhf.technology/original/2X/2/2639934fa92925800d8ec9bec158f65d416642c8.png)

---

<div class="post-metadata">

**Author:** ![Runningman](https://forum.hhf.technology/user_avatar/forum.hhf.technology/runningman/32/2977_2.png) [@Runningman](https://forum.hhf.technology/u/Runningman)\
**Post date:** [August 8, 2025, 2:43pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/3 "2025-08-08T14:43:30Z")

</div>

I installed pangolin with crowdsec two times, always had only one bouncer..

---

<div class="post-metadata">

**Author:** ![hexagram1959](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/h/9d8465/32.png) [@hexagram1959](https://forum.hhf.technology/u/hexagram1959)\
**Post date:** [August 8, 2025, 4:03pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/4 "2025-08-08T16:03:12Z")

</div>

Strange, I did everything according to the official documentation. Fortunately, everything works as it should. My instance has been running since the first release; maybe some update caused that.

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [August 8, 2025, 4:05pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/5 "2025-08-08T16:05:56Z")

</div>

it will work. all bouncers are independent but only one is connected. whcih one is magic….hehehehe

---

<div class="post-metadata">

**Author:** ![Hezza11](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hezza11/32/2335_2.png) [@Hezza11](https://forum.hhf.technology/u/Hezza11)\
**Post date:** [August 11, 2025, 9:29am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/6 "2025-08-11T09:29:16Z")

</div>

This is because the IP of your traefik instance is changing when docker goes down/up. I have similar happening on one of my VPS setups, it doesn’t seem to make any difference apart from the clutter. On a cleaner VPS I have with fewer containers Traefik keeps the same IP and I only have the one bouncer registered.

---

<div class="post-metadata">

**Author:** ![hexagram1959](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/h/9d8465/32.png) [@hexagram1959](https://forum.hhf.technology/u/hexagram1959)\
**Post date:** [August 11, 2025, 9:42am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/7 "2025-08-11T09:42:02Z")

</div>

That makes sense. Thanks for the explanation.

---

<div class="post-metadata">

**Author:** ![tarantula](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/t/e274bd/32.png) [@tarantula](https://forum.hhf.technology/u/tarantula)\
**Post date:** [October 12, 2025, 8:14am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/8 "2025-10-12T08:14:04Z")

</div>

Can this install of crowdsec also be used for securing the VPS on which Pangolin is running?

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 12, 2025, 8:56am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/9 "2025-10-12T08:56:32Z")

</div>

yes why not, it definitely can

---

<div class="post-metadata">

**Author:** ![tarantula](https://forum.hhf.technology/letter_avatar_proxy/v4/letter/t/e274bd/32.png) [@tarantula](https://forum.hhf.technology/u/tarantula)\
**Post date:** [October 12, 2025, 10:21am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/10 "2025-10-12T10:21:47Z")

</div>

How to do this? Any guides for this?

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 12, 2025, 10:33am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/11 "2025-10-12T10:33:12Z")

</div>

# You should not use docker crowdsec if you install this on VPS.

### **Guide for Debian and Ubuntu Systems**

This document provides instructions for installing and configuring CrowdSec on Debian and Ubuntu.

### **1. Install CrowdSec**

The installation process begins with adding the official CrowdSec repository and then installing the package using the `apt` package manager.

1. Execute the installer script to add the CrowdSec repository to your system’s sources.

```bash
curl -s https://install.crowdsec.net | sudo bash

```

2. Install the CrowdSec agent.

```bash
sudo apt update
sudo apt install crowdsec -y

```

#### **Optional: Change CrowdSec Default Port**

To enhance security or avoid port conflicts, you may change the default port (8080) for the Local API (LAPI) and configure it to listen on all network interfaces.

1. Edit the main configuration file `/etc/crowdsec/config.yaml`. Modify the `listen_uri` under the `api.server` section.

2. Update the LAPI credentials file at `/etc/crowdsec/local_api_credentials.yaml` to point to the new port.

#### **Start and Enable the CrowdSec Service**

Ensure the CrowdSec service starts on boot and run it immediately. These commands are standard across systems using `systemd`.

```bash
sudo systemctl enable crowdsec
sudo systemctl start crowdsec

```

### **2. Install CrowdSec Firewall Bouncer**

The firewall bouncer is the component that applies decisions (e.g., blocking an IP address) at the firewall level.

Recent versions of Debian and Ubuntu use `nftables` as the default firewall backend. However, `iptables` is also available.

- **For `nftables` (Recommended for modern systems):**

```bash
sudo apt install crowdsec-firewall-bouncer-nftables -y

```

- **For `iptables` (If preferred or required by your environment):**

```bash
sudo apt install crowdsec-firewall-bouncer-iptables -y

```

### **3. CrowdSec Configuration**

The following steps configure CrowdSec to monitor your applications. These commands are part of the CrowdSec toolchain and are independent of the underlying operating system.

1. Install the necessary collections for Traefik and the Application Security (AppSec) component.

2. Enable the AppSec component by creating a dedicated acquisition configuration file.

3. Configure log acquisition by adding the path to your Pangolin/Traefik logs in the main acquisition file, `/etc/crowdsec/acquis.yaml`. Replace `/srv/pangolin` with the correct path for your deployment.

4. Restart the CrowdSec service to apply all configuration changes.

#### **Create a Bouncer API Key**

Generate a unique API key for your Pangolin bouncer. You must save the generated key for use in the next section.

```bash
sudo cscli bouncers add pangolin-traefik

```

### **4. Configure Pangolin CrowdSec Integration**

This section details the configuration within your Docker and Traefik files. These steps are not dependent on the host operating system.

1. Remove the pre-existing CrowdSec service definition from your Pangolin `docker-compose.yaml` file, as CrowdSec is now running directly on the host.

2. In your `docker-compose.yml`, modify the `gerbil` service definition to include the `extra_hosts` section. This allows the container to resolve `host.docker.internal` to the host machine’s IP address.

3. In your Traefik dynamic configuration file (`config/traefik/dynamic_config.yml`), update the CrowdSec middleware parameters to point to the host machine’s CrowdSec services.

### **5. Optional Configurations**

These adjustments are also independent of the operating system.

#### **Configure Firewall Bouncer to Ignore HTTP Bans**

To use captcha-based remediations within Traefik instead of firewall-level bans for web-related incidents, modify the bouncer configuration.

Add the following line to `/etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml`:

```yaml
scenarios_not_containing: ["http"]

```

#### **Configure a Captcha-First Remediation Profile**

This profile instructs CrowdSec to issue a captcha remediation for the first three offenses from an IP within a 48-hour window for HTTP-related scenarios. Subsequent offenses will result in a standard ban.

Add the following profile to the top of `/etc/crowdsec/profiles.yaml`:

```yaml
name: captcha_remediation
filters:
  - Alert.Remediation == true && Alert.GetScope() == "Ip" && Alert.GetScenario() contains "http" && GetDecisionsSinceCount(Alert.GetValue(),"48h") < 3
decisions:
 - type: captcha
   duration: 4h
on_success: break
---

```

---

<div class="post-metadata">

**Author:** ![rkt3ch](https://forum.hhf.technology/user_avatar/forum.hhf.technology/rkt3ch/32/840_2.png) [@rkt3ch](https://forum.hhf.technology/u/rkt3ch)\
**Post date:** [December 24, 2025, 1:55am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/13 "2025-12-24T01:55:18Z")

</div>

> [@Runningman](#):
>
> _ould you like to run Pangolin as Docker or Podman containers? (default: docker):_
> 
> **Here you respond with ENTER**
> 
> You receive this text now:
> 
> _Looks like you already installed, so I am going to do the setup…_
> 
> _=== CrowdSec Install === Would you like to install CrowdSec? (yes/no) (default: no):_
> 
> **Respond with YES**

I was previously using an older guide for integrating CrowdSec with Pangolin, but my old installation is no longer updating. I now need to reinstall everything from scratch. However, this new guide doesn’t look similar to the previous one I followed. It includes detailed instructions on how to whitelist IPs and other features, which weren’t in the old version.

I might be looking at the wrong guide or thread. Could you please assist me with the correct steps for reinstalling and configuring CrowdSec with Pangolin, especially regarding whitelisting IPs and any key differences from older setups?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![rkt3ch](https://forum.hhf.technology/user_avatar/forum.hhf.technology/rkt3ch/32/840_2.png) [@rkt3ch](https://forum.hhf.technology/u/rkt3ch)\
**Post date:** [December 24, 2025, 1:56am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/14 "2025-12-24T01:56:07Z")

</div>

I was previously using an older guide for integrating CrowdSec with Pangolin, but my old installation is no longer updating. I now need to reinstall everything from scratch. However, this new guide doesn’t look similar to the previous one I followed. It includes detailed instructions on how to whitelist IPs and other features, which weren’t in the old version.

I might be looking at the wrong guide or thread. Could you please assist me with the correct steps for reinstalling and configuring CrowdSec with Pangolin, especially regarding whitelisting IPs and any key differences from older setups?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [December 24, 2025, 2:39am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/15 "2025-12-24T02:39:26Z")

</div>

First use the crowdsec uninstall script. And then down your stack and rerun the installer from the pangolin docs. That’s it .

[https://forum.hhf.technology/t/crowdsec-removal-script-for-pangolin-users](https://forum.hhf.technology/t/crowdsec-removal-script-for-pangolin-users)

---

<div class="post-metadata">

**Author:** ![rkt3ch](https://forum.hhf.technology/user_avatar/forum.hhf.technology/rkt3ch/32/840_2.png) [@rkt3ch](https://forum.hhf.technology/u/rkt3ch)\
**Post date:** [December 24, 2025, 4:29pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/16 "2025-12-24T16:29:21Z")

</div>

Hi,

Thank you for the information. I’m trying to perform a fresh installation of everything, including Pangolin and CrowdSec, starting completely from scratch. However, I’m seeing many different guides and I’m not sure which one is correct.

Could you please provide a step-by-step guide that begins from the very beginning?

Thank you.

---

<div class="post-metadata">

**Author:** ![codewhiz](https://forum.hhf.technology/user_avatar/forum.hhf.technology/codewhiz/32/2365_2.png) [@codewhiz](https://forum.hhf.technology/u/codewhiz)\
**Post date:** [December 24, 2025, 8:12pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/17 "2025-12-24T20:12:31Z")

</div>

just installed using this guide. worked like a charm! Thank you so much @Runningman

> [@Runningman](#):
>
> @hhf.technoloy created a traefik dashboard to visualize what happends in you pangolin instance, I will write a guide for it later.

Waiting for this guide 🙂

---

<div class="post-metadata">

**Author:** ![partytimeexcellent](https://forum.hhf.technology/user_avatar/forum.hhf.technology/partytimeexcellent/32/972_2.png) [@partytimeexcellent](https://forum.hhf.technology/u/partytimeexcellent)\
**Post date:** [January 15, 2026, 8:38am UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/18 "2026-01-15T08:38:06Z")

</div>

> [@Runningman](#):
>
> docker exec crowdsec cscli console enroll

Does Crowdsec work at all without registering on the website and entering the security key? Or is that just for the dashboard?

---

<div class="post-metadata">

**Author:** ![codewhiz](https://forum.hhf.technology/user_avatar/forum.hhf.technology/codewhiz/32/2365_2.png) [@codewhiz](https://forum.hhf.technology/u/codewhiz)\
**Post date:** [January 15, 2026, 4:55pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/19 "2026-01-15T16:55:26Z")

</div>

its optional, just for the dashboard.

---

<div class="post-metadata">

**Author:** ![Peter\_Klein](https://forum.hhf.technology/user_avatar/forum.hhf.technology/peter_klein/32/2133_2.png) [@Peter\_Klein](https://forum.hhf.technology/u/Peter_Klein)\
**Post date:** [February 4, 2026, 2:52pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/20 "2026-02-04T14:52:19Z")

</div>

if i install crowdsec that way i get the following errors in Traefik:  
`ERROR: CrowdsecBouncerTraefikPlugin: 2026/02/04 14:47:05 handleMetricsTicker:reportMetrics reportMetrics:query crowdsecQuery:unreachable url:``http://host.docker.internal:9091/v1/usage-metrics`` Post “``http://host.docker.internal:9091/v1/usage-metrics``”: dial tcp: lookup host.docker.internal on 127.0.0.11:53: no such host`

And if i Testban my ip with a captcha, i get completely banned, without the option to solve the captcha, i just get a 403 error

---

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [February 4, 2026, 3:07pm UTC](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437/21 "2026-02-04T15:07:04Z")

</div>

403 when you test captcha, is bouncer stale/or your captcha setup is not correct.

my compose file

```auto
services:
    crowdsec:
        command: -t
        container_name: crowdsec
        environment:
            COLLECTIONS: crowdsecurity/traefik crowdsecurity/appsec-virtual-patching crowdsecurity/appsec-generic-rules
            DISCORD_WEBHOOK_ID: ""
            DISCORD_WEBHOOK_TOKEN: 
            ENROLL_INSTANCE_NAME: pangolin-crowdsec
            ENROLL_TAGS: docker
            GEOAPIFY_API_KEY: 
            GID: "1000"
            PARSERS: crowdsecurity/whitelists
            CTI_API_KEY: 
        healthcheck:
            interval: 10s
            retries: 15
            test:
                - CMD
                - cscli
                - lapi
                - status
            timeout: 10s
        image: docker.io/crowdsecurity/crowdsec:latest
        labels:
            - traefik.enable=false
        ports:
            - 6060:6060
            - 8080:8080
        restart: unless-stopped
        volumes:
            - ./config/crowdsec:/etc/crowdsec
            - ./config/crowdsec/db:/var/lib/crowdsec/data
            - ./config/traefik/logs:/var/log/traefik

```

```auto
# Add captcha challenge for an IP
docker exec crowdsec cscli decisions add --ip 10.10.10.45 --type captcha -d 1h

```

```auto
name: captcha_remediation
filters:
  - Alert.Remediation == true && Alert.GetScope() == "Ip" && Alert.GetScenario() contains "http"
decisions:
  - type: captcha
    duration: 4h
on_success: break
notifications:
  - discord

```

[Pangolin Stack Debugging Commands 📊](https://hhf.technology/snippets/pangolin-commands#bouncer-management)  
Use this to check your bouncer has an ip.

[Next page](https://forum.hhf.technology/t/how-to-install-and-activate-crowdsec-in-pangolin/3437.md?page=2)
