selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

SafeLine logo

Self-host SafeLine

v9.4.4

Self-hosted WAF with intelligent threat detection

ReleaseOpen SourceGPL-3.0
Updated4 days ago
LanguageGo
Setup difficultyModerate
Stars
23 293
CPU
1 core
RAM
1 GB
Storage
5 GB
Ports
9443 (Management web console), 80 (HTTP reverse proxy), 443 (HTTPS reverse proxy), 65508 (Health check), 65443 (Custom page)
Requires
Docker, Docker Compose, PostgreSQL
Docker
chaitin/safeline-postgres:15.18
Install with Docker Compose
SafeLine dashboard overviewSafeLine attack detection viewSafeLine application configurationSafeLine statistics and analytics

What is SafeLine?

SafeLine is a self-hosted web application firewall and reverse proxy created by Chaitin Tech. It shields web applications by inspecting HTTP traffic and blocking threats such as SQL injection, cross-site scripting, code injection, command injection, XXE, SSRF, path traversal, brute-force attempts, and HTTP flood DDoS attacks. The system uses an intelligent semantic analysis engine for accurate detection, along with rate limiting, CAPTCHA-based bot challenges, password authentication gates, and dynamic encryption of HTML and JavaScript on each request. It runs as a Docker Compose stack with separate containers for the Tengine-based proxy, management API, and PostgreSQL database, exposing a web console on port 9443. A free Personal Edition is available alongside paid Lite, Pro, and Ultimate tiers that add geo-blocking, log export, notifications, load balancing, high-availability sync, custom block pages, and multi-user management. The project reports over 700,000 deployments worldwide.

SafeLine alternatives

Should you self-host SafeLine?

SafeLine scores 80/100 on selfhost.directory (how scoring works) and ranks #1 of 3 in Web Application Firewall. It has 23 293 GitHub stars, +560 in the last 30 days.

It shipped 11 stable releases in the past year. The latest, v9.4.4, came out on 11 November 2026. New versions land roughly every 3 weeks.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is GPL-3.0-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is UUSEC WAF (59/100, 1 723 stars). SafeLine scores higher overall. See SafeLine vs UUSEC WAF side by side.

Features

  • Anti-Bot Challenge
  • Attack Log ExportAvailable in Lite and Pro editions only
  • Authentication Challenge
  • Custom Blocking PagesAvailable in Pro edition only
  • Discord/Telegram notificationsAvailable in Lite and Pro editions only
  • Dynamic Protection
  • Geo-blockingAvailable in Lite and Pro editions only
  • HTTP Flood DDoS Protection
  • Master-Slave Node SyncAvailable in Pro edition only
  • Multi-User ManagementAvailable in Pro edition only
  • Rate Limiting
  • Semantic Analysis Engine
  • Upstream load balancingAvailable in Pro edition only
  • Web Attack Protection
  • Websocket Support

SafeLine README

How to install SafeLine

Install SafeLine with Docker Compose

Environment variables
SAFELINE_DIR, IMAGE_TAG, MGT_PORT, POSTGRES_PASSWORD, SUBNET_PREFIX, IMAGE_PREFIX, ARCH_SUFFIX, RELEASE, MGT_PROXY, POSTGRES_IMAGE, DETECTOR_MGMT_TOKEN, MGT_INTERNAL_TOKEN, DETECTOR_AES_KEY, DETECTOR_MGMT_AUTH, DETECTOR_UPDATE_VERIFY, DETECTOR_UPDATE_PUBLIC_KEY

mkdir -p "/data/safeline" cd "/data/safeline" touch ".env"

Write .env content with SAFELINE_DIR, IMAGE_TAG, MGT_PORT, POSTGRES_PASSWORD, etc.

docker compose up -d

Requires Docker 20.10.14+ and Docker Compose 2.0.0+

How to configure SafeLine

  • SAFELINE_DIR/data/safelineSafeLine installation directory
  • IMAGE_TAGlatestSafeLine version to be used
  • MGT_PORT9443Web console port
  • POSTGRES_PASSWORDPostgres database initialization password
  • SUBNET_PREFIX172.22.222SafeLine internal network communication address prefix

SafeLine releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

How to export SafeLine logs to external systems?

Use Fluentd with the fluent-plugin-sql to read from the PostgreSQL database and forward logs via syslog to external systems.

Can SafeLine and business services be deployed on the same machine?

Yes, they can be deployed on the same machine, but it is not recommended as the machine load will be higher compared to separate deployments.

How to enable access logs in SafeLine?

Modify the nginx.conf file in resources/nginx directory, uncomment line 98 and delete line 99, then run 'docker exec safeline-tengine nginx -t' and 'docker exec safeline-tengine nginx -s reload'.

How to reset the admin account password?

Run 'docker exec safeline-mgt resetadmin' to reset the admin password.

Does SafeLine support WebSocket?

Yes, WebSocket is supported by default.

How to change the default port for SafeLine management?

Modify the MGT_PORT variable in the .env file in the installation directory and restart with docker compose down && docker compose up -d.

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…