GoTTY is a tool which allows to share terminal in the browser. It converts command line tools into web applications. GoTTY is written in Go programming language.
This tutorial shows how to install GoTTY on Ubuntu 20.04.
Download the latest GoTTY release from GitHub:
wget -qO gotty.tar.gz https://github.com/yudai/gotty/releases/latest/download/gotty_linux_amd64.tar.gz
tar.gz file to
sudo tar xf gotty.tar.gz -C /usr/local/bin
Now GoTTY can be used as a system-wide command for all users.
We can check GoTTY version as follows:
tar.gz file is no longer needed, we can remove it:
rm -rf gotty.tar.gz
Run GoTTY with your desired command using the following syntax:
<COMMAND> is a name of the command that will be shared in the browser. For example, we can display currently running processes on system using
top command as a web application.
GoTTY starts a web server and prints URL. By default, a server is listening on a port 8080. Open a web browser and navigate to given URL to view output of the command.
By default, GoTTY doesn't require any authentication for clients. We can enable HTTP basic authentication with
--credential option. When client opens URL, he need to enter the username and password to connect to the server.
gotty --credential admin:mypass top
If you want to completely remove GoTTY, delete executable file:
sudo rm -rf /usr/local/bin/gotty