High performance
Built with Rust for efficient Async I/O and excellent performance.
Deliver static websites confidently with a modern and Open Source web server designed for secure, efficient, and reliable deployments across platforms.
$ static-web-server --port=8080 --root=./public --log=info {"timestamp":"2026-06-12T11:38:03.543447Z","level":"INFO","message":"starting Static Web Server","name":"static-web-server","version":"2.43.0","target":"static_web_server::server"} {"timestamp":"2026-06-12T11:38:03.544833Z","level":"INFO","message":"log level","log_level":"info","target":"static_web_server::server"} {"timestamp":"2026-06-12T11:38:03.545077Z","level":"INFO","message":"server bound to tcp socket","addr":"[::]:8787","target":"static_web_server::server::listener"}
Why Static Web Server
A handful of reasons teams pick SWS to ship sites and web assets in production.
Built with Rust for efficient Async I/O and excellent performance.
Memory-safe, opinionated server defaults, TLS, security headers, Basic Auth and more.
Single ~4MB static binary, no runtime dependencies. Drops into any distro or Docker container.
CLI flags, environment variables or a TOML file. Sensible defaults with no boilerplate.
Features
A curated set of features for modern static hosting to opt in when you need them.
Modern protocols with HTTPS redirects out of the box.
On-demand gzip, brotli and zstd support.
Serve .gz, .br and .zst straight from disk.
Tune browser caching for assets and HTML.
Configure origins, methods & headers with full preflight.
Protect a directory in a single line of configuration.
Sensible defaults you can opt into for production.
Serve index.html on 404 for React, Vue, Svelte.
Glob patterns with replacements for clean URLs.
Health endpoint and Prometheus metrics built in.
Serve multiple sites from one process via host routing.
Optional listing with sorting and JSON output.
Set custom headers for client responses on demand.
Serve Markdown or HTML based on the client's Accept header.
Docker images for a variety of platforms and architectures.
Display a custom page for users while performing updates.
Run natively as a managed Windows Service.
New
Cache frequently accessed files in memory for faster response times.
New
Optional FIPS 140 builds for regulated workloads.
New
Listen on a UDS for fast, secure local proxying.
Configuration
Describe the whole server configuration in one readable TOML or skip it and pass directly a few flags or environment variables.
[general]
# Bind & serve
host = "0.0.0.0"
port = 80
root = "./public"
# Performance
compression = true
cache-control-headers = true
http2 = true
# Security
security-headers = true
basic-auth = "user:hashed-pass"
# SPA support
page-fallback = "./public/index.html"Runs anywhere
Native binaries and Docker images for desktops, servers, mobile and the web.
Pre-compiled binaries for x86, x86_64, ARM and ARM64. Docker images on scratch, Alpine and Debian.
Get started
Install with one command in Linux/BSD, then point it at any folder of static files.
curl --proto '=https' --tlsv1.2 -sSfL https://get.static-web-server.net | sh
If you use Docker, then try
docker run -p 8080:80 -v $PWD:/public ghcr.io/static-web-server/static-web-server:3