Services

How to Set Up a Web Terminal with ttyd

Published:
Kelvin Wuite
By Kelvin Wuite • 6 min read
Share

ASD includes a built-in web terminal powered by ttyd. It gives you a full shell session in any browser — desktop, tablet, or phone. No SSH client needed. Combined with ASD tunnels, you can access your development machine from anywhere.

What you get

  • Full shell session in any browser
  • Works on desktop, tablet, and mobile
  • No SSH client installation needed
  • Remote access via ASD tunnels
  • Password-protected by default

Prerequisites

  • ASD CLI installed (asd init to set up your workspace)
  • The ttyd binary (auto-downloaded during asd init)

Step 1: Set credentials

ttyd requires authentication. Add credentials to your .env file:

TTYD_USERNAME=admin
TTYD_PASSWORD=your-secure-password

If you ran asd init, these are already set with auto-generated values via the macro system.

Step 2: Start the terminal

asd terminal start

ttyd starts on an automatically allocated port. To see the status and access URLs, run the interactive menu:

asd terminal

Step 3: Access it

After starting, you get three access methods:

MethodURL FormatUse Case
Localhttp://localhost:<port>/Same machine
Caddyhttp://asd.localhost/asde/ttyd/Local network
Tunnelhttps://hub-xxx.cicd.eu1.asd.engineer/asde/ttyd/Anywhere

The asd terminal menu shows all URLs with the correct port and credentials for your setup.

Remote access via tunnel

To access your terminal from anywhere in the world:

# Start the terminal
asd terminal start

# Enable tunnels (if not already active)
asd net apply --tunnel

# Get the remote URL
asd terminal
# Look for the "Tunnel:" URL in the menu

Share the tunnel URL and credentials with anyone who needs access to your machine.

Configuration options

All settings are configured via environment variables in .env:

VariableRequiredDefaultDescription
TTYD_USERNAMEYes—Login username
TTYD_PASSWORDYes—Login password
TTYD_PORTNo(auto)Port number
TTYD_SHELL_CMDNobashShell to run
TTYD_CWDNoworkspaceStarting directory
TTYD_PATHNo/URL path prefix

Example custom configuration:

TTYD_USERNAME=developer
TTYD_PASSWORD=dev-secret-123
TTYD_SHELL_CMD=zsh
TTYD_PORT=7681

Security considerations

ttyd provides full shell access — treat credentials seriously:

  • Use strong passwords (12+ characters)
  • Don't share credentials publicly
  • Stop the service when not needed: asd terminal stop
  • Monitor who has access

When project-level basic auth is enabled in asd.yaml, ttyd routes through Caddy get an additional layer of protection.

Stopping the terminal

asd terminal stop

Troubleshooting

ProblemSolution
"Missing username/password"Set TTYD_USERNAME and TTYD_PASSWORD in .env
"Port in use"asd terminal stop or kill the process on that port
"Binary not found"Run asd init to reinstall binaries
"Can't connect via tunnel"Check asd net — ensure the hub service has a tunnel URL
"Connection drops"Check network stability; tunnels auto-reconnect

What's next

Kelvin Wuite
Written by

Kelvin Wuite

Kelvin Wuite is the founder of Accelerated Software Development B.V. With over eighteen years of development experience, he has witnessed the same patterns repeat across every software team: endless documentation, manual preparation, environment mismatches, and fragmented collaboration. His drive is to remove these barriers, enabling engineers to work together in unified environments with shorter feedback loops and hands-on collaboration. Since 2015 he has been refining these ideas, leading to ASD — a platform designed to create a faster, more integrated way for development teams to collaborate in an age where AI is thriving.

Related Articles