The setup
A Mac mini sits at home and never turns off. It is the machine that holds my projects, runs scheduled jobs, and hosts a couple of small private web pages. A laptop roams with me. The idea is one canonical machine, and everything else connects in. I configure the machine that holds the work, and it does not matter which screen I happen to be in front of.
Nothing below is exotic. The value is in how the pieces stack, because each one fixes a specific way the one under it fails.
1. The network: Tailscale
The traditional answer is to forward a port on your router, move SSH off port 22, install fail2ban, and harden it. That works, and it also means you now own an internet-facing service forever. That is a lot of permanent homework for “I would like to reach my own computer.”
Skip all of it. Put Tailscale on every machine and nothing ever has to be exposed to the internet.
Tailscale is WireGuard with the key exchange and the firewall-punching handled for you. Install it on each device, sign in with the same account, and each one gets a stable private address that works from anywhere: hotel wifi, cellular, behind a carrier's NAT. The free plan covers a personal set of devices comfortably.
Three features I actually use:
-
MagicDNS. Every machine gets a name, so I type
ssh mac-miniinstead of an IP address. SSH config, scripts, and the phone app all keep working if an address ever changes. - Tailscale Serve. Puts an HTTPS address, with a real certificate, in front of something running locally on the mini, reachable only by my own devices. My private home dashboard lives behind it. No certificates to manage, nothing public.
- Exit node. The mini is set up as one, so when I am travelling I can send my traffic out through home. Sites that care where you are see my home connection, and untrusted hotel or airport wifi only ever sees encrypted traffic.
One limit worth knowing: Tailscale cannot wake a machine that is switched off. Wake-on-LAN packets only travel on the local network. That is part of why the mini is the one that stays on.
2. The terminal: SSH, mosh, tmux
Once the network is boring, the interesting problem is keeping a session alive. Three tools, each fixing a different failure.
- SSH is the baseline. On a Mac, turn it on under System Settings → General → Sharing → Remote Login. Use keys, not passwords. It stays the tool for anything that needs port forwarding.
-
mosh fixes the problem that SSH dies
whenever your network changes: closing the laptop lid, walking out of wifi range,
switching cell towers. It logs in over SSH, then switches to its own protocol that
simply does not notice the network changing. It also echoes your typing instantly, which
makes a bad connection feel fine. It needs to be installed on both ends
(
brew install mosh). - tmux keeps the work on the mini instead of in the connection. If the phone reboots or I move from the phone to the laptop mid-task, I reattach to the same named session and everything is exactly where I left it. It also gives you the scrollback that mosh lacks.
mosh so the connection survives the network. tmux so the work survives the connection.
The habit that makes it work: always attach to a named session
(tmux new -A -s main) instead of starting a fresh one. The same session then
follows you between devices all day.
3. The phone: Moshi
With plain SSH, a phone terminal disconnects every time the screen locks, and it is a novelty. On top of Tailscale, mosh, and tmux, it is a real terminal that happens to fit in a pocket.
I use Moshi on iOS. It is built around exactly this stack: mosh as the transport, tmux sessions as a first-class feature, keys in the iOS Keychain behind Face ID. It can also send a push notification when a long job finishes, which is the feature that changes how you use it, because you stop sitting there watching.
Be honest about what a phone is for. It is a supervision console, not a workstation. Checking on something long-running, reading output, making a small fix, or answering a coding assistant that stopped to ask a question: great. Writing real code: miserable.
4. AI coding sessions: Remote Control
Most of what I do on the mini is with AI coding assistants, and for Claude Code there is a better path than a terminal on a phone. Remote Control connects the Claude app (phone, tablet, desktop) and claude.ai/code to Claude Code running on the mini. Claude keeps running at home the whole time, with my files, tools, and setup. The app is just the window. It needs a paid Claude plan; Remote Control does not work with API keys.
There are a few ways to set it up, and I use two of them:
-
Server mode, in tmux.
claude remote-controlturns the mini into a host that waits for connections. From my phone I can start a new session on it, not just continue an existing one, and it runs several at once. With--spawn worktree, each new session gets its own copy of the repository so two sessions never edit the same files. I keep the server in its own tmux session, started when the mini boots, so it is always there. - The Claude desktop app. No terminal at all: in the app's settings, under Code, turn on Connect new sessions to Remote Control. Every session I start in the desktop app on the mini then shows up on my phone too. This is the easiest way in, and it is my fallback if the tmux server is down.
-
One session at a time. Type
/remote-control(or/rc) in any session you already have open, in the terminal or the desktop app, to make just that one reachable. Good for “I am leaving the house, let me keep an eye on this.”
In the app, sessions running at home show up in the Code tab with a computer icon and a green dot when they are online.
One more thing: consider turning on Require trusted devices in your Claude account settings. Then only devices you have enrolled can see or steer these sessions, not anything that happens to be signed in to your account.
5. The desktop, when I really need it
Rarely, I need the actual screen: a settings panel, an app with no command line, a dialog waiting for a click. All of these run over Tailscale:
- macOS Screen Sharing. Built in. Turn it on under System Settings → General → Sharing, then connect from another Mac by its Tailscale name. Fine for a quick click.
- VNC from an iPhone or iPad. Screen Sharing is a VNC server underneath, so any VNC app can reach it. I use RealVNC Viewer, which is free: add a connection to the mini's Tailscale name and connect directly. No RealVNC account needed for that. If it only asks for a password and your Mac login fails, open the Screen Sharing options on the Mac and set a separate VNC password. Plain VNC is not encrypted on its own, which is one more reason to only ever use it over Tailscale.
- Parsec. Much smoother when I need to actually work on the screen for a while. Free for personal use.
A small trap if you use a scroll-direction app on the mini, like Scroll Reverser: remote clients send synthetic scroll events, it cannot tell them from a mouse, and scrolling comes out backwards. I turn it off while connected.
6. Coming back after a power cut
Everything above assumes the mini is on. A home server that needs you home to turn it back on is not much use when you are away, so it is worth making sure the whole chain restarts by itself. Mine has four links:
-
The Mac turns itself back on. System Settings → Energy → Start up
automatically after a power failure (or
sudo pmset -a autorestart 1in a terminal). - Tailscale reconnects before anyone logs in. On my mini it comes up at boot, so SSH and the private dashboard are reachable even if nothing else has started. Test this on yours: restart it, don't log in, and try to reach it from your phone.
- Your user session has to start. tmux, the Remote Control server, and the desktop app all run as you, so they wait until someone logs in. Automatic login (System Settings → Users & Groups) handles that, but macOS will not allow it while FileVault disk encryption is on. That is a real trade-off: FileVault protects your data if the machine is stolen, and automatic login is what lets it recover with nobody home. Pick one on purpose rather than finding out on a trip.
- Your things start at login, and keep retrying. Add what you need as Login Items (System Settings → General → Login Items), or start it from your shell setup. Then assume the internet is not back yet: after a power cut the Mac boots faster than the router. Remote Control's server mode gives up after about ten minutes without a network, so I run it in a loop that retries every 30 seconds and logs each attempt. When it is not there, that log is the first place I look.
The test is the same for all of it: pull the plug, plug it back in, walk away, and try to connect from your phone on cellular. Better to find the broken link at home than from an airport.
If you want to set this up
In order, because each step makes the next one boring:
- Install Tailscale on two devices and check that one can reach the other. One evening, and most of the value.
- Turn on MagicDNS, then SSH in by name. Set up SSH keys while you are there.
brew install mosh tmuxon the home machine, mosh on the laptop too. Get used to attaching to a named tmux session.- Make it survive a power cut (section 6), and test that by actually pulling the plug.
- Add the phone client once all of that works from a laptop.
The one thing I would skip: exposing SSH directly to the internet. It is the traditional answer, it is a maintenance commitment that never ends, and a private network makes the whole category of problem go away.
If you get stuck on any of it, write to me at me@viyatjhaveri.com.
— Viyat