Binary install¶
Barbacana releases a native binary for Linux, macOS, and Windows (amd64 and arm64). Use this installation method when you do not have Docker available — for example, on a bare-metal server, a VM, or an environment where you manage Barbacana as a system service.
For a container-based setup, see Installation.
Prerequisites¶
- Linux, macOS, or Windows on amd64 or arm64
- A
waf.yamlconfiguration file (see Quickstart for the minimal three-line config)
Step 1 — Download the binary¶
Go to the Releases page and find the latest version. Download the archive for your platform, extract it, and place the binary on your PATH.
Replace 0.6.0 in the commands below with the version you are installing.
Confirm the binary is on your PATH:
go go1.26.3
crs v4.26.0
Verify before you run
Each release attaches a signed checksums.txt.bundle and a SLSA3 provenance file. See Verifying releases to authenticate the archive before extracting it.
Step 2 — Write a config¶
Create /etc/barbacana/waf.yaml. The directory must exist before starting the binary.
This forwards all traffic to your app on port 8000. Adjust the port to match your application. Point upstream at a hostname and port your server can reach — localhost works when Barbacana and your app run on the same host.
Step 3 — Validate the config¶
Check the config before starting the server. --validate reads and compiles the full rule set; it catches schema errors, unknown protection names, missing OpenAPI specs, and rule compilation failures.
Exit code 0 means everything is valid. If the config contains errors, each one is printed and the exit code is 1:
barbacana: load config: validate config /etc/barbacana/waf.yaml: routes[0]: unknown protection "sql-inejction" in disable list (did you mean "sql-injection"?)
routes[0]: unknown protection "xss-bodX" in disable list
Fix each reported error and re-run --validate until the output is config valid.
Step 4 — Run¶
Start Barbacana:
{"time":"2026-05-13T09:00:00Z","level":"INFO","msg":"metrics endpoint disabled — set metrics_port to enable /metrics"}
{"time":"2026-05-13T09:00:00Z","level":"INFO","msg":"barbacana started","mode":"plain-http","host":"","port":8080,"health_port":0,"metrics_port":0,"routes":1}
Barbacana listens on :8080 by default and logs structured JSON to stdout. Press Ctrl+C to stop — it shuts down gracefully.
Step 5 — Verify it works¶
With Barbacana running, open a second terminal and send two requests:
curl http://localhost:8080/ # forwarded to your app
curl "http://localhost:8080/?q=1' OR 1=1--" # blocked: 403
The second request is blocked and recorded in the audit log with action: blocked.
Running as a Linux service¶
On a Linux server, run Barbacana under systemd so it starts on boot and restarts automatically after a failure.
Create a dedicated system user:
sudo useradd --system --no-create-home --shell /sbin/nologin barbacana
sudo chown -R barbacana:barbacana /etc/barbacana
Create the unit file:
[Unit]
Description=Barbacana WAF
Documentation=https://barbacana.dev
After=network.target
[Service]
Type=simple
User=barbacana
ExecStart=/usr/local/bin/barbacana --config /etc/barbacana/waf.yaml
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartSec=5
StandardOutput=journal
StandardError=journal
SyslogIdentifier=barbacana
[Install]
WantedBy=multi-user.target
ExecReload sends SIGHUP to the process, which triggers a graceful config reload without dropping existing connections.
Enable and start the service:
Loaded: loaded (/etc/systemd/system/barbacana.service; enabled; preset: enabled)
Active: active (running) since Tue 2026-05-13 09:00:00 UTC; 3s ago
Main PID: 1234 (barbacana)
Tasks: 8 (limit: 4636)
Memory: 28.4M
CPU: 41ms
CGroup: /system.slice/barbacana.service
└─1234 /usr/local/bin/barbacana --config /etc/barbacana/waf.yaml
View live logs:
Apply a config change without downtime:
This sends SIGHUP, which triggers a graceful reload. In-flight requests complete normally; new requests use the updated config.
Next¶
- Installation — run Barbacana as a container with Docker or Docker Compose, including auto-TLS
- Configuration — build from a minimal config to a full production setup, step by step
- Routes — match traffic by host, path, or both
- Detect-only mode — log without blocking while you tune