SH SelfHostAlt
Sponsored Self-host any open-source app on Hostinger KVM VPS from $4.99/mo (1-Click Docker) →
SafeLine logo

SafeLine

GPL-3.0 Docker Ready ★ 23,480 Stars Active · 2026-11-23

Web application firewall / reverse proxy to protect your web apps from attacks and exploits. , Source Code.

Category
Web Servers
Tech Stack / Runtime
Docker · Go
Open-Source License
GPL-3.0
GitHub Health
★ 23,480 · 1,634 forks
#firewall#http-flood#security#sql-injection#waf
Official compose.yaml

Quick Docker Compose Reference for SafeLine

networks:
  safeline-ce:
    name: safeline-ce
    driver: bridge
    ipam:
      driver: default
      config:
        - gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1
          subnet: ${SUBNET_PREFIX}.0/24
    driver_opts:
      com.docker.network.bridge.name: safeline-ce

services:
  postgres:
    container_name: safeline-pg
    restart: always
    image: ${IMAGE_PREFIX}/safeline-postgres${ARCH_SUFFIX}:15.2
    volumes:
      - ${SAFELINE_DIR}/resources/postgres/data:/var/lib/postgresql/data
      - /etc/localtime:/etc/localtime:ro
    environment:
      - POSTGRES_USER=safeline-ce
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?postgres password required}
    networks:
      safeline-ce:
        ipv4_address: ${SUBNET_PREFIX}.2
    command: [postgres, -c, max_connections=600]
    healthcheck:
      test: pg_isready -U safeline-ce -d safeline-ce
  mgt:
    container_name: safeline-mgt
    restart: always
    image: ${IMAGE_PREFIX}/safeline-mgt${REGION}${ARCH_SUFFIX}${RELEASE}:${IMAGE_TAG:?image tag required}
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${SAFELINE_DIR}/resources/mgt:/app/data
      - ${SAFELINE_DIR}/logs/nginx:/app/log/nginx:z
      - ${SAFELINE_DIR}/resources/sock:/app/sock
      - /var/run:/app/run
    ports:
      - ${MGT_PORT:-9443}:1443
    healthcheck:
      test: curl -k -f https://localhost:1443/api/open/health
    environment:
      - MGT_PG=postgres://safeline-ce:${POSTGRES_PASSWORD}@safeline-pg/safeline-ce?sslmode=disable
      # Optional override for the control channel token that tcontrollerd has to
      # present before it may subscribe. Leave it empty to use
      # ${SAFELINE_DIR}/resources/sock/mgt_grpc_token, which this container
      # creates and the tengine container reads.
      - MGT_GRPC_TOKEN=${MGT_GRPC_TOKEN:-}
      # Token required on GET /api/OTPUrl as X-Bootstrap-Token. Leave empty
      # to let the process generate one into
      # ${SAFELINE_DIR}/resources/sock/tfa_bootstrap_token (0600) and log the
      # path. The console must send that value; until it does, bind with curl.
      - MGT_BOOTSTRAP_TOKEN=${MGT_BOOTSTRAP_TOKEN:-}
      # How long the account may be bound without a credential, measured from
      # the moment the installation was set up (or from `mgt -reset_user
      # admin`, which opens it again). Defaults to 30m; set it to 0 to leave
      # the bootstrap open until the first login, which is what older releases
      # did. A console that is bound after the window closed answers with an
      # error that names the command to reopen it, and never rejects a pending
      # secret that is already bound to the address that asks for it.
      - MGT_BOOTSTRAP_WINDOW=${MGT_BOOTSTRAP_WINDOW:-}
    depends_on:
      - postgres
      - fvm
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "5"
    networks:
      safeline-ce:
        ipv4_address: ${SUBNET_PREFIX}.4
  detect:
    container_name: safeline-detector
    restart: always
    image: ${IMAGE_PREFIX}/safeline-detector${REGION}${ARCH_SUFFIX}${RELEASE}:${IMAGE_TAG}
    volumes:
      - ${SAFELINE_DIR}/resources/detector:/resources/detector
      - ${SAFELINE_DIR}/logs/detector:/logs/detector
      - /etc/localtime:/etc/localtime:ro
    environment:
      - LOG_DIR=/logs/detector
    networks:
# ... (see full file in official GitHub repository)

SafeLine System Requirements & Self-Hosting Guide

Deploy SafeLine (512 MB – 1 GB RAM) →

Recommended VPS

512 MB – 1 GB RAM

1 vCPU · $4 – $6/mo VPS

Deployment Method

Beginner-Friendly

Docker / Docker Compose (Recommended)

Commercial Use (GPL-3.0)

Yes — free to self-host commercially for your team without per-seat fees.

Maintenance Status

Active

Last commit: 2026-11-23

Frequently Asked Questions about SafeLine

Is SafeLine free to self-host for commercial use?

SafeLine is released under the GPL-3.0 license. Yes — free to self-host commercially for your team without per-seat fees. It has 23,480 GitHub stars and was last updated on 2026-11-23.

What VPS specifications do I need to self-host SafeLine?

Based on its Docker runtime and Web Servers workload, we recommend at least 512 MB – 1 GB RAM and 1 vCPU (typically $4 – $6/mo VPS).

Does SafeLine support Docker deployment?

Yes — SafeLine supports Docker / Docker Compose (Recommended), making it beginner-friendly to spin up on any Linux VPS.

More Open-Source Web Servers

View all →
★ 79.7k Docker

Powerful, enterprise-ready web server with automatic HTTPS. .

Apache-2.0 Go/deb/Docker
Details →
★ 65.8k Docker

HTTP reverse proxy and load balancer that makes deploying microservices easy. .

MIT Go/Docker
Details →
★ 33.7k Docker

HTTP and reverse proxy server, mail proxy server, and generic TCP/UDP proxy server. .

BSD-2-Clause C/deb/Docker
Details →
★ 24k Docker

Identity-aware tunneled reverse proxy with dashboard UI, access control, and WireGuard-based tunnels (alternative to Cloudflare Tunnel, Tailscale). ).

Replaces: Tailscale / Hamachi Cloudflare Tunnel / ngrok
AGPL-3.0 Docker
Details →
★ 11.3k Docker

Next-gen Web Application Firewall (WAF) that will protect your web services. , Source Code, Clients).

AGPL-3.0 deb/Docker/K8S/Python
Details →