Deploying WeTTY
Introduction
WeTTY (Web + TTY) is a terminal emulator that runs in your web browser, providing SSH access to remote servers without requiring a dedicated SSH client. It creates a bridge between your browser and SSH servers, allowing you to manage systems from any device with a web browser.
Built with Node.js and using xterm.js for terminal emulation, WeTTY provides a responsive and feature-rich terminal experience that works on desktop and mobile devices.
Key features of WeTTY include:
- Browser-Based SSH: Access SSH servers directly from your web browser
- No Client Required: Works on any device with a modern web browser
- HTTPS Support: Secure connections with TLS encryption
- Authentication Options: Support for password and SSH key authentication
- Customizable: Configurable terminal colors, fonts, and behaviors
- Mobile-Friendly: Responsive design works on tablets and phones
- Session Persistence: Maintain sessions across page reloads
- Copy/Paste Support: Standard clipboard operations
- URL-Based Access: Direct links to specific SSH hosts
- xterm.js Terminal: Modern terminal emulation with full feature support
This guide walks you through deploying WeTTY on Klutch.sh using Docker for web-based terminal access.
Prerequisites
Before deploying WeTTY on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your WeTTY configuration
- SSH server(s) you want to connect to
- Basic familiarity with Docker and SSH concepts
Repository Structure
Create a GitHub repository with the following structure:
wetty-deploy/├── Dockerfile└── .dockerignoreDockerfile
Create a Dockerfile in your repository:
FROM wettyoss/wetty:latest
# WeTTY web interfaceEXPOSE 3000
# The base image handles the entrypointEnvironment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
SSHHOST | No | localhost | Default SSH host to connect to |
SSHPORT | No | 22 | SSH port |
SSHUSER | No | - | Default SSH username |
SSHAUTH | No | password | Authentication method (password, publickey) |
BASE | No | /wetty | Base URL path |
PORT | No | 3000 | WeTTY listen port |
TITLE | No | WeTTY | Browser tab title |
Deployment on Klutch.sh
- Push your Dockerfile to your GitHub repository.
- Log in to Klutch.sh and create a new project.
- Create a new app within your project and connect your GitHub repository containing the Dockerfile.
- Configure the deployment settings: - Select **HTTP** as the traffic type - Set the internal port to **3000**
- Add environment variables: - `SSHHOST`: The SSH server to connect to - `SSHPORT`: SSH port (default 22) - `SSHUSER`: Default username (optional) - `BASE`: Set to `/` for root path access
- Click **Deploy** and wait for the build to complete.
- Access your WeTTY instance at the provided URL to open a terminal session.
Usage
Direct Connection
Navigate to your WeTTY URL. If SSHHOST and SSHUSER are configured, you will be prompted for the password directly.
Custom Host Connection
Access different hosts by URL:
https://your-wetty.klutch.sh/wetty/ssh/user@hostnameSecurity Considerations
- HTTPS Only: WeTTY transmits credentials, so always use HTTPS (provided by Klutch.sh)
- Strong Passwords: Use strong SSH passwords or key-based authentication
- Network Security: Ensure your SSH servers are properly secured
- Session Timeouts: Consider implementing session timeouts for idle connections
Troubleshooting
Cannot Connect to SSH Host
Verify the SSH host is reachable from your Klutch.sh deployment and that credentials are correct.
Terminal Display Issues
Clear browser cache or try a different browser. WeTTY works best in modern browsers.