For a command line tool for serving files, the first results are vercel/serve (vercel/serve is a Node.js static file server that runs with a single command from the terminal, delivers files and directory listing over HTTP, and supports configurable ports — exactly the simple, minimal-setup tool this search is after), zeit/serve (zeit/serve is a Node.js command-line static file server that offers single-command startup, static file serving, and directory listing, making it a strong fit for your needs, though built-in custom header support is not explicitly highlighted) and thewawar/simple-http-server (This Rust-based static file server is a command-line tool that serves files from a directory with a single command, supporting configurable ports, directory listing, and custom headers, directly matching what you're looking for). svenstaro/miniserve and http-party/http-server round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
Lightweight utilities for instantly hosting local directories over HTTP using simple terminal commands.
Serve is a Node.js static file server that delivers assets and single-page applications from a local directory over HTTP. It functions as both a command-line web server for hosting directories directly from the terminal and as HTTP middleware for integrating static asset delivery into existing servers. The project includes a directory browser interface that provides a web-based file explorer for navigating and accessing files within a served folder. It supports single-page application fallback by redirecting unmatched request paths to a root file to enable client-side routing. The server han
vercel/serve is a Node.js static file server that runs with a single command from the terminal, delivers files and directory listing over HTTP, and supports configurable ports — exactly the simple, minimal-setup tool this search is after.
serve is a static file server and command line tool used for serving assets and websites over HTTP from a local file system. It functions as a Node.js static hosting tool for single page applications and static content, as well as a directory listing web server. The project provides a visual browser interface for navigating and downloading files from a directory, enabling remote directory browsing. It maps incoming HTTP request paths to local folder structures to deliver images, stylesheets, and scripts. The tool includes capabilities for static content hosting and static file serving middle
zeit/serve is a Node.js command-line static file server that offers single-command startup, static file serving, and directory listing, making it a strong fit for your needs, though built-in custom header support is not explicitly highlighted.
This project is a collection of specialized HTTP servers designed for static file hosting, secure file uploads, and encrypted web traffic. It provides implementations for delivering local files and directories over HTTP and HTTPS, including support for index pages and single-page application routing. The software differentiates itself through dedicated server roles, including a secure file upload server with size limits and token validation, and an HTTPS web server that utilizes PKCS#12 certificates for TLS encryption. It also includes a specialized gateway for managing cross-origin resource
This Rust-based static file server is a command-line tool that serves files from a directory with a single command, supporting configurable ports, directory listing, and custom headers, directly matching what you're looking for.
Miniserve is an HTTP static file server that hosts local directories over the network with an integrated web-based file browser. It functions as a single-binary tool capable of serving as a markdown rendering server, a TLS-enabled web server for encrypted traffic, and a WebDAV file manager for remote file operations. The project distinguishes itself through specialized hosting modes, including a single page application mode that routes requests to a single index file and the ability to generate random hexadecimal access URLs to obscure served directories. It also provides the ability to conve
miniserve is a single-binary command-line static file server that serves directories over HTTP with an integrated file browser, configurable port, and support for custom headers, directly matching the request for a simple one-command static file server.
This project is a lightweight Node.js web server and command-line tool designed for hosting static assets and delivering local files over HTTP. It functions as a static site host that provides a minimal environment for serving HTML, CSS, and JavaScript files to web browsers. The server includes built-in support for TLS encryption to enable secure HTTPS access and allows for the configuration of cross-origin resource sharing headers. It also features basic authentication to restrict folder access via username and password verification. The system manages content delivery through browser cache
http-party/http-server is a lightweight Node.js command-line tool that serves static files from any directory with a single command, includes directory listing, configurable port, and support for custom headers (CORS, cache control), making it exactly the simple static file server you are looking for.
Tinyhttpd is a minimal HTTP web server designed to process requests, deliver static files, and execute CGI scripts via network sockets. It serves as an educational implementation for studying the fundamental mechanics of the HTTP protocol and network programming. The server supports the Common Gateway Interface to generate dynamic content by launching external programs as subprocesses. It manages these dynamic requests by redirecting data through pipes and system environment variables. The system provides capabilities for parsing HTTP request methods and URLs, mapping those requests to local
Tinyhttpd is a minimal HTTP server that delivers static files and runs from the command line, matching the core need for a single-command static file server, though it does not explicitly mention directory listing, configurable port, or custom headers.
This is a high-performance C++ HTTP web server designed for delivering static content. It operates as an asynchronous event loop server that combines IO multiplexing with worker thread pools to handle concurrent requests without blocking. The server specializes in TCP connection management, featuring keep-alive sessions, request pipelining, and timer-based timeout tracking for idle sockets. To ensure high throughput, it utilizes double-buffered asynchronous logging and background threads to prevent disk I/O latency from impacting network traffic. The system covers broad capability areas incl
This is a C++ HTTP web server for static content, which fits the category, but it is built for high performance and asynchronous handling rather than being a simple command-line tool with easy startup, directory listing, and configurable headers.
dufs is a self-hosted file manager and static file server that provides HTTP file hosting and WebDAV capabilities. It functions as a tool for sharing files over HTTP and managing folders remotely through both a web-based interface and the WebDAV protocol. The server distinguishes itself by mapping incoming requests directly to a local directory structure and offering a single-binary distribution for deployment. It supports the mounting of the server as a network drive via WebDAV and allows for the replacement of the default web interface using customizable asset overlays. The project covers
Dufs is a single-binary command-line static file server that serves files from a local directory over HTTP with directory listing and WebDAV support, making it a direct fit for your need — though custom headers are not mentioned in the evidence.
Caddy is an extensible, modular web server platform designed for high-performance traffic management and automated security. At its core, it functions as a dynamic HTTP gateway that handles request routing, static asset delivery, and reverse proxying through a chain of configurable handler modules. The system is built on a modular architecture that allows developers to extend server functionality by registering custom components, all managed through a unified lifecycle and provisioning framework. What distinguishes Caddy is its focus on automated infrastructure and zero-downtime operations. I
Caddy serves static files from a directory with a single command (caddy file-server) and includes directory listing, configurable port, and custom header support, but its full-featured, extensible platform nature makes it heavier than the simplest tool you may have in mind.
This project is a self-hosted web application that enables file sharing and management over a network. It functions as a lightweight service that exposes local directories through a browser-based interface, allowing users to upload, download, and organize files from any connected device. The system distinguishes itself by integrating a dedicated media streaming server, which allows users to play video content directly from the host machine within a web browser. It also provides a programmatic interface that supports external service integration, enabling automated file operations through secu
This Go-based tool serves files over HTTP from a single executable and includes a web UI for browsing, making it a valid static file server, but its focus on sharing with built-in image/video playback and the lack of evidence for custom headers mean it's a narrower fit than a pure command-line static file server.
NanoHTTPD is a lightweight, embeddable HTTP server for Java applications. It allows developers to integrate web server capabilities directly into a Java project to handle incoming requests without requiring a standalone installation. The project provides specialized implementations for an HTTPS web server, a WebSocket server for bidirectional real-time communication, and a static file web server. These capabilities enable secure network traffic through SSL certificates and the delivery of local files with automatic MIME type detection. The server includes systems for request routing and hand
NanoHTTPD is an embeddable Java library for adding HTTP serving to applications, not a standalone command-line tool—so it lacks the single-command startup and directory-listing features you need.
This project is a PHP application server and process manager designed to reduce request latency by keeping applications resident in memory. It functions as a load balancer that distributes incoming network requests across a pool of worker processes, eliminating the overhead of repetitive bootstrapping. The server routes network requests directly into application framework kernels, bypassing traditional web server layers. It includes a built-in mechanism for delivering static assets directly to clients and supports hot reloading by monitoring source files for changes and automatically restarti
php-pm is a PHP application server and process manager that includes static asset delivery, but its primary purpose is running persistent PHP applications with load balancing—not the simple single-command static file server you're looking for.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| vercel/serve | 9.9K | TypeScript | MIT | |
| zeit/serve | 9.9K | TypeScript | MIT | |
| thewawar/simple-http-server |
| 3.4K |
| Rust |
| mit |
| svenstaro/miniserve | 8.1K | Rust | MIT |
| http-party/http-server | 14.2K | JavaScript | MIT |
| ezlippi/tinyhttpd | 12.2K | C | GPL-3.0 |
| linyacool/webserver | 8.2K | C++ | MIT |
| sigoden/dufs | 9.7K | Rust | other |
| caddyserver/caddy | 78.9K | Go | Apache-2.0 |
| songquanpeng/go-file | 1.1K | HTML | MIT |