Web development

Kooper Server ks

A small HTTP server for local web development, with live reload and a terminal UI for choosing exactly what to serve.

Runs
In a terminal
Platforms
macOS, Linux, Windows, FreeBSD
Built with
Go
Latest release
v1.0.0, 5 December 2026
Licence
Apache 2.0

Overview

Kooper Server (ks) is a small web server for working on websites on your own machine. It has a terminal UI where you browse your folders, choose the one to serve and open its pages in your browser, all from the keyboard. Save a file and the page in your browser updates.

Usage
ks                      # browse from the current folder; serve nothing yet
ks ~/sites/blog         # serve a folder and open it
ks ~/sites/blog/a.html  # serve the folder a.html is in, and open a.html
ks -s --port 3000       # serve the current folder on port 3000, no UI

It's one binary with no dependencies. Copying a URL uses pbcopy on macOS and clip.exe on Windows; on Linux and FreeBSD, install wl-clipboard, xclip or xsel.

Download

Kooper Server 1.0.0 — First Release · v1.0.0 · released 5 December 2026 · release notes · all releases

Unpack the archive and put ks (ks.exe on Windows) somewhere on your PATH. SHA256SUMS has the checksum of every file: sha256sum -c SHA256SUMS --ignore-missing (shasum -a 256 -c on macOS).

The binaries aren't signed, so macOS may refuse to open one downloaded with a browser: allow it under System Settings → Privacy & Security, or run xattr -d com.apple.quarantine ks. On Windows, SmartScreen may ask you to choose More info → Run anyway.

With Go
go install github.com/colboycolinmeeks/kooperserver/cmd/ks@latest

Screenshots

The request log

Browsing never changes what's served

You can wander anywhere: go into folders, go up as far as you like, jump home. The server keeps serving whatever it was serving, or nothing. The line above the list shows where you are, and ● served marks the folder being served. Something is served only when you ask:

  • by naming a folder or file on the command line;
  • with s, which serves the folder you're in and opens it in the browser;
  • with Enter on a file, or o on anything, which opens it in the browser, first serving its folder if needed. If that would replace a folder you're already serving, the hint says so and you press the key twice.

x stops serving. Failed requests, such as a missing stylesheet, stay on the status line until you press a key, even while other requests succeed, so you won't miss them. The request log (L) shows the last 500 requests, and f filters it to failures.

Live reload

Save a file the page uses and the page reloads. Save a stylesheet and the new one is swapped in without a reload, so you keep your scroll position. Kooper Server only checks the files the browser actually loaded, a few times a second while a page is open, so even huge folders cost nothing.

It adds one <script> tag to HTML pages and keeps URLs under /__ks/ for itself. --no-reload turns this off and sends pages exactly as they are on disk. Switching or stopping the served folder reloads open pages too, so a tab showing "nothing served" turns into your site when you press s.

How files are served

  • A folder's URL serves its index.html, or else its index.htm. A folder with neither gets a list of its files to choose from.
  • It listens on 127.0.0.1:8080; if that port is taken it uses the next free one.
  • Files are sent with Cache-Control: no-cache and an exact ETag: a reload always shows your latest edit, but unchanged files come back as a short "not modified" reply instead of being downloaded again.
  • --spa sends the site's index page for any page URL without a file, for single-page apps.

Keys

KeyAction
↑ ↓ / j k, pgup pgdn, g GMove
→ / lGo into the folder under the cursor
← / h / backspace / uGo up a level
enterOpen the file in the browser, or go into the folder
oOpen what's under the cursor in the browser
s / xServe the folder you're in / stop serving
bOpen the served site's home page
~Go to your home folder
aShow and serve hidden files
/Filter the list as you type
y / YCopy the URL / its address on your network
LRequest log
cSwitch colours (blue / black and white)
wWhat's new in this version
?Help: every key, and the version and build
r / qRefresh / quit

Options

OptionMeaning
-p, --port NPort to listen on (default 8080, or the next free one)
--host ADDRAddress to listen on; 0.0.0.0 shares the site on your network
--allow-host NAMESMore host names to answer to, such as a tunnel
-n, --no-openDon't open the browser
-s, --serveServe without the UI, logging requests to the terminal
-a, --allShow and serve hidden files
--follow-linksServe through symlinks that lead out of the served folder
--no-reloadTurn off live reload
--spaSingle-page app mode
--theme NAMEblue (default) or bw
-v, --versionPrint the version, release and build information

KS_HOST, KS_ALLOW_HOST and KS_THEME set the defaults, and KS_BROWSER picks the browser, for example KS_BROWSER="firefox --new-tab".

Safe by default

Kooper Server is for development, not production, but it's careful anyway:

  • Only what you ask for is served. It listens on 127.0.0.1 only, and serves nothing until you choose a folder.
  • Broad folders take two presses. Serving your home folder or the top of a disk needs the key pressed twice, and the title warns while it's served.
  • Web pages can't read your files. To block DNS rebinding attacks it only answers requests addressed to localhost, *.localhost or an IP address, unless you allow another name.
  • Hidden files such as .git and .env are neither listed nor served unless you ask.
  • Symlinks can't reach outside the served folder unless you start it with --follow-links.
  • Listings stay out of search engines if you share through a tunnel.
  • Only GET and HEAD are allowed, and every response says X-Content-Type-Options: nosniff.

Building from source

Kooper Server needs Go 1.27 or later.

make                           # build bin/ks
make run ARGS=~/sites/blog
make serve ARGS=~/sites/blog   # without the UI
make check                     # gofmt check, vet, tests with the race detector
make release                   # cross-compile for macOS, Linux, Windows, FreeBSD
make package                   # release archives and SHA256SUMS in dist/