Linux Terminal & SSH: Complete Guide
Learn how to use Pocket Code's built-in terminal with native Linux, SSH, key authentication, and SFTP for local and remote development.
Linux Terminal & SSH on Android
One of Pocket Code's most powerful tools is its integrated terminal: native Linux built in for local development and full SSH for remote servers.
SSH: Your server in your pocket
Quick setup
Connecting to your server is simple. Pocket Code supports both password and SSH key authentication:
# Generate an SSH key from Pocket Code
ssh-keygen -t ed25519 -C "pocket@code"
# Copy the key to your server
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server.dev
Once configured, save the connection as a favorite and connect with a single tap.
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: Up to 5 simultaneous connections (Premium)
- Auto keepalive: Never lose connection due to inactivity
Example: Deploy from your phone
# Connect to production server
ssh deploy@production.myapp.com
# Update and deploy
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 .
Native Linux terminal
Pocket Code ships with a fully integrated Linux terminal β no extra installs needed:
Tools available out of the box
# Python, Node.js and bash included
node --version # v20.x
python --version # 3.12.x
bash --version
# Run scripts directly
python my_script.py
node server.js
bash deploy.sh
Full local development
# Create a React project
npx create-react-app my-app
cd my-app
npm start
# Or a Python server
python -m http.server 8080
# Or compile a Go program
go build -o myserver main.go
./myserver
Productivity tips
1. Useful aliases
Create aliases in ~/.bashrc for your frequent commands:
alias gs="git status"
alias gp="git pull && git push"
alias deploy="ssh deploy@prod 'cd /app && git pull && pm2 restart all'"
alias logs="ssh deploy@prod 'tail -f /var/log/app.log'"
2. SSH Tunneling
Access remote services as if they were local:
# Access a remote database
ssh -L 5432:localhost:5432 user@server.dev
# Now you can connect to PostgreSQL on localhost:5432
psql -h localhost -U myuser -d mydb
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
| Feature | Free | Premium |
|---|---|---|
| SSH connections | 2 | Unlimited |
| Simultaneous sessions | 1 | 5 |
| SFTP | β | β |
| Port forwarding | β | β |
| Keepalive | β | β |
| Native Linux terminal | β | β |
Pocket Code's terminal lets you manage servers, deploy apps, and develop locally β all from your Android device. Download it free and start working from anywhere.