Back to services

miniserve

CLI tool to serve files and dirs over HTTP.

View alternatives to miniserve
Suggest edit
Open source
Self-hostable
MIT
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Introduction

miniserve is built for those moments when you just want to share some files over HTTP right now. It is a single binary with no extra dependencies: download it and run it. In many cases this is faster and less hassle than setting up a full web server. The project is written in Rust on top of the Actix framework, is open source under the MIT license, and has about 7.9k stars on GitHub.

Key Features

  • Share a directory or a single file: miniserve directory/ or miniserve file.iso, then open it to browse and download
  • Custom index page and SPA support: use --index to specify the index page; with --spa, paths that don't exist are handed over to the single-page app's front-end router
  • Authentication: supports username/password, hashed passwords such as SHA256, and reading multiple accounts from a file
  • File uploads and directory creation: -u enables uploads, and you can restrict which paths accept them; --mkdir allows creating directories; you can also upload with curl
  • Download folders as archives: compressed on the fly into .tar.gz or .zip
  • Search and filtering: use ?search=keyword to filter by file or directory name, case-insensitive
  • TLS and custom response headers: configure a certificate to enable HTTPS, and add custom headers such as HSTS and Cache-Control
  • Random route: --random-route generates a random 6-digit hexadecimal path, making the link harder to guess
  • Other: correct MIME type detection; Range request and WebDAV support; renders README.md like GitHub; light/dark themes; QR code for quick access; shell completions; a health check route at /__miniserve_internal/healthcheck
  • Friendly to command-line clients: ?raw=true outputs minimal HTML, convenient for text browsers such as lynx and w3m; --show-wget-footer shows a ready-to-copy recursive wget download command at the bottom of the page
  • Upload photos from your phone: miniserve -u -m image -q hints the media type the browser should expect, so some mobile browsers (such as Firefox on Android) will open the camera directly

Who It's For

Good for developers, sysadmins, home or LAN users, and anyone who needs to transfer files between devices on a temporary basis.

Core Strengths

  • A single binary that works out of the box on Linux, macOS, and Windows
  • Built on Rust and Actix, so it is fast and handles concurrency well
  • Sensible, secure defaults
  • Compared with the alternatives: unlike Python's built-in web server, it doesn't require installing Python first, performs better, and handles MIME types more accurately; it is easier to use on Windows than darkhttpd; and it is more convenient than netcat, especially for sharing directories

Installation

  • Linux / macOS / Windows: download the binary for your platform from GitHub Releases and run it directly
  • Arch Linux: pacman -S miniserve
  • Termux: pkg install miniserve
  • Homebrew: brew install miniserve
  • Scoop: scoop install miniserve
  • Cargo: cargo install --locked miniserve
  • Docker / Podman: docker run -v /tmp:/tmp -p 8080:8080 --rm -it docker.io/svenstaro/miniserve /tmp
  • Helm: a third-party Helm chart is available

Deployment Notes

  • The default port is 8080
  • If -i is not specified, it listens on all network interfaces over both IPv4 and IPv6 by default; you can use -i multiple times to bind multiple addresses
  • The repository provides a hardened systemd unit file, [email protected], so you can run it as a daemon; startup arguments can be changed in an override file or configured through MINISERVE_* environment variables