How I Use My Raspberry Pi’s Terminal From My Android Phone

Ever wanted to send commands to your Raspberry Pi (or another SBC), but didn’t have an available and convenient PC to SSH with? I did too, until I found the right software for my Android phone.

For a long time, whenever I needed to troubleshoot or perform maintenance on my headless Raspberry Pi, I’d walk to my office, power on my PC, pop open a terminal, and connect to the Pi via SSH. It’s simple enough, but sometimes I feel just plain lazy. In those situations, I prefer to just get the job done with the Android phone that, for better or worse, I keep within arm’s length at pretty much all times.

raspberry pi 5-1

Brand

Raspberry Pi

CPU

Cortex A7

It’s only recommended for tech-savvy users, but the Raspberry Pi 5 is a tinkerer’s dream. Cheap, highly customizable, and with great onboard specs, it’s a solid base for your next mini PC.


Get a Linux Terminal on Android With Termux

It turns out that getting a terminal with SSH capabilities is super simple with Termux for Android. The mobile app gives you a terminal emulator with some advanced features like terminal tabs, ZSH support, and Python capabilities.

You can download Termux from Google Play, though you should be aware some features are paywalled in that version. I recommend downloading from the F-Droid app store instead, if possible.

Another popular option we’ve recommended in the past is Termius, which is available for both Android and iPhone. It’s very slick compared to Termux, and while it’s a paid app, it does have a free tier that’s good enough. It’s intended for professionals and other advanced users, though, and it also requests a sign-up on launch, which is annoying if you prefer not to register.

The choice is up to you what app you use. I’m sticking with Termux. It’s simple and good enough for my current mobile SSH needs.

What About the Official Linux Terminal for Android?

If you’ve been keeping up with the latest Android updates, you may be wondering why I’m not recommending the Linux terminal that has come to Android phones.

The answer is simply that, at the time of writing, Android’s native Linux terminal just isn’t up to the task. I’ve tested it on two different Google Pixel phones, which I presume to be the ideal environment for testing Google’s own mobile apps. On the first one, the Pixel 6, simply launching the terminal completely crashed the phone and caused it to reboot. On the newer and more capable Pixel 8 Pro, I was able to launch it and successfully install and use SSH, but I still had frequent crashes.

TL;DR: I’m not relying on the Android-native Linux terminal emulator for Raspberry Pi maintenance right now, and I don’t think you should either. If you’re reading this well past October 2025, perhaps it’s more stable, but I’ll be sticking with Termux for the time being.

Installing SSH on Termux

After downloading Termux, it’s time to start running commands. You can type into the command line using your preferred Android keyboard. You’ll notice Termux supplies a few special keys on above it, including Tab, Ctrl, Alt, and Home. That way you can do things like tab completion and common Bash hotkeys.

For what I needed to do, my first order of business was getting an SSH client installed and running. In Termux’s package manager, you can choose between OpenSSH and Dropbear secure shell suites. I chose Dropbear because it’s what I’m used to, but you can use either; both will get you a usable SSH client.

I installed Dropbear by running this command in Termux:

pkg install dropbear

If this is the first time you’re installing something in Termux, it may take a few minutes while some mirror testing happens. You’ll next be prompted to confirm the installation by typing Y and hitting Enter with your keyboard.

Enabling SSH on the Raspberry Pi

Your Raspberry Pi won’t, by default, allow remote connections since doing so is a security risk. You need to enable remote access connections with specific protocols first, so I enabled SSH connections first.

If you have Raspberry Pi OS with a desktop, you can simply open up Control Centre, switch to the Interfaces tab, and change the SSH option to “Enabled.” Easy as Pi.

If you want to use the terminal, you can run this command:

sudo raspi-config

Navigate the interface to Interfacing Options > SSH and follow the prompts to install.

Personally, I use DietPi instead of Raspberry Pi OS. To configure an SSH server, I ran:

sudo dietpi-software

In the DietPi Software menu options, I selected “SSH Server.”

DietPi software menu with the SSH Server option highlighted.

From there you can choose between setting up Dropbear and OpenSSH. I use Dropbear because it’s what DietPi recommends.

Connecting to the Raspberry Pi With Termux

Once you have an SSH server on your Pi, and you have an SSH client installed in Termux, it’s time to connect. I made sure my Android phone was on the same network as the Pi, and then I issued this command:

ssh dietpi@192.168.1.121

Here I’m specifying the user I want to log in as, dietpi, and my Raspberry Pi’s IP address. If you’re not sure what you need to enter, the user with sudo privileges is usually “pi” (without quotes), and finding your IP address on Linux is easy.

If you’re using a port other than the standard 22, you’ll need to specify it with a flag, such as:

ssh -p 8022 pi@192.168.1.121

If you’re not sure what port you’re using, then it’s probably 22, and you don’t need to specify that.

The first time you connect via SSH, you’ll be asked if you want to add your Raspberry Pi to your SSH client’s trusted hosts file. You can answer yes. You’ll then be prompted for your user password. As they say in the movies, “You’re in.”

From there I can issue commands and read output like I would in any SSH connection or on the Raspberry Pi itself.


Termux can save sessions, and for extended periods if you allow it to run in the background. However, to keep your sessions intact even when Termux gets shut down, you can install and run tmux on your Raspberry Pi. With a terminal multiplexer like tmux, you can pick back up where you left off even when you temporarily lose your SSH connection.

Leave a Comment

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

Scroll to Top