Skip to content

Using OpenCode on Mobile: Web UI vs Terminal Access

The Problem

I was on a bus last week when a pull request came in that needed my review. My laptop was at home. I grabbed my phone, opened the browser, and reviewed the code changes in OpenCode’s Web UI.

A colleague saw this and asked: “Wait, you can use OpenCode on mobile?”

Turns out many developers don’t realize OpenCode has a solid mobile experience. They think it’s desktop-only, or they’ve tried using terminal apps on iPhone and given up in frustration.

Common Assumptions:
- "OpenCode is desktop-only"
- "Terminal on iPhone is unusable"
- "Remote access requires complex VPN setup"
- "I'll just wait until I'm at my desk"

But here’s the reality: OpenCode works surprisingly well on mobile if you choose the right approach.

Two Paths to Mobile Access

I’ve tested both methods extensively, and they serve different needs:

Mobile Access Options:
|
+-- Web UI (Recommended for most)
| - Touch-friendly
| - No app installation
| - Works in any browser
|
+-- Terminal (Power users)
- Full shell access
- Requires terminal app
- Better for scripts/commands

Option A: Web UI (My Go-To)

The Web UI is what I use 90% of the time on mobile. Here’s how I set it up.

Local Network Access (Simplest)

If your phone and computer are on the same WiFi network:

Start OpenCode with network access
opencode serve --host 0.0.0.0 --port 3000

Then access from your phone at http://YOUR_LOCAL_IP:3000. You can find your local IP with:

Find your local IP
# macOS
ipconfig getifaddr en0
# Linux
hostname -I

This works, but it only works when you’re home. What about when you’re at a coffee shop or traveling?

Tailscale (What I Use)

Tailscale creates a private network between your devices. Your phone becomes part of your home network, no matter where you are.

Tailscale setup on macOS
# Install Tailscale
brew install tailscale
# Start and authenticate
sudo tailscale up
# Get your Tailscale IP
tailscale ip

Install the Tailscale app on your phone, log in with the same account, and you can access http://YOUR_TAILSCALE_IP:3000 from anywhere.

The beauty of Tailscale:

  • No port forwarding needed
  • Encrypted connection
  • Works through NAT and firewalls
  • Free for personal use (up to 100 devices)

Cloudflare Tunnel (Alternative)

If you don’t want to install apps on your phone, Cloudflare Tunnel gives you a public URL:

Cloudflare Tunnel quick setup
# Install cloudflared
brew install cloudflare/cloudflare/cloudflared
# Create a quick tunnel
cloudflared tunnel --url http://localhost:3000

This outputs a URL like https://random-name.trycloudflare.com. Open that on your phone, and you’re in.

Cloudflare Tunnel Flow:
Your Phone → https://xxx.trycloudflare.com
Cloudflare Edge
cloudflared on your computer
localhost:3000 (OpenCode)

The trade-off: anyone with the URL can access it, so consider adding authentication or using a more permanent tunnel with access controls.

Option B: Terminal Access

Sometimes I need terminal access—running scripts, checking logs, executing commands. Here’s how that works.

Install a Terminal App

iOS Options:

  • Termius - Good all-around, supports SSH keys
  • Blink Shell - Best for iOS, Vim-friendly
  • a-Shell - Local commands, no server needed

Android Options:

  • Termux - Full Linux environment on Android
  • JuiceSSH - Clean SSH client

Connect via SSH with tmux

I always run OpenCode in a tmux session so I can detach and reattach from any device:

Start OpenCode in tmux session
# Create a dedicated session
tmux new -s opencode
# Start OpenCode
opencode chat
# Detach: Ctrl+B, then D

From my phone:

Reattach from mobile
# SSH into my machine
ssh user@my-server-ip
# Reattach the session
tmux attach -t opencode

Everything is exactly where I left it—chat history, context, all preserved.

Essential tmux Commands for Mobile

Mobile keyboards make Ctrl+B awkward. Here are the commands I use most:

