Want to share your Raspberry Pi terminal over the browser? Install ttyd. It’s an open-source program that enables users to access the Linux terminal on the browser. Thus, it can open the opportunity for other users to access the terminal from a remote location using the system IP address.
Follow this tutorial to learn how to set up and use ttyd to make your Raspberry Pi accessible from your browser.
Share your Raspberry Pi Terminal on the Browser Using ttyd
To install and utilize ttyd on your Raspberry Pi system, follow the step-by-step instructions provided below:
Step 1: Before installing ttyd on Raspberry Pi, ensure the required packages on the system are updated.
Step 2: Then install a few dependencies on Raspberry Pi from the following command:
Step 3: Now use the following command to copy the ttyd source files from the GitHub website save it on Raspberry Pi system:
Step 4: After downloading, use the command below to access to the ttyd source directory:
Step 5: Then create a build directory inside the ttyd source directory and navigate to it from the following command:
Step 6: Inside the build directory, run the cmake command to build packages required for installing ttyd on Raspberry Pi.
Step 7: Now, to perform the ttyd installation on Raspberry Pi, run the make and make install command on the system.
Step 8: Run the command to verify that ttyd is successfully installed on the system.
Step 9: Once the installation is completed, you can run the ttyd daemon on the terminal from the following command:
Note: If you run the above command with sudo, you will get the root privileges access on the browser.
Step 10: After the execution of the above command, you can access your Raspberry Pi terminal from any web browser by navigating to the IP address of your Raspberry Pi (find through hostname -I command) and the port number you specified earlier.
Every command you desire may now be executed directly from your browser.
Conclusion
For remote access to your Raspberry Pi terminal, ttyd is a fantastic utility. First, you have to download the source file using the “git” command. Then inside the ttyd source directory, run create a build directory and build packages through the “cmake ..” command. After that run the “make” and “make install” command to complete the ttyd installation. Then to access the terminal on the web, run the ttyd daemon on the terminal and use the Raspberry Pi IP address to open the terminal on any browser.