What’s a Headless Computer?
A headless computer is a computer without a monitor. The computer can be anything – it doesn’t even have to be a Raspberry Pi. To give an example, the web server that lets you access this webpage from any part of the world is probably a headless computer from some data facility. Headless computers can be controlled through different means. Some listen to a webpage to receive commands, while others let you remotely connect and control them via commands on a console. This time, we are doing the latter.
Turn Your Raspberry Pi into a Headless Computer
We are splitting this up into three parts. The first one is for downloading PuTTY for Windows, the second for preparing the Raspberry Pi for SSH, and the last for logging in to the Raspberry Pi through Windows via SSH.
Download PuTTY for Windows
Prepare Your Raspberry Pi
These instructions assume that your Raspberry Pi has already been set up with Raspberry Pi OS.
Log in via SSH
What Can You Do with Your Headless Raspberry Pi
Now that you know how to access the terminal on your Raspberry Pi through Windows via SSH, you need to know how to do stuff with it. You have to remember that the Raspberry Pi OS is based on the Debian distro for Linux, so you can use Linux terminal commands on the PuTTY terminal when doing most actions. However, that only works if you have the Raspberry Pi OS on your Raspberry Pi. It won’t work if you have something else on your system, like Windows 11.
Important Linux Terminal Commands
Given all that, there are some commands you have to know if you’re not used to doing stuff on the Linux terminal yet. The following are a few codes you might want to know.
Turn off computer: sudo shutdown -h now Reboot computer: sudo reboot -h nowChange directories: cd
Without a file explorer to click on, you’re left to type where you want to go on the terminal window. Use cd to change directories and dir to show what’s inside the current directory. Reading a little bit deeper into the Linux virtual directory structure might help you better understand how cd works.
Making new folders: mkdir
nanois perhaps the simplest text editor out there and lets you write text files and programming scripts on the go. While it’s not an IDE that can compile code for you, it’s good enough when you’re just doodling with coding ideas.
Deleting files and folders: rm
Check out this article for more details on deleting files in Linux.
Installing packages: sudo apt
Typically, this command is used to install or uninstall one or more packages. For instance, you can install the Python 3 package for controlling the Raspberry Pi’s GPIO pins by typing sudo apt-get install python3-rpi.gpio. You may want to learn more about apt if you want to do more software-related things on the Raspberry Pi. Image credit: close-up of raspberry pi pico by 123RF