Ever wish you could quickly share your terminal session with someone without multiple layers of hassle? With ttyd, you can. This little utility turns your terminal into a live, interactive web app. No screen sharing. No tricky setups. Just your terminal, on the web, ready to go.

What Is ttyd and How Does It Work

ttydis a lightweight command-line tool that lets you share your terminal over the web with just a single command. You don’t require any complicated setup or any other third-party services. It’s a simple way to turn your local terminal into a web-accessible one.

At its core, ttyd wraps any command you want (such as a shell likebashorzsh) and serves it through a secure, browser-based interface. You start it up, and it launches a web server that anyone connected to your network can access to interact with your terminal in real time, directly from their browser. Think of it like screen sharing for your terminal, only more interactive and accessible.

Creating a simple ttyd session over the web.

Whatever activities others do on the shared terminal happen in real-time on your system and stay there permanently. For example, you share a terminal session. Someone enters that session and creates a new file. That file is actually created on your system and stays there. So, everything is in sync.

Especially if you open your ttyd server up to the wider web, it’s handy for remote support, quick demos, collaborative troubleshooting, or even managing a headless device from afar. It’s also fast and responsive due to being created with libuv and WebGL2.

Accessing the Linux terminal on the web via ttyd.

This also means that if your session falls into the hands of the wrong person, things can get troublesome. However, ttyd comes with several security mechanisms, which I’ll show you later.

Installing ttyd on Linux

You can install ttyd in multiple ways on Linux. The developers recommend downloading the installation binary from the official GitHub page for installation. Go to thereleases page. Choose the binary version that’s suitable for your system.

I will go with the x86_64 version since that’s what my system supports. you may also usethe wget commandto download the file.

Sharing a Vim session on the web via ttyd.

Note that your command may change slightly depending on the latest version of the binary as well as the architecture. Once downloaded, provideexecutable permissionto the file viachmod.

If you have Homebrew set up, you’re able to use that to install ttyd.

Sharing a top session on the web via ttyd.

If you haveSnap enabledon your system, you’re able to use that too.

If you want tobuild the app from source, that’s also possible. First, update your system.

Creating writable session using ttyd.

Install the necessary dependencies and tools with this command:

Clone the GitHub repository, navigate into the “ttyd” directory, create a “build” directory, and navigate into it.

Logging in with your system account in a ttyd session.

Finally, build the app.

For demonstration, I’ll be using the app from the GitHub release page.

For a simple use, pass any Linux command to ttyd.

This created a web server session on http://localhost:7681. Visit the URL on your web browser to see it.

The default port is 7681​​​​​​. If you want to change the port, you’re able to do that by adding the -p option.

Creating a ttyd session with authentication.

This time, you’ll need to visit http://localhost:7777 to find the session. You can also view various terminal tools. Let’s tryVim.

Even the top tool or any othersystem monitoring software.

Exploring Advanced Options

There are many options in ttyd that make your session more interactive and fruitful. The default sessions I created earlier were read-only. That means you can’t write anything in the terminal from the browser. To make it writable, you need to pass the -W or –writable option.

You can add your device’s login system to your share.

If you face any root permission errors, precede it withthe sudo command.

You also need the -W option for typing your username and password.

If you want to add some security to your session, you can add username and password authentication using the -c option.

With this, any user trying to join the session will be required to input a username and a password. There are other security options available as well, such as adding SSL encryption.

There are many more things to try out in ttyd. If you’re stuck or want to explore more, try using the -h flag to display the help mode to check the available options. You can also check the official GitHub for more information. Many great Linux tools allow you toshare your Android screenor evenrecord quick terminal sessions.