Install GoTTY on Raspberry Pi

GoTTY is a command line tool that allows to share terminal in the browser. It converts command line tools into web applications. GoTTY is written using Go programming language.

This tutorial demonstrates how to install GoTTY on Raspberry Pi.

Use SSH to connect to Raspberry Pi. Download the latest GoTTY release from GitHub and extract downloaded tar.gz file.

wget -O gotty.tar.gz https://github.com/yudai/gotty/releases/latest/download/gotty_linux_arm.tar.gz
tar xf gotty.tar.gz

Move binary file to the /usr/local/bin directory and add execute permission to the file.

sudo mv gotty /usr/local/bin
sudo chmod a+x /usr/local/bin/gotty

Now GoTTY can be used as a system-wide command for all users. Run the following command to check GoTTY version:

gotty --version

The tar.gz file is unnecessary and we can remove it:

rm -rf gotty.tar.gz

It’s time to test. Run GoTTY with your desired command using this syntax:

gotty <COMMAND>

The <COMMAND> is a name of the command that you want to share in the browser. For example, we can display currently running processes on Raspberry Pi using top command as a web application.

gotty top

GoTTY starts a web server and outputs URL. By default, a server is listening on a port 8080. Open the browser and enter given URL to view command output.

Share Terminal using GoTTY

By default, GoTTY doesn’t require any authentication for clients. HTTP basic authentication can be enabled by using --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 remove GoTTY, just execute the following command to delete the binary file:

sudo rm -rf /usr/local/bin/gotty

Leave a Comment

Your email address will not be published. Required fields are marked *