Reach your server through Tailscale
Put the phone and the server on one private network, then add the server by its Tailscale name. No open ports, no router settings.
Step by step
Install Tailscale on the server
On Linux, run the installer. On macOS or Windows, install the Tailscale app from tailscale.com instead.
$ curl -fsSL https://tailscale.com/install.sh | shSign the server in
Run the command and open the link it prints to sign in with your Tailscale account. The server now appears in your network.
$ sudo tailscale upPut the phone on the same network
Install Tailscale from Google Play or the App Store, sign in with the same account and switch it on. The phone and the server now see each other.
Find the server's Tailscale address
Use either the 100.x.y.z address or the machine name, which Tailscale resolves for you on a network that has MagicDNS on, the default for new ones.
$ tailscale ip -4Make sure SSH is running on the server
Mochitao logs in to the server's regular SSH service, so install and start it if it is not there yet, and leave Tailscale SSH off.
$ sudo systemctl enable --now sshAdd the host
On the home screen, tap Add host. In the Connection block, put the Tailscale address or machine name in Address, then the username. Port stays 22.
Where: Add hostConnectionAddress
Sign in and trust the server
Set up a key as in the first-connection guide, then tap the host. The first connection shows the server's fingerprint; accept it once you have compared it with the server's.
Where: HostAuthentication
Let your agent do it
Hand the server side to your coding agent
Run your coding agent (Claude Code, Codex or similar) on the server and paste this. Replace the marked line with the public key you copied from Mochitao: Settings › Hosts › All hosts › Keys, then the key's actions. Install Tailscale on the phone yourself and sign in with the same account.
You are setting up this machine so I can reach it over SSH from my phone, using the Mochitao app, through Tailscale. No port is opened to the internet. Work step by step. Show me every command before you run something that changes the system, and ask when anything is unclear. 1. Detect the operating system. Check whether Tailscale is installed. If it is not, install it with the official method from tailscale.com for this system. 2. Run tailscale up (with sudo where needed) and give me the sign-in link. Wait until I tell you I have signed in. Do not turn on Tailscale SSH: leave out --ssh. 3. Make sure an OpenSSH server is installed, enabled at boot and listening on port 22 (Linux: openssh-server, macOS: Remote Login, Windows: the OpenSSH Server feature). 4. Add this public key to authorized_keys for my user, creating ~/.ssh with mode 700 and the file with mode 600 if needed. Do not add it twice: <PASTE THE PUBLIC KEY FROM MOCHITAO HERE> 5. Print this machine's Tailscale IPv4 address (tailscale ip -4) and its machine name from tailscale status. Check that sshd accepts connections on the Tailscale address. 6. Print the ed25519 host key fingerprint (ssh-keygen -lf on the host key file) so I can compare it on the first connection. 7. Finish with a summary: the Address (machine name, and the 100.x address as a fallback), Port and Username to type into Mochitao, the fingerprint, and anything left for me to do by hand. 8. Ask me last: once the phone connects through Tailscale, do I want port 22 closed to the public internet? Change the firewall only after I say yes, and never from a session that reaches this machine through its public address. Never print, read or ask for a private key.
Good to know
- Tailscale has to be on, on the phone, for the host to answer. If a connection hangs after the phone has been idle, open Tailscale to check it is connected, then tap the session to bring it back.
- Once it works, close port 22 to the internet. The server is then reachable only from your own devices.
- Only one machine needs Tailscale to reach a whole home network: connect to it, then add it as a jump host for the other machines behind it.
- A phone runs one VPN at a time, so switch any other VPN app off before you turn Tailscale on.
- Tailscale devices sign in again after their key expires, 180 days by default. A server that drops off the network after months needs `sudo tailscale up` again, or key expiry turned off for it in the Tailscale admin console.
Something not working? Troubleshooting and contact