Skip to content
Back to skills

Http Static Server

ASecurity

Start an ad-hoc HTTP static file server in the current directory using one-line commands across 25+ languages and tools. Auto-detects available runtimes and recommends the best option.

  • 11 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 10, 2026
developmentpythonrustgojavarubyphpshellnodenodejsexpress

Works with

  • cli

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 10, 2026

npx -y skills add luokai0/ai-agent-skills-by-luo-kai --skill http-static-server --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Http Static Server?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Http Static Server
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/luokai0-http-static-server/badge)](https://www.skillsdirectory.com/skills/luokai0-http-static-server)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: http-static-server
description: Start an ad-hoc HTTP static file server in the current directory using one-line commands across 25+ languages and tools. Auto-detects available runtimes and recommends the best option.
homepage: https://gist.github.com/willurd/5720255
{"author":"flowerwrong","version":"2026.3.10","sdk_version":"1.4.0","updated":"2026-03-10"}
---

# HTTP Static Server One-Liners

Start an ad-hoc HTTP static file server serving the current (or specified) directory.
Default: `http://localhost:8000`

Reference: <https://gist.github.com/willurd/5720255>
Detailed per-language docs: `{baseDir}/references/`

## When to use this skill

- User needs to quickly serve static files (HTML/CSS/JS/images) locally
- User asks "how do I start a local web server" or similar
- User wants to preview a static site, share files over LAN, or test frontend assets
- User needs a quick HTTP server for development or testing

## Quick Reference Table

| Language/Tool | Command | Dir Listing | Install Needed |
|---|---|---|---|
| **Python 3** | `python3 -m http.server 8000` | Yes | No |
| Python 2 | `python -m SimpleHTTPServer 8000` | Yes | No |
| Twisted | `twistd -n web -p 8000 --path .` | Yes | `pip install twisted` |
| **Node.js (npx)** | `npx http-server -p 8000` | Yes | No |
| Node.js (serve) | `npx serve -l 8000` | Yes | No |
| node-static | `npx node-static -p 8000` | No | No |
| **Deno** | `deno run --allow-net --allow-read jsr:@std/http/file-server` | Yes | No |
| **PHP** | `php -S 127.0.0.1:8000` | No | No |
| **Ruby** | `ruby -run -ehttpd . -p8000` | Yes | No |
| Ruby (WEBrick) | `ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>Dir.pwd).start'` | Yes | No |
| Ruby (adsf) | `adsf -p 8000` | No | `gem install adsf` |
| Ruby (Sinatra) | `ruby -rsinatra -e'set :public_folder,".";set :port,8000'` | No | `gem install sinatra` |
| **Go** | `go run github.com/goware/webify@latest -port 8000 .` | Yes | No |
| **Java 18+** | `jwebserver -d . -b 0.0.0.0 -p 8000` | Yes | No |
| Java (module) | `java -m jdk.httpserver -d . -b 0.0.0.0 -p 8000` | Yes | No |
| **Rust** | `miniserve -p 8000 .` | Yes | `cargo install miniserve` |
| Perl (Plack) | `plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");' -p 8000` | Yes | `cpan Plack` |
| Perl (Brick) | `perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000);$s->mount("/"=>{path=>"."});$s->start'` | Yes | `cpan HTTP::Server::Brick` |
| Perl (Mojo) | `perl -MMojolicious::Lite -MCwd -e 'app->static->paths->[0]=getcwd;app->start' daemon -l http://*:8000` | No | `cpan Mojolicious::Lite` |
| Erlang | `erl -s inets -eval 'inets:start(httpd,[...]).'` | No | No |
| **Elixir** | `elixir --no-halt -e 'Application.start(:inets);:inets.start(:httpd,...)'` | No | No |
| BusyBox | `busybox httpd -f -p 8000` | Yes | No |
| lighttpd | `lighttpd -Df - <<< ...` | Configurable | `brew install lighttpd` |
| webfs | `webfsd -F -p 8000` | Yes | `apt install webfs` |
| Algernon | `algernon -x . :8000` | Yes | `brew install algernon` |
| Docker (Nginx) | `docker run --rm -v "$PWD":/usr/share/nginx/html:ro -p 8000:80 nginx` | Configurable | Docker |
| Docker (PHP) | `docker run -it --rm -v "$PWD":/app -w /app -p 8000:8000 php:8.2-cli php -S 0.0.0.0:8000` | No | Docker |
| PowerShell (Pode) | `Start-PodeStaticServer -Port 8000 -FileBrowser -Address 0.0.0.0` | Yes | `Install-Module Pode` |
| IIS Express | `iisexpress.exe /path:C:\MyWeb /port:8000` | No | Windows |

## Decision guide for the agent

1. **Detect runtimes**: Check which runtimes are available (`python3 --version`, `node --version`, `deno --version`, etc.).
2. **Default to Python 3** — pre-installed on most Linux/macOS systems.
3. **Node.js project context** — prefer `npx serve` or `npx http-server`.
4. **Deno project context** — use the `jsr:@std/http/file-server`.
5. **Minimal environment** (containers, embedded) — use `busybox httpd`.
6. **Windows without WSL** — use PowerShell (Pode) or IIS Express.
7. **Need features** (upload, auth, HTTPS) — recommend `miniserve` (Rust) or Algernon.
8. **No runtime available** — suggest Docker approach.
9. Always confirm the desired **port** (default 8000) and **directory** (default `.`).
10. For per-language details, flags, and advanced usage, see `{baseDir}/references/<language>.md`.

## Common options

| Need | Solution |
|---|---|
| Custom port | Replace `8000` with desired port in any command |
| Serve a specific directory | Append the path or use the tool's directory flag |
| Bind to all interfaces (LAN) | Use `0.0.0.0` as the bind address |
| CORS headers | `npx http-server --cors` or add middleware |
| HTTPS | `miniserve --tls-cert/--tls-key`, reverse proxy, or `openssl s_server` |
| Directory listings | Python, http-server, Plack, miniserve, BusyBox support by default |
| File upload | `miniserve --upload-files` |
| Authentication | `miniserve --auth user:password` |
| Docker (no local runtime) | See `{baseDir}/references/docker.md` |

## Per-language reference docs

Detailed documentation with full flags, install instructions, and advanced usage:

- `{baseDir}/references/python.md` — Python 3, Python 2, Twisted
- `{baseDir}/references/nodejs.md` — http-server, serve, node-static, inline
- `{baseDir}/references/deno.md` — std/http file-server
- `{baseDir}/references/php.md` — Built-in dev server, Docker
- `{baseDir}/references/ruby.md` — ruby -run, WEBrick, adsf, Sinatra
- `{baseDir}/references/go.md` — webify, inline Go
- `{baseDir}/references/rust.md` — miniserve, http
- `{baseDir}/references/java.md` — jwebserver, jdk.httpserver, inline
- `{baseDir}/references/perl.md` — Plack, HTTP::Server::Brick, Mojolicious
- `{baseDir}/references/erlang.md` — inets
- `{baseDir}/references/elixir.md` — :inets, Plug
- `{baseDir}/references/busybox.md` — busybox httpd
- `{baseDir}/references/docker.md` — Nginx, PHP, Python, Alpine
- `{baseDir}/references/powershell.md` — Pode, .NET HttpListener, IIS Express
- `{baseDir}/references/lighttpd.md` — inline config, config file
- `{baseDir}/references/webfs.md` — webfsd
- `{baseDir}/references/algernon.md` — static mode, Lua scripting

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.