A tiny, fast static file server.

Fernlight serves a folder over HTTPS with sensible defaults: automatic certificates, compression, caching headers and range requests. One binary, one config file, zero dependencies.

$ fernlight serve ./public
● ~4 MB binary● Linux · macOS · Windows● MIT licensed
# start serving the current folder
$ fernlight serve ./public --domain example.org

fernlight v0.9.4
  root      ./public
  listen    :443 (h2, h3)  :80 → https
  tls       certificate ready (ACME)
  cache     etag + immutable for /assets/*
  compress  br, gzip

ready in 38 ms
GET /              200  3.1 kB   0.4 ms
GET /assets/app.js 200 41.2 kB   0.6 ms
GET /video.mp4     206  1.0 MB   range
Features

Everything a static site needs. Nothing else.

Fernlight is intentionally small. It does one job and tries to do it well.

tls

Automatic HTTPS

Certificates are requested and renewed on their own. HTTP redirects to HTTPS.

h2 · h3

Modern protocols

HTTP/2 and HTTP/3 out of the box, with graceful fallback to HTTP/1.1.

br · gzip

Compression

Precompressed files are picked up automatically, others compressed on the fly.

etag

Smart caching

ETags, Last-Modified and immutable headers for fingerprinted assets.

206

Range requests

Resumable downloads and seekable video and audio without extra setup.

reload

Zero-downtime reload

Change the config and send SIGHUP. Open connections are not dropped.

Configuration

One small file

Most sites never need more than a few lines.

1

Point it at a folder

Any directory with an index.html works.

2

Add your domain

Fernlight handles the certificate.

3

Run it as a service

A systemd unit is included in every release.

fernlight.toml
[site]
domain   = "example.org"
root     = "/var/www/public"

[cache]
immutable = ["/assets/*"]
max_age   = "1h"

[compress]
formats  = ["br", "gzip"]

[log]
level    = "warn"   # no access logs by default
Benchmarks

Measured on a 2-core VPS

Small static files, keep-alive connections, single instance. Results vary with hardware and network.

ScenarioRequests / sp99 latency
index.html, 3 kB48,2001.9 ms
JS bundle, 40 kB (br)21,7003.4 ms
Image, 400 kB3,10011 ms
Video range, 1 MB94028 ms