Favicon of Static Web Server

Static Web Server

Run a high-performance static web server with minimal resources. Get HTTP/2, TLS, advanced compression, and cross-platform support in a single 4MB binary.

Serve static web files and assets with a tiny, fast, and production-ready web server. Built with Rust, it is memory-safe and has significantly reduced CPU and RAM overhead, making it ideal for resource-constrained environments. The entire server is a single, dependency-free 4MB binary, available for Linux, macOS, Windows, Docker, and even WebAssembly.

It comes packed with features for modern web development, including:

  • Advanced Compression: Supports GZip, Brotli, and Zstandard, with on-demand and pre-compressed file serving.
  • Modern Protocols: Provides HTTP/2 and TLS support out of the box for secure and fast connections.
  • Flexible Configuration: Manage settings using CLI arguments, environment variables, or a TOML file.
  • Powerful Routing: Set up custom URL rewrites, redirects, virtual hosts, and fallback pages for Single-Page Applications.
  • Security & Access: Includes CORS with preflight request support and Basic HTTP Authentication.
  • Developer Friendly: Offers optional directory listing, configurable logging, and first-class Docker support.

Directory Structure

static-web-server
public
.env
docker-compose.yml

docker-compose.yml

services:
  web:
    image: joseluisq/static-web-server:2
    container_name: static-web-server
    ports:
      - "8080:80"
    environment:
      - SERVER_PORT=80
      - SERVER_ROOT=/public
      - SERVER_BASIC_AUTH=${SERVER_BASIC_AUTH}
    volumes:
      - ./public:/public
    restart: unless-stopped

.env

# Basic Authentication credentials (format: username:password)
# If you do not want basic auth, you can remove this variable or leave it blank.
SERVER_BASIC_AUTH=admin:your_super_secret_password
Categories:

Share:

Ad
Favicon

 

  
 

Similar to Static Web Server

Favicon

 

  
  
Favicon

 

  
  
Favicon