static-web-server
SHA-256A lightweight, high-performance static file server written in Rust. Serves static web files with HTTP/1 & HTTP/2, compression, security headers, and many modern features. Single 4MB binary, no dependencies.
Smart Download
Download Download Version
v2.42.0 · 3.5 MB
A single-binary, dependency-free static file server with HTTP/2, compression, and security features.
Core Features
- Single 4MB fully static binary, no runtime dependencies
- Blazing fast async performance via Rust, Hyper, and Tokio
- HTTP/1 & HTTP/2 with TLS support
- Optional Gzip, Deflate, Brotli, or Zstd compression
- Directory listing with sorting and JSON output
What It Can't Do
- •Designed for static files only – not a replacement for dynamic backends,Logging is minimal; advanced log shipping not built-in,TLS requires manual certificate setup via CLI flags,Windows Service mode requires administrator privileges
Use Cases
- Host static websites, blogs, or documentation sites
- Serve Single-Page Applications with 404 fallback
- Deliver static assets in microservice architectures
- Minimal Docker image for static file serving in Kubernetes
- Local development server for API docs or offline guides
Detailed Introduction
Static Web Server (SWS) is a cross-platform, production-ready web server designed specifically for serving static files and assets. Built with Rust on top of Hyper and Tokio, it delivers blazing-fast performance with minimal CPU and memory overhead. The server is a single 4MB fully static binary (Musl-based) with no runtime dependencies, making it easy to deploy on any Linux distro or Docker container. It supports HTTP/2 with TLS, Gzip/Brotli/Zstd compression, Cache-Control, CORS, directory listing, virtual hosting, URL rewriting, basic auth, health checks, Prometheus metrics, and more. Configuration is flexible via CLI, environment variables, or TOML file. SWS is ideal for serving static websites, SPAs, API documentation, or as a lightweight development server.
Troubleshooting & FAQ (2)
TroubleshootingWhy does Static Web Server ignore my Cache-Control header for index.html files in subdirectories?
This is a known regression in version 2.40.1 where advanced header rules using glob patterns like '**/*.html' do not apply to directory index files (e.g., '/about/index.html' requested as '/about'). The bug is fixed in PR #613. Use the latest development Docker image (e.g., 'joseluisq/static-web-server:devel') or upgrade to a version that includes the fix once released.
TroubleshootingHow to fix 'cp: unrecognized option: x' error when running the static-web-server installer on Alpine/BusyBox?
This error occurs because BusyBox's cp does not support the -x flag. It has been fixed in the installer script (PRs #610 and #611). Use the latest installer from https://get.static-web-server.net, which replaces cp with the install command and removes the sudo requirement. For Docker, rebuild the image without caching or pull the updated script. If you cannot upgrade immediately, manually copy the binary to the target path without the unsupported flag.
Tags
Getting Started
Download installer
Click the button above to download the installer for your system
Install the software
Double-click the downloaded installer and follow the prompts
Download the binary for your platform from GitHub Releases (or pull Docker image joseluisq/static-web-server)
Unzip and run: `./static-web-server --port 8080 --root ./my-site`
Open http://localhost:8080 in browser
- Download the binary for your platform from GitHub Releases (or pull Docker image joseluisq/static-web-server)
- Unzip and run: `./static-web-server --port 8080 --root ./my-site`
- Open http://localhost:8080 in browser
SHA-256 checksum verified
Checksum extracted from GitHub official Release page
SHA256 Checksum
ed32ff29cdcafb37b5cc4efa89147918bc837fbe308a2a6c438c8b9047b71956This checksum is extracted from the GitHub Release page. Verify file integrity after download.
All SHA-256 checksums on this platform are extracted from the project's official GitHub Release page, without any modification. You can independently verify them on the GitHub Releases page.
Open Source Transparency
View GitHub SourceUninstall Info
Delete the binary or Docker image; no leftovers.
No Extra Dependencies
Ready to use after download. No additional runtime required.
Having issues? Check the FAQ below
2 FAQs
Similar Projects
caddy
Caddy is an extensible server platform that uses TLS by default. It is production-ready, handles automatic certificates, and supports modern HTTP protocols.
PowerToys
A set of utilities for power users to tune and streamline their Windows experience for greater productivity.
terminal
Modern, feature-rich terminal application for Windows command-line users, with tabs, GPU acceleration, and full customization.