# miniserve

> Single-binary, cross-platform CLI HTTP file server with auth, uploads, TLS, WebDAV, QR codes, and on-the-fly tar.gz/zip directory downloads.

Stars: 8.0k · Language: Rust · License: MIT · Categories: Network

- Repository: https://github.com/svenstaro/miniserve
- Page: https://www.trmn.sh/tools/miniserve

## Install

- Homebrew: `brew install miniserve`

## Overview

miniserve is a cross-platform command-line HTTP file server written in Rust on top of Actix. It ships as a single binary with no extra dependencies and serves a directory or a single file with one command, for example `miniserve linux-distro-collection/` or `miniserve linux-distro.iso`. It generates a browsable file listing with correct MIME type handling, range request support, and optional README.md rendering.

Beyond static serving, it supports basic authentication with plain or hashed passwords (`username:sha256:hash`, `sha512`) and credentials read from a file via `--auth-file`. It also supports TLS with `--tls-cert` and `--tls-key`, custom response headers, a random route prefix (`--random-route`), binding to multiple interfaces, and an SPA mode (`--spa --index index.html`) that forwards unknown paths to the index file. Pretty URLs mode, WebDAV, and a healthcheck route at `/__miniserve_internal/healthcheck` are also documented.

It can also receive data. `-u` enables file uploads, optionally restricted to specific directories, and `--mkdir` allows directory creation, both usable from the web UI or via `curl -F`. Directories can be downloaded compressed on the fly as `.tar.gz` or `.zip`. Listings can be filtered with a `?search=` query parameter, rendered minimally with `?raw=true` for text browsers such as lynx or w3m, and given a copy-pastable `wget` footer with `--show-wget-footer`. Other options include a QR code for quick access from a phone (`-q`), light and dark color schemes, sorting options, and shell completions.

Typical users are developers and sysadmins who need to share files on a local network, serve a build or SPA for testing, or accept uploads without configuring a full web server.

### Installation

```bash
# via Homebrew
brew install miniserve
```

![miniserve directory listing screenshot](https://media.trmn.sh/cached/6cedffa3beb44656600bde2d035c3538a7100e55da33634cb4bda380d0d7f1be.png)

## Alternatives

- [trippy](https://www.trmn.sh/tools/trippy.md): Network analysis tool combining traceroute and ping functionality for diagnosing networking issues (Rust, 8.1k stars)
- [xh](https://www.trmn.sh/tools/xh.md): HTTP client that reimplements HTTPie's syntax with focus on improved performance and speed. (Rust, 8.2k stars)
- [sshx](https://www.trmn.sh/tools/sshx.md): Shares a terminal session over the web with a single command, with real-time cursors, an infinite canvas of windows, and end-to-end encryption. (Rust, 7.7k stars)
- [spotify_player](https://www.trmn.sh/tools/spotify-player.md): Terminal Spotify client with streaming, Spotify Connect remote control, synced lyrics, audio visualization, daemon mode, and CLI commands. Requires Premium. (Rust, 7.3k stars)
- [websocat](https://www.trmn.sh/tools/websocat.md): Command-line WebSocket client and server, like netcat, curl and socat for ws:// and wss://, with TCP/UNIX socket proxying and program execution. (Rust, 8.7k stars)

---

Canonical: https://www.trmn.sh/tools/miniserve
