Overview
Discover what makes WeTTY powerful
WeTTY is a lightweight, browser‑based terminal emulator that exposes an SSH session over HTTP/HTTPS using WebSockets. Built with Node.js (≥18) and leveraging the **xterm.js** library for terminal emulation, it provides a near‑native terminal experience in the browser with minimal latency. Unlike legacy solutions such as ajaxterm or anyterm, WeTTY’s WebSocket‑driven architecture eliminates the request/response overhead of Ajax polling and supports full terminal features (copy/paste, resize events, color schemes) out of the box.
WebSocket‑based SSH
xterm.js integration
Flexible authentication
HTTPS support
Overview
WeTTY is a lightweight, browser‑based terminal emulator that exposes an SSH session over HTTP/HTTPS using WebSockets. Built with Node.js (≥18) and leveraging the xterm.js library for terminal emulation, it provides a near‑native terminal experience in the browser with minimal latency. Unlike legacy solutions such as ajaxterm or anyterm, WeTTY’s WebSocket‑driven architecture eliminates the request/response overhead of Ajax polling and supports full terminal features (copy/paste, resize events, color schemes) out of the box.
Key Features
- WebSocket‑based SSH: Real‑time bidirectional communication ensures low round‑trip latency and efficient data streaming.
- xterm.js integration: Full terminal emulation with support for 256‑color palettes, Unicode, and mouse reporting.
- Flexible authentication: Password or public‑key SSH login; optional custom
ssh-configfiles and known hosts management. - HTTPS support: Built‑in TLS configuration (
--ssl-key,--ssl-cert) for secure deployments. - Embedded mode:
--allow-iframeflag permits embedding the terminal in external web pages or dashboards.
Technical Stack
| Layer | Technology |
|---|---|
| Runtime | Node.js (ECMAScript 2020) |
| Server | Express‑style HTTP server with WebSocket upgrade handling |
| Terminal Engine | xterm.js (client‑side) + node-pty or native SSH process spawning |
| SSH Client | OpenSSH client binary invoked via child processes; optional ssh-keygen integration |
| Configuration | JSON/YAML config files, command‑line flags (CLI) |
| Data Persistence | None required; optional logging via stdout or external loggers |
The server spawns a child process (ssh or /bin/login) per client connection, pipes its stdin/stdout to a WebSocket, and serves the static xterm.js bundle to the browser. The architecture is intentionally stateless beyond the per‑connection process, simplifying scaling.
Core Capabilities & APIs
- Programmatic control: The CLI exposes flags for SSH host/port, user, authentication method, and custom commands (
--command). Developers can wrap these in scripts or orchestrate via CI/CD pipelines. - Event hooks: The WebSocket server emits events (
connection,close,error) that can be captured by custom middleware or monitoring tools. - Extensibility: While WeTTY itself has no plugin system, its open‑source nature allows developers to fork and integrate additional features (e.g., session recording, multi‑user support) by extending the Node.js codebase.
- Security hooks: Ability to supply custom
known-hostsfiles or SSH config overrides enables tight integration with existing PKI infrastructure.
Deployment & Infrastructure
- Self‑hosting: Requires only Node.js, npm, and a working OpenSSH client. No external database or service.
- Containerization: Official Docker images are available; the repository contains a
Dockerfilethat builds from Alpine, making it suitable for micro‑service architectures or Kubernetes deployments. - Scalability: Each terminal session consumes a child process, so horizontal scaling (e.g., via a reverse proxy like Nginx or Traefik) is straightforward. Load balancers can be configured to preserve WebSocket connections.
- Resource footprint: Minimal RAM (≈30 MB per session) and CPU usage; ideal for lightweight dev environments or internal dashboards.
Integration & Extensibility
- API Gateway: WeTTY can be exposed behind an API gateway, allowing token‑based authentication or OAuth integration before establishing the WebSocket.
- Custom UI: The static assets can be modified or replaced; developers can embed the terminal in existing admin panels.
- Webhooks: While not native, the event system can be extended to trigger external webhooks on session start/stop.
- License: MIT, encouraging modification and redistribution without copyleft constraints.
Developer Experience
- Documentation: Comprehensive README with CLI reference, configuration examples, and deployment notes. The
docs/directory contains deeper technical details. - Community: 41 contributors; active issue tracker and pull request flow. The MIT license lowers barriers to contribution.
- Configuration: Simple command‑line flags cover most use cases; fallback to default
/bin/loginwhen run as root, or SSH to localhost otherwise. - Testing: The codebase includes unit tests for the WebSocket handler and SSH spawning logic, ensuring reliability across Node.js versions.
Use Cases
- Internal DevOps Dashboards: Embed a terminal in CI/CD portals to allow engineers to run commands on remote build agents without exposing SSH directly.
- Educational Platforms: Provide students with isolated shell sessions over HTTPS for coding exercises, leveraging WeTTY’s lightweight footprint.
- Remote Administration: Deploy a secure, HTTPS‑only shell for system administrators to manage servers from any browser.
- Embedded Systems: Run WeTTY on IoT devices (e.g., Raspberry Pi) to expose a terminal over the local network without installing full SSH servers.
Advantages Over Alternatives
- Performance: WebSocket streaming reduces latency compared to Ajax polling used by older terminals.
- Feature Richness: xterm.js offers a modern terminal UI, color schemes, and mouse support that legacy terminals lack.
- Ease of Deployment: Zero‑config Docker images, no external services
Open SourceReady to get started?
Join the community and start self-hosting WeTTY today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
Vanilla Cookbook
Simplify recipe management with smart conversion and AI assistance
Mindwendel
Collaborative idea‑generation and upvoting platform
Piler
Open‑source email archiving with built‑in SMTP and full search
Kanboard
Simple self‑hosted Kanban for focused project management
UVDesk
Open‑source helpdesk for multi‑channel support
Buku
Portable, privacy‑first bookmark manager with CLI and web UI
