Skip to content

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
└── .dockerignore

Dockerfile

Create a Dockerfile in your repository:

FROM wettyoss/wetty:latest
# WeTTY web interface
EXPOSE 3000
# The base image handles the entrypoint

Environment Variables

VariableRequiredDefaultDescription
SSHHOSTNolocalhostDefault SSH host to connect to
SSHPORTNo22SSH port
SSHUSERNo-Default SSH username
SSHAUTHNopasswordAuthentication method (password, publickey)
BASENo/wettyBase URL path
PORTNo3000WeTTY listen port
TITLENoWeTTYBrowser tab title

Deployment on Klutch.sh

  1. Push your Dockerfile to your GitHub repository.
  2. Log in to Klutch.sh and create a new project.
  3. Create a new app within your project and connect your GitHub repository containing the Dockerfile.
  4. Configure the deployment settings: - Select **HTTP** as the traffic type - Set the internal port to **3000**
  5. 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
  6. Click **Deploy** and wait for the build to complete.
  7. 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@hostname

Security 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.

Additional Resources