A version of ttyd with some custom patches applied.
  • C 56.8%
  • TypeScript 26.7%
  • Shell 6.4%
  • JavaScript 4%
  • CMake 3.9%
  • Other 2.2%
Find a file
Max Bossing d0135c82b6
Some checks failed
docker / build (push) Has been cancelled
docs: document the new flag (-E)
2026-01-21 16:06:25 +01:00
.github workflow: push docker image to ghcr.io 2024-11-26 23:38:49 +08:00
cmake cmake: get version from git ref 2024-03-29 08:58:02 +08:00
html html: add closeOnDisconnect option 2025-01-29 19:21:14 +08:00
man add --srv-buf-size option 2025-01-31 14:15:46 +08:00
scripts bump up libwebsockets (#1457) 2025-07-27 22:32:16 +08:00
snap snap: remove dev libs from stage-packages 2024-01-27 10:56:52 +08:00
src feat: pass headers to the connection process as env vars 2026-01-21 16:04:22 +01:00
.clang-format drop libwebsockets < 3.2.0 support 2021-08-10 22:20:56 +08:00
.gitattributes update .gitattributes for generated code 2020-12-27 23:12:51 +08:00
.gitignore gitignore: add .vscode dir 2021-03-20 17:47:43 +08:00
app.rc.in update copyright year 2025-01-31 14:24:15 +08:00
CMakeLists.txt Bump to 1.7.7 2024-03-30 11:04:51 +08:00
Dockerfile Leverage Docker Layer System (#1191) 2023-10-02 14:48:25 +08:00
Dockerfile.alpine Leverage Docker Layer System (#1191) 2023-10-02 14:48:25 +08:00
LICENSE update copyright year 2025-01-31 14:24:15 +08:00
README.md docs: document the new flag (-E) 2026-01-21 16:06:25 +01:00
screenshot.gif Initial commit 2016-09-14 08:53:15 +08:00

backend frontend GitHub Releases Docker Pulls Packaging status GitHub

ttyd - Share your terminal over the web

ttyd is a simple command-line tool for sharing terminal over the web.

screenshot

Features

  • Built on top of libuv and WebGL2 for speed
  • Fully-featured terminal with CJK and IME support
  • ZMODEM (lrzsz) / trzsz file transfer support
  • Sixel image output support (img2sixel / lsix)
  • SSL support based on OpenSSL / Mbed TLS
  • Run any custom command with options
  • Basic authentication support and many other custom options
  • Cross platform: macOS, Linux, FreeBSD/OpenBSD, OpenWrt, Windows

❤ Special thanks to JetBrains for sponsoring the opensource license to this project.

Installation

Install on macOS

  • Install with Homebrew: brew install ttyd
  • Install with MacPorts: sudo port install ttyd

Install on Linux

  • Binary version (recommended): download from the releases page

  • Install with Homebrew : brew install ttyd

  • Install the snap: sudo snap install ttyd --classic

  • Build from source (debian/ubuntu):

    sudo apt-get update
    sudo apt-get install -y build-essential cmake git libjson-c-dev libwebsockets-dev
    git clone https://github.com/tsl0922/ttyd.git
    cd ttyd && mkdir build && cd build
    cmake ..
    make && sudo make install
    

    You may also need to compile/install libwebsockets from source if the libwebsockets-dev package is outdated.

  • Install on OpenWrt: opkg install ttyd

  • Install on Gentoo: clone the repo and follow the directions here.

Install on Windows

Usage

Command-line Options

USAGE:
    ttyd [options] <command> [<arguments...>]

OPTIONS:
    -p, --port              Port to listen (default: 7681, use `0` for random port)
    -i, --interface         Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
    -U, --socket-owner      User owner of the UNIX domain socket file, when enabled (eg: user:group)
    -c, --credential        Credential for basic authentication (format: username:password)
    -H, --auth-header       HTTP Header name for auth proxy, this will configure ttyd to let a HTTP reverse proxy handle authentication
    -u, --uid               User id to run with
    -g, --gid               Group id to run with
    -s, --signal            Signal to send to the command when exit it (default: 1, SIGHUP)
    -w, --cwd               Working directory to be set for the child program
    -a, --url-arg           Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)
    -W, --writable          Allow clients to write to the TTY (readonly by default)
    -t, --client-option     Send option to client (format: key=value), repeat to add more options
    -T, --terminal-type     Terminal type to report, default: xterm-256color
    -O, --check-origin      Do not allow websocket connection from different origin
    -m, --max-clients       Maximum clients to support (default: 0, no limit)
    -o, --once              Accept only one client and exit on disconnection
    -q, --exit-no-conn      Exit on all clients disconnection
    -B, --browser           Open terminal with the default system browser
    -E, --expose-headers    Expose HTTP headers as environment variables
    -I, --index             Custom index.html path
    -b, --base-path         Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128)
    -P, --ping-interval     Websocket ping interval(sec) (default: 5)
    -6, --ipv6              Enable IPv6 support
    -S, --ssl               Enable SSL
    -C, --ssl-cert          SSL certificate file path
    -K, --ssl-key           SSL key file path
    -A, --ssl-ca            SSL CA file path for client certificate verification
    -d, --debug             Set log level (default: 7)
    -v, --version           Print the version and exit
    -h, --help              Print this text and exit

Read the example usage on the wiki.

Browser Support

Modern browsers, See Browser Support.

Alternatives