Knowledge Base

RTerm Port Forward — what it is, who it’s for, how to use it

Port forward is the SSH tunnel feature in RTerm (Android SSH terminal). Your phone opens a small door on 127.0.0.1. Traffic that goes through that door is sent encrypted inside SSH and exits as if it started on your server.

Same idea as on a laptop:

In the app: open a session → menu → Port forwards. Rules use the current session’s login (host, user, key). Saved forward specs store no passwords. Listeners bind on the phone only (127.0.0.1), not the whole Wi‑Fi. Forwards stop when the last SSH session ends.

💡 If you only use RTerm for a shell (tmux, htop, vim), you can ignore this feature. When you need a private dashboard or DB that only listens on the server, this is the tool.

Who is it for?

Person Useful?
Shell-only SSH (htop, git, editors) Rarely
Dev / admin with dashboards or DBs on the server Yes
Services bound only to server localhost (not public) Yes
Want the phone browser to exit from the VPS Yes (SOCKS)
Casual terminal use Usually skip

Why use it? (five reasons)

  1. Private services stay private — Grafana, Portainer, admin UIs, etc. can listen on 127.0.0.1 only. The tunnel reaches them without opening extra ports on the public internet.
  2. No full VPN for one job — For “open this one thing on my VPS,” SSH forward is enough.
  3. Databases and local APIs — Postgres / MySQL / Redis on the server’s localhost map to a phone-local port for a GUI app or test client.
  4. Internal network via the server — The server can reach 10.x or office hosts; the phone usually cannot. A local forward targets hosts as seen from the server.
  5. SOCKS = full proxy — Browser (or any SOCKS-aware app) uses the VPS path for many sites, not just one port.

What RTerm supports

1) Local forward

Phone 127.0.0.1:PHONE_PORTfrom the server’s view TARGET_HOST:TARGET_PORT

Example:

Then open on the phone: http://127.0.0.1:8080 → hits whatever is on the server’s port 3000.

2) SOCKS proxy

Phone 127.0.0.1:PHONE_PORT (e.g. 1080) becomes a SOCKS5 proxy. Point a browser or system proxy there; each request is made from the server.

How to use it

Local example — web app only on the server

On the server (example):

python3 -m http.server 3000 --bind 127.0.0.1

On the phone:

  1. Connect SSH in RTerm.
  2. ▶ → Port forwards.
  3. Mode: Local.
  4. Phone port: 8080.
  5. Target: 127.0.0.1 / 3000.
  6. Save & start (or Start on a saved rule).
  7. Phone browser: http://127.0.0.1:8080.

Stop the forward from the same screen when finished.

SOCKS example — browse “as the VPS”

  1. ▶ → Port forwardsSOCKS.
  2. Phone port: 1080.
  3. Start.
  4. Set proxy to SOCKS5 127.0.0.1:1080 (browser or system, if supported).
  5. Open sites; “what is my IP” should match the VPS.
  6. Turn the proxy off when done (or stop the forward).

Not every Android browser makes SOCKS easy — some need a proxy-capable browser or system setting.

Concrete use cases

Goal Mode Typical setup
Grafana only on server localhost:3000 Local phone 3000 → server 127.0.0.1:3000
Admin UI / n8n / Home Assistant on VPS localhost Local same pattern
Postgres on server, GUI on phone Local phone 5432127.0.0.1:5432
Host only the server can see (10.0.0.5:80) Local phone 808010.0.0.5:80
Browse internal wiki / use VPS IP SOCKS SOCKS on 1080
Avoid opening extra cloud firewall ports Local/SOCKS service stays on 127.0.0.1; only SSH public

What it is not

Short summary

Question Answer
What? Encrypted tunnel: phone local port → via SSH → something reachable from the server
Who? Devs/admins reaching private or internal services from the phone
Why? Access without exposing ports; no separate VPN for simple cases
How? ▶ → Port forwards → Local or SOCKS → Start → use 127.0.0.1:port or a SOCKS proxy
For what? Dashboards, DBs, internal hosts, browser-via-VPS

Part of RTerm

RTerm is a lean, SSH-first Android terminal (Rust core + Jetpack Compose) with sticky modifiers, correct key combos, multi-session tabs, macros, remote file browser, and this port-forward UI. Port forward is an optional power tool — shell-first users can leave it alone; when you need a private service on the VPS from your phone, it’s ready under ▶ → Port forwards.