tmux keybindings for mobile
Ctrl+B, D - Detach (leave session running)
Ctrl+B, [ - Enter copy mode (scroll with arrows)
Ctrl+B, ? - Show all keybindings
Ctrl+B, C - Create new window
Ctrl+B, N - Next window
Ctrl+B, P - Previous window

Pro tip: Create a .tmux.conf with simpler bindings if you use tmux heavily on mobile.

Side-by-Side Comparison

I tested both approaches with the same tasks to see the difference.

Task: Review a Pull Request

Web UI:

1. Open browser on phone
2. Navigate to OpenCode URL
3. Scroll through the diff
4. Type comments with phone keyboard
5. Approve or request changes
Time: 2-3 minutes
Experience: Smooth, touch-friendly

Terminal:

1. Open terminal app
2. SSH to server
3. Attach tmux session
4. Navigate with keyboard commands
5. Scroll with tmux copy mode
Time: 3-4 minutes
Experience: Doable, but more friction

Task: Check on a Long-Running AI Task

Web UI:

1. Open browser
2. See the chat history
3. Read the latest output
4. Send a follow-up prompt if needed
Time: 30 seconds
Experience: Perfect for quick checks

Terminal:

1. Open terminal app
2. SSH and attach tmux
3. Scroll through output
4. Send follow-up
Time: 45 seconds
Experience: More steps, but gives shell access

Task: Debug a Production Issue

Web UI:

- Good for: Reading logs, reviewing code
- Limited for: Running diagnostic commands
- Verdict: Use as first pass

Terminal:

- Good for: Running any command, checking processes
- Limited for: Reading long outputs on small screen
- Verdict: Use for actual debugging

Capability Comparison

FeatureWeb UITerminal
Touch-friendlyYesNo
Code diffsVisualText-based
Phone keyboardWorks wellAwkward
Shell accessNoYes
Run scriptsNoYes
Install neededNoneTerminal app
Network setupTailscale/TunnelSSH access
Best forReview, quick checksCommands, debugging

Why I Prefer Web UI on Mobile

The key insight from my testing: Web UI is designed for touch; terminal is designed for keyboard.

On a phone, you’re stuck with a software keyboard that covers half the screen. Web UI lets you:

  • Scroll through code with swipe gestures
  • Tap to select text
  • Use dropdown menus instead of commands
  • See visual diffs instead of diff output

Terminal on mobile works, but it’s fighting against the device constraints.

Common Mistakes to Avoid

Mistake 1: Exposing OpenCode Directly to the Internet

Dangerous - do not do this
# NEVER do this:
opencode serve --host 0.0.0.0 --port 3000
# Then port forward 3000 on your router

This exposes your development environment to the world. Instead, use Tailscale or Cloudflare Tunnel.

Mistake 2: Forgetting to Start tmux Before Long Tasks

What happens:
1. Start OpenCode chat on desktop
2. Leave for coffee shop
3. Try to SSH from phone
4. Realize session isn't in tmux
5. Lost context and history
What I do now:
1. Always start in tmux: tmux new -s opencode
2. Start OpenCode inside the session
3. Detach when leaving desk
4. Reattach from anywhere

Mistake 3: Using Terminal for Extended Coding on iPhone

I’ve tried. It’s painful:

  • No escape key (you need to use on-screen buttons)
  • Keyboard covers half the screen
  • Command key combinations require multiple taps
  • Tiny text on small screen

Use Web UI for anything beyond quick commands.

Mistake 4: Not Setting Up Remote Access Before You Need It

The worst time to set up Tailscale is when you’re at a coffee shop and realize you need to check something.

Set it up now. Test it. Then when you need it, it just works.

My Current Setup

Here’s my actual configuration:

My mobile OpenCode setup
Desktop:
- OpenCode running in tmux session 'opencode'
- Tailscale installed and connected
- OpenCode served on port 3000
Phone:
- Tailscale app installed
- Blink Shell for terminal (iOS)
- Safari bookmark to Tailscale URL
Typical workflow:
1. Quick check? → Web UI
2. Need to run commands? → Blink Shell → tmux attach
3. Extended work? → Wait for laptop

Security Considerations:

Both Tailscale and Cloudflare Tunnel are more secure than traditional VPNs or port forwarding:

  • Tailscale: WireGuard-based encryption, no open ports
  • Cloudflare Tunnel: No inbound firewall rules needed, can add Cloudflare Access for authentication

Performance Tips:

  • Web UI is snappier over slow connections
  • Terminal/tmux uses less bandwidth but has higher latency sensitivity
  • If connection drops, tmux preserves your session; Web UI needs to reconnect

When Each Approach Shines:

Web UI:
+ Quick code reviews
+ Checking AI task progress
+ Reading documentation
+ Mobile-friendly prompts
Terminal:
+ Running test suites
+ Checking server logs
+ Executing shell commands
+ System administration
+ Debugging with tools like grep, tail, htop

Summary

In this post, I showed how to access OpenCode from your phone using two approaches: Web UI (via Tailscale or Cloudflare Tunnel) and terminal access (via SSH and tmux).

The Web UI is better for most mobile use cases—it’s touch-friendly, requires no app installation, and handles code review smoothly. Terminal access remains useful for system commands, debugging, and when you need shell access.

Set up Tailscale before you need it. Your future self, stuck at a coffee shop with an urgent code review, will thank you.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments