How to SSH from an Android phone
Connecting to a server from an Android phone is not something most people plan for. Then the production server goes down at 11pm and your laptop is in another room, or you are on the road with just your phone.
Android, unlike iOS, is reasonably flexible for SSH. You have three realistic options: Termux (a full Linux terminal), JuiceSSH (a purpose-built SSH app), or a browser-based client. All three work. They have genuinely different trade-offs, and the right choice depends on what you are trying to do and how often you are doing it.
The key management problem to understand first
Before choosing an SSH client for Android, it is worth thinking about how you will handle private keys.
Your SSH private key is the credential that authenticates you to your servers. It lives on your main computer in ~/.ssh/. If you want to SSH from your phone, that key needs to be accessible from your phone too.
Your options are:
- Copy the key to the phone's storage. It lives in a file on your phone. If your phone is lost or stolen, someone could potentially access that key.
- Use the app's key storage. Apps like JuiceSSH and Termius store keys in their own encrypted databases. Termius also offers cloud syncing, which means your keys are stored on their servers.
- Paste the key into a browser session. The key lives in the browser's localStorage, is never sent to a cloud service, and disappears when you clear the browser or close the session.
None of these is objectively "wrong." The right answer depends on how sensitive your servers are and how comfortable you are with each trade-off.
Option 1: Termux
Termux is a free, open-source terminal emulator for Android that requires no root access. It includes a full package manager (pkg) modeled on Debian's apt, which means you can install real Linux tools including OpenSSH.
Setting up SSH in Termux
Install Termux from F-Droid, not the Google Play Store. The Play Store version stopped receiving updates and is outdated. F-Droid requires sideloading, but the F-Droid app itself is straightforward to install from f-droid.org.
Once Termux is running, install OpenSSH:
pkg update
pkg install openssh
Then connect to your server exactly as you would from a desktop terminal:
ssh user@your-server-ip
If you use key-based authentication (which you should), you have two options for getting your key into Termux:
Option A: Generate a new key pair inside Termux
ssh-keygen -t ed25519 -C "android-phone"
This creates a key pair in Termux's ~/.ssh/ directory. Copy the public key (~/.ssh/id_ed25519.pub) to your server's ~/.ssh/authorized_keys using password authentication first, then disable passwords.
Option B: Transfer an existing private key to Termux
Grant Termux access to your phone's storage:
termux-setup-storage
Then copy the key from your phone's Downloads or Documents folder:
cp ~/storage/downloads/id_ed25519 ~/.ssh/
chmod 600 ~/.ssh/id_ed25519
Then connect with:
ssh -i ~/.ssh/id_ed25519 user@your-server
What Termux is good at
Termux is the most capable option. You get a full Linux environment: shell scripting, vim, git, python, rsync, scp. If you regularly do serious work from the command line, Termux on Android gives you something close to a real development environment.
It also lets you run SSH as a server itself (sshd), which means you can SSH into your own phone from another machine.
Where Termux falls short
The typing experience on a phone touchscreen is painful for anything beyond short commands. The standard Android soft keyboard does not have Ctrl, Escape, or function keys, which makes editing files in vim or nano awkward. Termux includes a special key row at the top of the screen (with Tab, Ctrl, Alt, etc.), but it is small and requires precise tapping.
Termux is at its best with a Bluetooth keyboard. If you have one and you do this regularly, it starts to feel genuinely usable.
Option 2: JuiceSSH
JuiceSSH is an SSH client built from the ground up for Android. Unlike Termux, which is a general-purpose terminal, JuiceSSH is specifically designed for connecting to servers and managing SSH sessions.
What JuiceSSH does well
The on-screen keyboard. JuiceSSH adds a row of SSH-specific keys above the Android keyboard: Ctrl, Escape, Tab, arrow keys, function keys. This makes running commands, using terminal applications, and navigating with vim or htop actually tolerable on a touchscreen.
Session management. You save your servers as connections and reconnect with one tap. You can organize them into groups, which is useful if you manage more than a handful of servers.
Key management. You can import SSH private keys directly into the app's encrypted key store. The keys are stored locally on your device, not synced to a cloud service by default (the Pro version adds sync, but it uses their own service).
The free version covers SSH with key authentication, which is enough for most people. The paid Pro upgrade (around $2 USD, one-time) adds port forwarding, a Snippets feature for frequently used commands, and a few other extras.
Where JuiceSSH falls short
JuiceSSH has not received major updates in some time. The UI is a bit dated, and the app's development seems slower than it used to be. It is still functional and maintained, but it is not actively developed the way Termux is.
You are also trusting the app with your server credentials and private keys. The keys are stored locally and the app does not appear to transmit them, but it is a closed-source application so that is harder to verify than with Termux.
For users of Termius: Termius is a well-maintained alternative with a more modern UI, cross-device syncing, and team features. It is subscription-based ($10/month or $50/year for the full feature set). If you SSH regularly across multiple devices and want everything in sync, it is worth considering. If you SSH from your phone occasionally, the subscription is probably not worth it.
Option 3: Browser-based SSH
If your Android phone has Chrome or Firefox installed, you can SSH from the browser without installing any additional apps. The terminal runs in a browser tab. You navigate to a URL, enter your connection details, paste your private key, and connect.
How it works
Browser-based SSH clients use a backend WebSocket proxy to translate between browser traffic and raw SSH connections. Your browser cannot open TCP port 22 directly, but it can connect via WebSockets, and the proxy bridges that to the server. Critically, the encryption happens on your device; your actual commands travel through an encrypted SSH session from your phone to your server.
SSHDock works in Chrome on Android. Open the browser, navigate to the app, enter your server's hostname, username, port, and paste your private SSH key into the key field. The key is stored in your browser's localStorage. It never leaves your phone's browser, and it is not synced to any cloud service.
You can add SSHDock to your Android home screen through Chrome's "Add to Home Screen" option in the three-dot menu. It installs as a Progressive Web App and opens in a full-screen mode that behaves like a native app.
What the browser option is good for
Browser-based SSH is the fastest path if you need to connect once, quickly, without any installation or setup. There is no app to download, no key files to move around, no connection profiles to configure. Open the browser, connect, get in, do what you need to do.
It is also the most secure option from a key management perspective. The private key lives in localStorage for the duration of your session. If you are on a shared phone or borrowing a device temporarily, clearing the browser's site data afterward removes all traces.
Where the browser option falls short
The on-screen keyboard in a browser lacks the SSH-specific keys (Ctrl, Escape, Tab) that JuiceSSH adds. You can still use modifier keys through long presses or the phone's accessibility settings, but it is less comfortable.
Also, if you are doing anything intensive, like keeping a session open for hours or running persistent processes, a native app is more stable than a browser tab that can be killed by the system to reclaim memory.
Quick comparison
| | Termux | JuiceSSH | Browser (SSHDock) | |---|---|---|---| | Install required | Yes (from F-Droid) | Yes (from Play Store) | No | | Key storage | File on device | App's local store | Browser localStorage | | Cloud sync | No | Pro only (opt-in) | No | | SSH-specific keyboard | Partial (built-in row) | Yes (purpose-built) | Limited | | Full Linux environment | Yes | No | No | | SFTP/SCP support | Yes (via CLI) | Pro version | No | | Cost | Free | Free (Pro ~$2) | Free |
Which one to choose
Use Termux if you want a real Linux environment on your phone, especially if you pair it with a Bluetooth keyboard. It is the most capable option and completely free and open-source.
Use JuiceSSH if you want a polished, phone-native experience for SSH without the setup overhead of Termux. The SSH-specific keyboard makes a real difference for quick sessions on a touchscreen.
Use browser-based SSH if you need to connect quickly without installing anything, or if you are on a borrowed device and do not want to leave any apps or key files behind.
All three have one thing in common: typing on a phone is uncomfortable for anything more than a quick command. If you find yourself doing sustained server work this way, even a small wireless keyboard makes a significant difference.