ttyd exposes a shell or custom command over HTTP and WebSockets with optional authentication and SSL.
Overview
ttyd is a small program that shares a terminal session over the web. You start it with a command and options, and clients connect through modern browsers using an Xterm.js-based terminal with CJK and IME support.
The server builds on libwebsockets and libuv. It can enforce basic credentials, bind specific interfaces or UNIX sockets, limit clients, run read-only sessions, and terminate SSL with OpenSSL. ZMODEM file transfer integrates with lrzsz when configured.
Packaging covers macOS via Homebrew, Debian and Ubuntu packages, snap, OpenWrt opkg, and static binaries from releases, plus Windows binaries or local compilation. Configuration flags control port, user and group, signals sent on exit, reverse-proxy base paths, IPv6, and client-specific terminal options.
Typical usage is remote ops, demos, or embedded devices where a quick browser shell is enough. Alternatives mentioned in project docs include Wetty and GoTTY for similar web-terminal approaches.
Key features
- WebSocket terminal via Xterm.js
- Basic authentication support
- SSL TLS with certificate files
- ZMODEM transfers with lrzsz
- Custom commands and read-only mode
- Reverse-proxy base path option
- Cross-platform binaries and packages
- Client and connection limits
Use cases
- Browser access to a remote shell
- Demos of CLI tools over the web
- Quick terminal on routers or IoT
- Shared readonly troubleshooting sessions