FlashLin combines the power of Nginx, the flexibility of Apache, and the simplicity of Caddy.
443
Fast, Cached, and Powerful Rust Web Server โ container-ready with HTTP/3, automatic HTTPS, TLS, reverse proxy, caching, compression, and PHP-FPM support.
Websiteโ ยท Documentationโ ยท GitHubโ ยท Docker Hubโ
FlashLin Docker is the containerized deployment of FlashLin, a high-performance Rust web server built on Tokio and Hyper.
It provides a production-oriented container environment for static websites, HTTPS, reverse proxying, WebSockets, PHP-FPM, compression, caching, security features, metrics, and optional HTTP/3 support.
unsafe codeacme,http3).br/.gz sidecar negotiation/metrics (loopback-only).toml file per domain, no central config edits--watch / FLASHLIN_WATCH=1) โ no dropped connectionsflashlin purge cache (loopback HTTP, works through docker exec)Everything below is new since the 0.4.x image and wasn't in earlier Docker builds:
| Feature | Notes |
|---|---|
| HTTP/3 over QUIC | Optional listener, image built with --features http3. Experimental โ see HTTP/3โ |
| Automatic HTTPS (ACME) | Image built with --features acme. Requests and renews Let's Encrypt certificates itself |
| WebSocket proxy | HTTP/1 upgrade tunnels forwarded to your backend through proxy_pass |
| Reverse proxy failover | Round-robin upstream groups with passive failure cooldown |
| Validated hot reload | --watch / FLASHLIN_WATCH=1 applies a fully validated config snapshot with no dropped connections |
| Streaming, byte ranges, precompressed assets | 64 KiB streamed reads, single/suffix ranges, If-Range |
| In-container cache purge | flashlin purge cache via docker exec โ see Useful commandsโ |
| Per-virtual-host cache & rate-limit state | Each domain's .toml gets independent cache and rate-limit tracking |
dockerflashlin/ is one part of the main flashlinโ repository โ the Rust source itself, not a separate project:
flashlin/
โโโ src/ # Rust source
โ โโโ main.rs # Entry point, config loading, banner
โ โโโ server/ # TCP listener, worker pool, graceful shutdown
โ โโโ http/ # Request parsing, response helpers, router
โ โโโ config/ # TOML parser + validator
โ โโโ cache/ # In-memory response cache (DashMap + TTL)
โ โโโ static_files/ # File serving, ETag, cache headers, path security
โ โโโ php/ # PHP-FPM + FastCGI protocol implementation
โ โโโ proxy/ # Reverse proxy + upstream management
โ โโโ tls/ # rustls config + certificate loader
โ โโโ security/ # Rate limiter, IP ACL, security headers
โ โโโ middleware/ # Compression, request-ID, access logging
โ โโโ metrics/ # Prometheus counters + exposition
โ โโโ tests/ # Integration tests
โโโ server.toml # Full configuration reference
โโโ domains/ # Example virtual host configs
โโโ examples/ # Example configs (HTTP/3, ACME, performance, โฆ)
โโโ docs/ # HTTP_PROTOCOLS.md, PRODUCTION.md, PERFORMANCE.md, โฆ
โโโ production/ # Self-contained per-distro deploy packages
โ โโโ centos/ debian/ raspberry-pi/ universal/
โ โโโ install.sh, install_linux_cdn.sh, systemd unit, โฆ
โโโ dockerflashlin/ # โ you are here โ Docker & Compose setup
โ โโโ Dockerfile, Dockerfile.prebuilt
โ โโโ docker-compose*.yml
โ โโโ config/, certs/, public/
โ โโโ README.md (this file)
โโโ .github/workflows/ # CI โ tests, and build + publish this Docker image
Building the image (below) needs the repository root as its build context, not this folder โ the Dockerfile compiles src/ directly. Everything else on this page (Compose files, TLS certs, config mounts) only touches files inside dockerflashlin/ itself.
docker pull endurasolution/flashlin:2.0.0
Also available as endurasolution/flashlin:2.0 and endurasolution/flashlin:latest. Pin to the full
2.0.0 tag for anything you deploy โ latest will move. Currently published for linux/amd64.
| Feature | Status |
|---|---|
| Rust web server (Tokio + Hyper) | Yes |
| HTTP/1.1 + HTTP/2 | Yes |
| HTTP/3 over QUIC | Optional listener โ see HTTP/3โ |
| Automatic HTTPS (Let's Encrypt / ACME) | Yes โ built with acme feature |
| Manual TLS certificates | Yes โ rustls, no OpenSSL |
| PHP-FPM / FastCGI | Yes |
| Reverse proxy + WebSocket upgrades | Yes |
| Gzip + Brotli compression | Yes |
| ETag / Last-Modified / 304 caching | Yes |
| Security headers + rate limiting | Yes |
| Prometheus metrics (loopback-only) | Yes |
| In-container cache purge | Yes โ flashlin purge cache |
| Docker Compose modes (HTTP/TLS/PHP) | Yes |
dockerflashlin/
โโโ Dockerfile # Multi-stage build from source (default)
โโโ Dockerfile.prebuilt # Installs the released binary via install_linux.sh
โโโ docker-compose.yml # HTTP on port 80
โโโ docker-compose.tls.yml # HTTPS on 443 + HTTP 80โ443 redirect
โโโ docker-compose.php.yml # PHP-FPM + HTTP port 80
โโโ docker-compose.php.tls.yml # PHP-FPM + HTTPS port 443
โโโ entrypoint.sh
โโโ config/
โ โโโ server.toml # HTTP, port 80
โ โโโ server.tls.toml # HTTPS, port 443
โ โโโ server.php.toml # PHP-FPM + HTTP
โ โโโ server.php.tls.toml # PHP-FPM + HTTPS
โโโ certs/ # Mount your TLS certs here
โโโ public/
โโโ index.html # Example static page
โโโ index.php # Example PHP page
docker rundocker run -d --name flashlin -p 80:80 endurasolution/flashlin:2.0.0
Open http://localhost. Then:
docker logs -f flashlin # tail logs
docker stop flashlin # stop
docker rm flashlin # remove
cd dockerflashlin
docker compose up -d # HTTP, port 80
docker compose logs -f flashlin
docker compose down
| Mode | Compose file | Ports | PHP | TLS |
|---|---|---|---|---|
| Static HTTP | docker-compose.yml | 80 | No | No |
| Static HTTPS | docker-compose.tls.yml | 80, 443 | No | Yes |
| PHP HTTP | docker-compose.php.yml | 80 | Yes | No |
| PHP HTTPS | docker-compose.php.tls.yml | 80, 443 | Yes | Yes |
docker-compose.yml โ static HTTP:
services:
flashlin:
image: endurasolution/flashlin:2.0.0
container_name: flashlin
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./public:/var/www/html:ro
- ./config/server.toml:/etc/flashlin/server.toml:ro
- flashlin_logs:/var/log/flashlin
environment:
RUST_LOG: info
FLASHLIN_CONFIG: /etc/flashlin/server.toml
volumes:
flashlin_logs:
The tls and php variants follow the same shape โ swap the config file mounted at
/etc/flashlin/server.toml, add 443:443 for TLS, and add the php-fpm service for PHP
(see PHP-FPMโ below).
FlashLin expects certificates mounted at:
dockerflashlin/certs/
โโโ fullchain.pem # certificate + intermediate chain
โโโ privkey.pem # private key
# On the host:
certbot certonly --standalone -d yourdomain.com
mkdir -p certs
cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem certs/
cp /etc/letsencrypt/live/yourdomain.com/privkey.pem certs/
mkdir -p certs
openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
-keyout certs/privkey.pem \
-out certs/fullchain.pem \
-subj "/CN=localhost"
docker compose -f docker-compose.tls.yml up -d
FlashLin listens on 443 for HTTPS and 80 for HTTP, redirecting all HTTP traffic to HTTPS.
certbot renew
cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem certs/
cp /etc/letsencrypt/live/yourdomain.com/privkey.pem certs/
docker compose -f docker-compose.tls.yml restart flashlin
Prefer not managing certbot yourself? Build with the
acmefeature (already on for the published image) and let FlashLin request and renew Let's Encrypt certificates itself โ see Domain configuration and HTTPSโ .
The published image is built with acme,http3. After TLS is configured, enable it in the mounted
server.toml:
[http3]
enabled = true
port = 443
max_concurrent_streams = 32
Add "443:443/udp" to the service's ports list alongside the existing TCP mapping, and allow UDP
443 through your host firewall. HTTP/1.1 and HTTP/2 continue to work over TCP 443 unaffected. This
listener is explicitly experimental โ see
HTTP/1.1, HTTP/2 and HTTP/3โ for current limits.
Build context is the flashlin project root, not dockerflashlin/:
# From the project root:
docker build -f dockerflashlin/Dockerfile -t flashlin .
# Or let Compose handle it:
cd dockerflashlin && docker compose build
Build context is dockerflashlin/ itself:
cd dockerflashlin
docker build -f Dockerfile.prebuilt -t flashlin .
| Config file | Port | TLS | PHP |
|---|---|---|---|
server.toml | 80 | No | No |
server.tls.toml | 443 | Yes | No |
server.php.toml | 80 | No | Yes |
server.php.tls.toml | 443 | Yes | Yes |
| Variable | Default | Description |
|---|---|---|
WEBROOT | ./public | Host directory mounted as the webroot (Compose only) |
RUST_LOG | info | Log level: error, warn, info, debug, trace |
FLASHLIN_CONFIG | /etc/flashlin/server.toml | Config path inside the container |
FLASHLIN_WATCH | unset | Set to 1 to hot-reload config on change instead of a static start |
WEBROOT=/srv/mysite docker compose -f docker-compose.tls.yml up -d
docker run -d \
--name flashlin \
-p 80:80 -p 443:443 \
-v /path/to/server.toml:/etc/flashlin/server.toml:ro \
-v /path/to/site:/var/www/html:ro \
-v /path/to/certs:/etc/flashlin/certs:ro \
endurasolution/flashlin:2.0.0
| Host path | Container path |
|---|---|
./public/ | /var/www/html/ |
./config/server*.toml | /etc/flashlin/server.toml |
./certs/ | /etc/flashlin/certs/ |
| (named volume) | /var/log/flashlin/ |
The PHP Compose files run two services:
| Service | Image | Role |
|---|---|---|
flashlin | built from source / endurasolution/flashlin | HTTP/HTTPS server + FastCGI client |
php-fpm | php:8.2-fpm-alpine | PHP execution engine |
Both mount the same webroot. FlashLin forwards .php requests to php-fpm:9000.
Adding PHP extensions (e.g. pdo_mysql):
# docker-compose.php.tls.yml
php-fpm:
build:
context: .
dockerfile_inline: |
FROM php:8.2-fpm-alpine
RUN docker-php-ext-install pdo pdo_mysql
docker compose -f docker-compose.php.yml build
docker compose -f docker-compose.php.yml up -d
# Logs
docker compose logs -f flashlin
# Restart (picks up new certs or a changed config)
docker compose -f docker-compose.tls.yml restart flashlin
# Shell inside the container
docker compose exec flashlin sh
# Clear the running server's in-memory response cache
# (loopback-only โ must run inside the container's network namespace)
docker exec flashlin flashlin purge cache
# Check config without starting a listener
docker exec flashlin flashlin --check /etc/flashlin/server.toml
# Stop everything
docker compose down
# Stop and remove volumes too
docker compose down -v
# Update to a newer image
docker pull endurasolution/flashlin:2.0.0
docker compose down && docker compose up -d
flashlin start/stop/restart aren't listed above โ those wrap systemctl for a systemd-managed
install and don't apply inside a container. Use the docker/docker compose commands above instead;
purge cache and --check work fine via docker exec since they only talk to the FlashLin process
itself.
WEBROOT (or the volume mount) to your actual site directorypublic/index.phpphp:8.2.27-fpm-alpinerestart: always instead of unless-stoppedjson = true under [logging] for structured log ingestion[security.rate_limit] for your expected traffic2.0.0) rather than tracking latest| Resource | Link |
|---|---|
| Website | flashlin.comโ |
| Documentation | flashlin.com/docsโ |
| GitHub | github.com/endurasolution/flashlinโ |
| Docker Hub | hub.docker.com/r/endurasolution/flashlinโ |
| One-line installer (non-Docker) | curl -fsSL https://flashlin.com/install_linux.sh | bash |
FlashLin is licensed under Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). Free to use, share, and adapt for non-commercial purposes with attribution โ commercial use requires written permission. Full license: https://creativecommons.org/licenses/by-nc/4.0/โ .
Content type
Image
Digest
sha256:734eaeb8bโฆ
Size
36 MB
Last updated
about 19 hours ago
docker pull endurasolution/flashlin