# Secure Hestia Control Panel with Crowdsec

**URL:** <https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900>\
**Category:** Install & Set-Up\
**Created:** [January 27, 2026, 7:08am UTC](https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900 "2026-01-27T07:08:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LearningSpot](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/l/f17d59/32.png) [@LearningSpot](https://forum.hestiacp.com/u/LearningSpot)\
**Post date:** [January 27, 2026, 7:08am UTC](https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900/1 "2026-01-27T07:08:26Z")

</div>

CrowdSec is an open-source, collaborative Intrusion Detection System (IDS) and firewall that protects servers, services, and containers by analyzing log files to detect and block malicious behavior. It uses a community-driven approach, sharing threat intelligence about malicious IP addresses across all users to create a collective, real-time defense against botnets, DDoS, and other cyberattacks.

There is an official Crowdsec Collection for Hestia Control Panel available now. With this can protect the control panel like fail2ban but more efficient. Can take advantage of the community blocklist and can get 3 free blocklist if have free Crowdsec account.

If Crowdsec already installed then follow Step 3 and Step 4.

# Installing CrowdSec on Linux (Ubuntu/Debian)

### 1. Add Repository & Install: Run the following command to automatically add the repo and install the agent:

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

```

### 2. Install Firewall Bouncer: To make CrowdSec actually block malicious IPs (not just detect them), install the firewall bouncer:

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

```

### 3. Install Hestia Control Panel Collection:

Reference: [hestiacp Collection by LearningSpot](https://app.crowdsec.net/hub/author/LearningSpot/collections/hestiacp)

```bash
sudo cscli collections install LearningSpot/hestiacp

```

Create acquisition file for this in `/etc/crowdsec/acquis.d/hestiacp.yaml`

```yaml
---
filenames:
 - /var/log/hestia/auth.log
labels:
  type: hestiacp

```

Reload Crowdsec:

```bash
sudo systemctl reload crowdsec

```

### 4. Verify Installation:

### Check if Crowdsec is running:

```bash
sudo systemctl status crowdsec

```

### Check if Crowdsec Firewall Bouncer is running:

```bash
sudo systemctl status crowdsec-firewall-bouncer

```

Now your protected against BAD IPS and brute force attack on the Control Panel.

---

<div class="post-metadata">

**Author:** ![system](https://forum.hestiacp.com/uploads/default/original/1X/d9a5b68bf50ced83e880b56452e592b204761b19.png) [@system](https://forum.hestiacp.com/u/system)\
**Post date:** [January 27, 2026, 10:14am UTC](https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900/2 "2026-01-27T10:14:41Z")

</div>

Unlisted on January 27, 2026, 10:14am UTC



---

<div class="post-metadata">

**Author:** ![system](https://forum.hestiacp.com/uploads/default/original/1X/d9a5b68bf50ced83e880b56452e592b204761b19.png) [@system](https://forum.hestiacp.com/u/system)\
**Post date:** [January 27, 2026, 11:18am UTC](https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900/3 "2026-01-27T11:18:41Z")

</div>

Listed on January 27, 2026, 11:18am UTC



---

<div class="post-metadata">

**Author:** ![bosunjohnson](https://forum.hestiacp.com/user_avatar/forum.hestiacp.com/bosunjohnson/32/9581_2.png) [@bosunjohnson](https://forum.hestiacp.com/u/bosunjohnson)\
**Post date:** [September 19, 2026, 1:40pm UTC](https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900/4 "2026-09-19T13:40:19Z")

</div>

@LearningSpot does this work on the current Hestiacp version. I want to set this up but have not much knowledge on Linux.

---

<div class="post-metadata">

**Author:** ![LearningSpot](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/l/f17d59/32.png) [@LearningSpot](https://forum.hestiacp.com/u/LearningSpot)\
**Post date:** [November 7, 2026, 8:37pm UTC](https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900/5 "2026-11-07T20:37:50Z")

</div>

Yes this still works. But you need to use the terminal.

---

<div class="post-metadata">

**Author:** ![x078](https://forum.hestiacp.com/letter_avatar_proxy/v4/letter/x/f08c70/32.png) [@x078](https://forum.hestiacp.com/u/x078)\
**Post date:** [November 8, 2026, 12:04am UTC](https://forum.hestiacp.com/t/secure-hestia-control-panel-with-crowdsec/20900/6 "2026-11-08T00:04:46Z")

</div>

Thanks @LearningSpot for putting this guide together!

For anyone setting up CrowdSec on HestiaCP (and for @bosunjohnson looking for an easier setup), there are **two important HestiaCP-specific caveats** to keep in mind when installing CrowdSec manually:

1. **Port `8080` conflict with Apache2:** By default, CrowdSec’s Local API (LAPI) binds to `127.0.0.1:8080`. On standard HestiaCP `Nginx + Apache2` setups, port `8080` is already used by Apache2, so CrowdSec LAPI should be moved to a dedicated loopback port (e.g. `127.0.0.1:8099`) in `/etc/crowdsec/config.yaml` and `/etc/crowdsec/local_api_credentials.yaml`.
2. **`iptables` bouncer vs `v-update-firewall`:** If you use `crowdsec-firewall-bouncer-iptables`, HestiaCP’s native `v-update-firewall` flushes `iptables` chains (`iptables -F`) whenever firewall rules are updated in the panel, which can detach CrowdSec’s jump rule until the bouncer restarts. Using **`crowdsec-firewall-bouncer-nftables`** instead keeps CrowdSec bans in an isolated nftables table (`table ip crowdsec` / `table ip6 crowdsec6`) that survives HestiaCP firewall reloads.

* * *

### Automated 1-Command Setup for HestiaCP (`v-harden-server --crowdsec`)

We maintain an open-source toolkit for HestiaCP (`hestiacp-useful-tools`) that automates this entire CrowdSec setup in one command (`v-harden-server --crowdsec`):

- Automatically configures CrowdSec LAPI on `127.0.0.1:8099` (no Apache `8080` conflict)
- Installs **`crowdsec-firewall-bouncer-nftables`** (immune to `v-update-firewall` flushes, dual-stack IPv4 + IPv6)
- Auto-detects your active services from `hestia.conf` (Nginx, Apache, Exim, Dovecot, SSH, MariaDB, Hestia `:8083` `/var/log/hestia/auth.log`, Roundcube, and WordPress/CMS brute-force protection)
- Adds an automatic SSH anti-lockout exemption rule so admins don’t accidentally lock themselves out on port 22

**Quick install:**

```bash
git clone https://github.com/webxtekstudio/hestiacp-useful-tools.git /root/hestiacp-useful-tools
cd /root/hestiacp-useful-tools
bash install.sh --crowdsec

```

You can inspect the status anytime with:

```bash
v-harden-server --status

```

Repository & full documentation: [hestiacp-useful-tools/scripts/server-hardening at main · webxtekstudio/hestiacp-useful-tools · GitHub](https://github.com/webxtekstudio/hestiacp-useful-tools/tree/main/scripts/server-hardening)
