Overview
Discover what makes miniserve powerful
`miniserve` is a lightweight, cross‑platform command‑line utility written in Rust that exposes local files or directories over HTTP with minimal configuration. It is designed for rapid, ad‑hoc sharing of artifacts such as ISO images, build outputs, or static web assets. From a developer’s standpoint, the tool is prized for its zero‑dependency binary, deterministic build process, and extensive runtime options that expose a rich feature set without sacrificing simplicity.
Language & Runtime
Networking
File System Interaction
Authentication
Overview
miniserve is a lightweight, cross‑platform command‑line utility written in Rust that exposes local files or directories over HTTP with minimal configuration. It is designed for rapid, ad‑hoc sharing of artifacts such as ISO images, build outputs, or static web assets. From a developer’s standpoint, the tool is prized for its zero‑dependency binary, deterministic build process, and extensive runtime options that expose a rich feature set without sacrificing simplicity.
Technical Stack
- Language & Runtime: Pure Rust (edition 2021), compiled to a single statically linked binary. No external runtime or package manager is required once the binary is deployed.
- Networking: Built on top of the
hyperHTTP/1.1 server library, with optional TLS support via therustlscrate for self‑signed or CA‑issued certificates. The server supports IPv4/IPv6, multiple bind addresses, and custom port selection. - File System Interaction: Uses
std::fsandwalkdirfor recursive directory traversal, with optional read‑only or write (upload) modes. File metadata is served via HTTP headers (e.g.,Content-Type,Last-Modified). - Authentication: Basic HTTP authentication is implemented natively. Credentials can be supplied inline (
user:pass), as SHA‑256 hashes, or via an external file containing multipleuser:hashlines. No third‑party auth libraries are required. - Configuration: All options are exposed as CLI flags (
--auth,--tls-cert,--header, etc.). No external configuration files are needed, simplifying deployment in CI pipelines or containerized environments.
Core Capabilities
| Feature | Description |
|---|---|
| Directory & File Serving | Serve a single file or an entire directory tree with automatic MIME type detection. |
| Single Page Application (SPA) Mode | --spa forwards all non‑existent routes to a specified index file, enabling client‑side routing. |
| Custom Index File | --index replaces the default directory listing with a static HTML page. |
| Random Route Generation | -i 192.168.0.1 --random-route /tmp creates a unique, short URL segment for secure, temporary sharing. |
| Upload Endpoint | -u exposes a /upload endpoint that accepts multipart/form‑data, allowing remote file uploads via curl. |
| TLS & HSTS | --tls-cert/--tls-key enable HTTPS, while custom headers (e.g., Strict-Transport-Security) can be added for security hardening. |
| Custom HTTP Headers | --header allows injection of arbitrary headers for cache control, security policies, or analytics. |
| Multiple Interface Binding | Multiple -i flags let the server listen on several IP addresses simultaneously. |
Deployment & Infrastructure
Because miniserve is a single binary, it fits naturally into containerized workflows. A typical Docker image can be built with:
FROM rust:slim AS builder
WORKDIR /usr/src/app
COPY . .
RUN cargo build --release
FROM debian:stable-slim
COPY --from=builder /usr/src/app/target/release/miniserve /usr/local/bin/
ENTRYPOINT ["miniserve"]
The tool scales horizontally by running multiple instances behind a reverse proxy (e.g., Traefik, Nginx) or by using Kubernetes Deployments with node selectors for local storage. For read‑heavy workloads, the static nature of served files means caching layers (CDN or local reverse proxy caches) can be added without modifying the application.
Integration & Extensibility
While miniserve is intentionally minimal, its API surface is exposed via command‑line flags that can be orchestrated by scripts or CI pipelines. It does not provide a plugin system, but developers can wrap it in custom services:
- Webhooks: Trigger
miniservewith a new random route whenever a build artifact is generated, then send the URL to a Slack channel via an incoming webhook. - Authentication Backends: Replace the built‑in Basic Auth with LDAP or OAuth by generating a pre‑hashed credentials file and passing it to
--auth-file. - Custom Headers: Dynamically inject security headers (e.g., CSP, X‑Frame‑Options) from environment variables or a secrets manager.
Developer Experience
- Documentation: The README provides exhaustive flag descriptions, usage examples, and troubleshooting tips. The source code is well‑commented, with a clear module hierarchy.
- Community & Support: Active GitHub repository (≈ 2 k stars), regular CI checks, and a permissive MIT license encourage community contributions. Issues are typically addressed within days.
- Testing: The project includes unit tests and integration tests that run on multiple platforms, ensuring reliability across environments.
Use Cases
- Ad‑hoc Artifact Sharing – Quickly expose a nightly build ISO to testers without setting up an FTP server.
- Static Web Hosting – Serve a pre‑built SPA or documentation site from a local directory during development.
- CI/CD Pipelines – Publish build artifacts to a temporary URL that can be consumed by downstream jobs or sent to stakeholders.
- Secure File Transfer – Use the random route and Basic Auth features to share sensitive files over a LAN with minimal exposure.
- **IoT Firmware Updates
Open SourceReady to get started?
Join the community and start self-hosting miniserve today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
GO Feature Flag
Lightweight, Open‑Source Feature Flagging for Self‑Hosted Apps
Hi.Events
Sell tickets, manage events, and grow audiences all in one

Send
Self-hosted other
Hasura GraphQL Engine
Instant, secure APIs from any database

Castopod
Self-hosted podcast platform with social interaction
CouchCMS
Turn static HTML into a dynamic CMS in minutes
