caddy file-server --root /srv/www --browse

Category: Web Servers & Proxies

caddy file-server --root /srv/www --browse

Serve files with directory listing enabled

Serves /srv/www on the default port 2015, with --browse turning on an HTML file listing for directories without an index file. Handy for sharing a folder on a LAN. Leave --browse off in production so directory contents stay hidden.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.