How to Set Up a Web Terminal with ttyd
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 initto 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:
| Method | URL Format | Use Case |
|---|---|---|
| Local | http://localhost:<port>/ | Same machine |
| Caddy | http://asd.localhost/asde/ttyd/ | Local network |
| Tunnel | https://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:
| Variable | Required | Default | Description |
|---|---|---|---|
TTYD_USERNAME | Yes | — | Login username |
TTYD_PASSWORD | Yes | — | Login password |
TTYD_PORT | No | (auto) | Port number |
TTYD_SHELL_CMD | No | bash | Shell to run |
TTYD_CWD | No | workspace | Starting directory |
TTYD_PATH | No | / | 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
| Problem | Solution |
|---|---|
| "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
- VS Code Server in the browser — full IDE alongside your terminal
- Add Basic Authentication — extra security layer for remote access
- Live Terminal in CI — use ttyd inside GitHub Actions runners
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
How to Expose Local Services with ASD Tunnels
Learn three ways to expose local services with ASD: quick expose for instant sharing, asd.yaml for daily development, and tunnel tokens for CI/CD automation.
ConfigurationHow to Configure asd.yaml for Your Project
Complete guide to configuring asd.yaml: define services, set up networking, add authentication, create automation tasks, and configure plugins for your project.
ServicesHow to Run VS Code Server in the Browser
Run VS Code in your browser with code-server and ASD. Full IDE with extensions, terminal, and Git — accessible from any device via HTTPS tunnels.