Connecting
Ways to reach the OpenCode running on your computer from your phone. At home, use the same Wi-Fi. To also connect when you are out, Tailscale is the easiest choice.
First, start the server
Whichever way you connect, start OpenCode on your computer with a password.
export OPENCODE_SERVER_PASSWORD=your-password
opencode serve --hostname 0.0.0.0 --port 4096
In Windows PowerShell, set it with $env:OPENCODE_SERVER_PASSWORD="your-password" before starting. Enter the same password on the app's connect screen (leave the username as opencode).
Without a password, anyone on the same network can control your computer. Always set one.
On the same Wi-Fi
The simplest way, when your phone and computer share a Wi-Fi network.
- Start the server as above.
- Open the app's connect screen. Servers on the same network show up on their own; tap one and enter the password.
- If yours doesn't appear, look up the computer's IP address and enter it like
http://192.168.1.10:4096.
Mac:ipconfig getifaddr en0Windows:ipconfigLinux:hostname -I
If it still can't connect, check that the computer's firewall allows connections on port 4096. This way does not work when you are away from home.
With Tailscale (works from anywhere)
Tailscale joins your own devices in a private, encrypted network. It is free for personal use, and nothing is opened to the internet.
- Install Tailscale on both your computer and your phone, and sign in with the same account.
- Start the server as above.
- On the computer, run
tailscale ip -4and note the address starting with100.. - In the app, enter it like
http://100.x.y.z:4096and connect. With MagicDNS on,http://computer-name:4096works too.
While the Tailscale app on your phone is on, this works over mobile data as well.
For HTTPS, start OpenCode with --hostname 127.0.0.1 and run tailscale serve --bg 4096 on the computer; then connect to https://computer-name.your-tailnet.ts.net.
With Cloudflare Tunnel
For when you can't install Tailscale. Your computer opens a tunnel to Cloudflare, which gives it a public HTTPS address.
- Install cloudflared on the computer.
- Start the server as above (
--hostname 127.0.0.1is fine here). - In another terminal, run:
cloudflared tunnel --url http://localhost:4096 - Enter the
https://….trycloudflare.comaddress it prints in the app and connect.
Anyone who learns the address can reach your server, so use a long, hard-to-guess password. The address changes every time you start the tunnel; for a fixed one, create a named tunnel in your Cloudflare account.
With SSH port forwarding
For people who already SSH into their computer. Set up forwarding in an SSH app on your phone (Termius, for example).
- Start OpenCode on the computer with
--hostname 127.0.0.1. - In the SSH app, add a local port forward from port
4096on the phone to127.0.0.1:4096on the computer. - With the forward running, connect the app to
http://127.0.0.1:4096.
The forward may stop when the SSH app goes to the background, especially on iPhone. For everyday use, Tailscale is steadier.
If something doesn't work
The "Connection check" button at the top right of the project list shows at a glance whether the server answers, live updates flow, and the notification plugin and MCP servers are working. You can copy the results into a support request.