← Home

Reaching My Home Computer From Anywhere

People keep asking what I use to get into my Mac mini when I am away from home, from a laptop or from my phone. This is the whole answer, in the order I would set it up.

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:

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.

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:

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:

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:

  1. The Mac turns itself back on. System Settings → Energy → Start up automatically after a power failure (or sudo pmset -a autorestart 1 in a terminal).
  2. 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.
  3. 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.
  4. 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:

  1. Install Tailscale on two devices and check that one can reach the other. One evening, and most of the value.
  2. Turn on MagicDNS, then SSH in by name. Set up SSH keys while you are there.
  3. brew install mosh tmux on the home machine, mosh on the laptop too. Get used to attaching to a named tmux session.
  4. Make it survive a power cut (section 6), and test that by actually pulling the plug.
  5. 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