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/commandsOption 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:
opencode serve --host 0.0.0.0 --port 3000Then access from your phone at http://YOUR_LOCAL_IP:3000. You can find your local IP with:
# macOSipconfig getifaddr en0
# Linuxhostname -IThis 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.
# Install Tailscalebrew install tailscale
# Start and authenticatesudo tailscale up
# Get your Tailscale IPtailscale ipInstall 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:
# Install cloudflaredbrew install cloudflare/cloudflare/cloudflared
# Create a quick tunnelcloudflared tunnel --url http://localhost:3000This 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:
# Create a dedicated sessiontmux new -s opencode
# Start OpenCodeopencode chat
# Detach: Ctrl+B, then DFrom my phone:
# SSH into my machinessh user@my-server-ip
# Reattach the sessiontmux attach -t opencodeEverything 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:
Ctrl+B, D - Detach (leave session running)Ctrl+B, [ - Enter copy mode (scroll with arrows)Ctrl+B, ? - Show all keybindingsCtrl+B, C - Create new windowCtrl+B, N - Next windowCtrl+B, P - Previous windowPro 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 phone2. Navigate to OpenCode URL3. Scroll through the diff4. Type comments with phone keyboard5. Approve or request changes
Time: 2-3 minutesExperience: Smooth, touch-friendlyTerminal:
1. Open terminal app2. SSH to server3. Attach tmux session4. Navigate with keyboard commands5. Scroll with tmux copy mode
Time: 3-4 minutesExperience: Doable, but more frictionTask: Check on a Long-Running AI Task
Web UI:
1. Open browser2. See the chat history3. Read the latest output4. Send a follow-up prompt if needed
Time: 30 secondsExperience: Perfect for quick checksTerminal:
1. Open terminal app2. SSH and attach tmux3. Scroll through output4. Send follow-up
Time: 45 secondsExperience: More steps, but gives shell accessTask: Debug a Production Issue
Web UI:
- Good for: Reading logs, reviewing code- Limited for: Running diagnostic commands- Verdict: Use as first passTerminal:
- Good for: Running any command, checking processes- Limited for: Reading long outputs on small screen- Verdict: Use for actual debuggingCapability Comparison
| Feature | Web UI | Terminal |
|---|---|---|
| Touch-friendly | Yes | No |
| Code diffs | Visual | Text-based |
| Phone keyboard | Works well | Awkward |
| Shell access | No | Yes |
| Run scripts | No | Yes |
| Install needed | None | Terminal app |
| Network setup | Tailscale/Tunnel | SSH access |
| Best for | Review, quick checks | Commands, 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
diffoutput
Terminal on mobile works, but it’s fighting against the device constraints.
Common Mistakes to Avoid
Mistake 1: Exposing OpenCode Directly to the Internet
# NEVER do this:opencode serve --host 0.0.0.0 --port 3000# Then port forward 3000 on your routerThis 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 desktop2. Leave for coffee shop3. Try to SSH from phone4. Realize session isn't in tmux5. Lost context and history
What I do now:1. Always start in tmux: tmux new -s opencode2. Start OpenCode inside the session3. Detach when leaving desk4. Reattach from anywhereMistake 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:
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 UI2. Need to run commands? → Blink Shell → tmux attach3. Extended work? → Wait for laptopRelated Knowledge
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, htopSummary
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:
- 👨💻 OpenCode Documentation
- 👨💻 Tailscale - Private Network
- 👨💻 Cloudflare Tunnel
- 👨💻 Termux - Android Terminal
- 👨💻 Blink Shell - iOS Terminal
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments