Skip to content
Back to home
Back to blog
Feature

Terminal & SSH on Android: Complete Guide

Learn how to use PocketCode's built-in terminal — a real POSIX shell plus SSH, key authentication, and SFTP — for local scripting and remote development.

5 min
By Pelayo Naredo
Terminal & SSH on Android: Complete Guide

Terminal & SSH on Android

One of PocketCode's most powerful tools is its integrated terminal: a real POSIX shell for local scripting, plus a full SSH client for remote servers.

SSH: Your server in your pocket

Quick setup

SSH connections are managed from PocketCode's Connections screen, not typed as a shell command. You add a host, choose password or key authentication, and the app handles the rest:

  • Generate an Ed25519, RSA or ECDSA key in the in-app key manager (or import an existing one).
  • Add its public key to your server's ~/.ssh/authorized_keys as usual.
  • Save the connection as a favorite and connect with a single tap.

No ssh/ssh-keygen command line to memorize — key generation, hosts and port-forwarding rules all live in the SSH UI.

SSH Features

  • Key authentication: Ed25519, RSA, ECDSA
  • Port forwarding: Access remote services locally
  • Built-in SFTP: Browse and transfer files without leaving the app
  • Multi-session: multiple simultaneous connections (Premium; Free runs one at a time)
  • Auto keepalive: Never lose connection due to inactivity

Example: Deploy from your phone

Once you connect to a server from the Connections screen, you get a real remote shell — whatever tools are installed on that server are at your fingertips:

# You're now on the remote server over SSH
cd /var/www/myapp
git pull origin main
npm install --production
pm2 restart all

# Verify everything works
pm2 status
curl -s localhost:3000/health | jq .

Those commands run on the remote machine, not on your phone — the deploy toolchain lives on the server you connected to.

The local shell

The local terminal is a real POSIX shell — BusyBox ash (falling back to Android's sh) — scoped to your project workspace. It ships with the standard Unix toolbox, no extra installs needed:

# Coreutils and text tools are built in
ls -la
grep -rn "TODO" .
cat data.json | sed 's/old/new/g' > out.json
find . -name "*.log" | xargs tar czf logs.tgz
wget https://example.com/file.txt

It's ideal for file wrangling, shell scripting, chaining tools with pipes, and prepping a project before a commit — all offline.

Running code: use the editor's Run button

The local shell does not ship node, python, go or npm as commands. Instead, PocketCode runs code through the editor's Run button, backed by on-device runtimes: a bundled Node.js and CPython, a C compiler, and more via optional packs. Open a file, tap Run, and the output streams to the console. See Run code in a dozen languages for the full picture.

Productivity tips

1. Useful aliases

Set aliases for your frequent shell commands in the terminal's profile:

alias ll="ls -la"
alias gl="grep -rn"
alias h="cat *.log | tail -n 50"

(Git operations run through PocketCode's built-in Git UI, and deploys through the SSH connection to your server — not a local git/ssh binary.)

2. Port forwarding to reach remote services

Need to reach a database or service that only listens on the remote host? Add a port-forwarding rule to the SSH connection (Premium) in the Connections screen — e.g. forward the server's 5432 to a local port. Once the tunnel is up, point PocketCode's database module at that local port to browse and query the remote PostgreSQL, all through the encrypted SSH session.

3. File transfer with SFTP

The built-in SFTP explorer lets you:

  • Browse the server filesystem
  • Upload and download files with drag & drop
  • Edit remote files directly in the editor

Free vs Premium

FeatureFreePremium
SSH hosts1Unlimited
Simultaneous sessions1Unlimited
SFTP
Port forwarding1Unlimited
Local shell (BusyBox)

Linux terminal on Android: quick answers

Can you use a Linux terminal on Android? Yes — a built-in POSIX shell (BusyBox) with the standard Unix tools, plus a full SSH/SFTP client.

Is it a full Linux distribution? No — it's a BusyBox shell (coreutils), scoped to your workspace. Great for scripting and remote work, but not a distro with a package manager.

SSH and SFTP? Yes — key auth (Ed25519/RSA/ECDSA), SFTP, port forwarding and Mosh.

Run Python or Node in the terminal? Those run from the editor's Run button (on-device runtimes), not as shell commands.

Offline? The local shell works fully offline; SSH needs a connection to reach a remote server.


PocketCode's terminal lets you manage servers, deploy apps over SSH, and script locally — all from your Android device. To run code, pair it with the editor's on-device runtimes. Download it free and start working from anywhere.

The tool behind this article

Terminal & SSH

Ready to try PocketCode?

Download the app and start coding from your mobile.