Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
Open more actions menu

Repository files navigation

gofs

A lightweight, fast HTTP file server written in Go.

Stars Go Report Card Version Docker Pulls Downloads License Ask DeepWiki

Why

  • Fast and safe: secure path handling, optional Basic Auth (bcrypt)
  • Simple: one binary, zero config to start
  • Modern UI: advanced theme with upload, folder creation, and ZIP downloads
  • WebDAV: optional /dav/ endpoint (read-only)
  • Production‑ready: structured logs, health probes, graceful shutdown
  • Multiple directories: mount multiple paths with optional read-only flags

NEXT? (Wishing Pool)

These will increase little by little until v1 in my goal. Any feedback is welcome.

  • HTTP/2 support, TLS/HTTPS
  • Full text search, file preview
  • S3 storage support, OAuth integration
  • Prometheus metrics
  • Plug-in system
  • SDK
  • Kubernetes Operator
  • Multi-tenancy
  • Audit logging
  • WebSocket real-time notifications

Install

Homebrew

brew install samzong/tap/gofs

CLI

go install github.com/samzong/gofs/cmd/gofs@latest

Quick start

# Serve current directory at http://127.0.0.1:8000
gofs

# Change host/port
gofs -host 0.0.0.0 -port 3000

# Enable auth
gofs -auth user:password

# Modern UI (upload, create folder)
gofs --theme advanced

# WebDAV on /dav (read‑only by default)
gofs --enable-webdav

Mounts

You can expose one or more directories. Format: [path:]dir[:ro][:name]

# Single dir (default is ".")
gofs -d /srv/files

# Multiple mounts with names and read‑only flags
gofs -d "/data:/srv:ro:Data" -d "/logs:/var/log::Logs"

JSON API

Every listing can be JSON by sending: Accept: application/json

curl -H "Accept: application/json" http://localhost:8000/

Health checks

  • HTTP: /healthz and /readyz (200 OK)
  • CLI: gofs --health-check

Environments

Flags have GOFS_* env twins (flags win):

  • GOFS_PORT, GOFS_HOST, GOFS_DIR (semicolon‑separated for multiple)
  • GOFS_THEME, GOFS_SHOW_HIDDEN, GOFS_AUTH, GOFS_ENABLE_WEBDAV
  • GOFS_LOG_LEVEL (debug/info/warn/error), GOFS_ENV (production for JSON logs)

Examples

See examples for Docker and Kubernetes manifests.

License

MIT. See LICENSE.

About

A lightweight, fast HTTP file server written in Go.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.