In this issue
By Vaughn
Having your own virtual private server hosted in your home is a very cool, technical, nerdy thing to do. Nowadays, it’s even more useful with the advent of AI and LLM models being able to do work for you around the clock.
Now what if you need a virtual private server or container that’s always on to run these AI agents, workflows, automations, etc.? One way is to get a Mac Mini and set it up at your home, so you can have a free (well, except for the electricity costs) VPS always running for you.
In this tutorial, we’ll get that set up and also set up a way in which you can actually control your Mac Mini from anywhere in the world, given you have a MacBook or similar portable macOS machine.
In this tutorial:
- Why a Mac Mini makes a better home server than you’d expect
- What to install and how to configure it (step by step)
- How to SSH in and control the screen remotely over Tailscale
- How to get n8n running in Docker and verify it works
- The limitations to know before you rely on this for anything important
Why Run AI Agents on a Home Server at All?
The cloud is convenient, but for personal AI workflows it’s often overkill — and it costs money continuously. A Mac Mini lets you run automations on hardware you already own.
Here’s what “always-on” actually unlocks for builders:
- Scheduled AI pipelines — run LLM-powered workflows on a cron-style schedule without paying for cloud compute when the job is idle
- n8n automations — connect APIs, process emails, scrape data, trigger webhooks, all running continuously
- Persistent AI agents — agents that need to check something every 5 minutes or wait for an event to occur
- Local model serving — run Ollama or similar tools on the Mini and call them from your workflows without API costs
- Personal data pipelines — sync, transform, and store data from multiple sources without a managed ETL service
The Mini won’t replace a production cloud setup. But for personal tools, side projects, and prototyping agentic workflows, it’s fast, cheap to run, and yours.
What You’ll Need
- A Mac Mini (any modern model) — this will be your always-on server
- A MacBook (or any other Mac) — this is how you’ll control the Mini remotely
- Tailscale installed on both machines — creates a private network between them so you can access the Mini from anywhere, no port forwarding required
- A mouse and keyboard — just for the initial Mac Mini setup; you can unplug them after
Step 1: Configure the Mac Mini to Stay On
By default, macOS will sleep after inactivity. You need to disable that.
On the Mac Mini:
- Open System Settings → Energy
- Set “Turn display off after” to Never (or a time you’re comfortable with)
- Enable “Prevent automatic sleeping when the display is off”
- While you’re here, go to System Settings → General → Sharing and enable Remote Login — this is what allows SSH connections
In short: Sleep = your workflows stop. Disabling it is the first and most important step.
Step 2: Install Tailscale on Both Machines
Download Tailscale and install it on your Mac Mini and your MacBook. Sign in with the same account on both.
Once both are connected to your Tailscale network:
- Open the Tailscale app on your MacBook
- Find your Mac Mini in the device list
- Copy its MagicDNS hostname — it will look something like
mac-mini.tail1234.ts.net
This hostname is stable. It works from any network, anywhere — coffee shop, airport, anywhere your MacBook has internet.
Step 3: Install Docker on the Mac Mini
On the Mac Mini, download and install Docker Desktop for Mac.
After installing, open Docker Desktop and make sure it’s running — you’ll see the whale icon in the menu bar.
Then go to Docker Desktop settings and enable “Start Docker Desktop when you log in”. This ensures Docker is always available after a restart, so your containers come back up automatically.
Step 4: Connect to Your Mac Mini from Your MacBook
From here on, you don’t need to be physically at the Mac Mini. Everything goes through your MacBook.
Connect via SSH (terminal access):
ssh <your-magicDNS-hostname>
# Example:
ssh mac-mini.tail1234.ts.net
The first time, macOS will ask you to confirm the host fingerprint — type yes. You’re now in the Mac Mini’s terminal remotely.
Connect via Screen Sharing (GUI access):
Open the Screen Sharing app on your MacBook (find it with Spotlight) and connect using the MagicDNS hostname.
You’ll see and control the Mac Mini’s desktop as if you were sitting in front of it.
Step 5: Start n8n with Docker
In your SSH terminal (connected to the Mac Mini), run:
docker run -d \
--name n8n \
--restart unless-stopped \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
What these flags do:
-d— runs in the background (detached)--restart unless-stopped— n8n restarts automatically if Docker restarts or the Mac Mini reboots-p 5678:5678— exposes n8n on port 5678-v ~/.n8n:/home/node/.n8n— persists your workflows and credentials to your home folder so they survive container restarts
Verify it started:
docker ps
You should see n8n in the list with status Up.
Step 6: Open the n8n Dashboard
Using your Screen Sharing connection (the Mac Mini’s desktop), open a browser on the Mini and go to:
http://localhost:5678
You’ll see the n8n setup screen. Create your account, and you’re in.
From this point on, any workflow you build here runs on the Mac Mini — 24/7, without your MacBook needing to be open.
Step 7: Build a Test Workflow to Verify
Let’s confirm everything is working end to end.
- In n8n, click “New Workflow”
- Add a Schedule Trigger node — set it to run every 5 seconds
- Add an Edit Fields node with one field:
timestampset to{{ $now }} - Connect the nodes and click “Activate” (toggle in the top right)
- Go to the Executions tab and watch runs appear every 5 seconds
If you see executions ticking in, your Mac Mini is processing workflows autonomously. Turn off your MacBook screen — the runs keep happening.
Congratulations!
You should have everything up and running. Here’s what you’ve got:
- Create an n8n workflow anytime, anywhere — SSH or Screen Share in from your MacBook no matter where you are
- Have n8n running 24/7 around the clock for you — workflows keep executing whether your laptop is open or not
- Edit any n8n workflow on your Mac Mini from anywhere in the world — no need to be home
From here, you can expand by adding more Docker containers alongside n8n:
- Ollama — run local LLMs on the Mini without API costs
- Postgres — give your agents a persistent database to read and write from
- Redis — add a queue for async workloads
- Any other tool your workflows need
Limitations to Know Before You Rely on This
Home internet is not a cloud SLA. If your ISP goes down or your router restarts, your Mini goes offline. For personal tools this is usually fine. For anything with external deadlines — customer-facing webhooks, time-sensitive triggers — plan around it.
No public inbound access by default. Tailscale gives you private access from your own devices, but external services can’t reach your Mini’s ports without extra setup. If you need public webhooks pointing at n8n, you’ll need a tunnel — Cloudflare Tunnel is the cleanest option.
Reboots need Docker to start automatically. Make sure Docker Desktop is set to launch at login. Otherwise workflows won’t resume after a power cycle.
Storage is finite. n8n stores execution logs locally. For high-volume workflows, configure log pruning in n8n settings or executions will pile up over time.
This is not a backup strategy.
The ~/.n8n volume holds your workflows. Back it up — a simple cron job that copies it to iCloud or S3 is enough.
Frequently Asked Questions
Do I need to keep my MacBook on for the Mac Mini to run workflows?
No. Once n8n is running on the Mac Mini, it operates independently. Your MacBook only needs to be on when you want to SSH in or use Screen Sharing to make changes.
Can I access the n8n dashboard directly from my MacBook browser?
Yes — since both machines are on the same Tailscale network, you can open http://<mac-mini-magicDNS-hostname>:5678 directly in your MacBook’s browser without Screen Sharing.
What happens to my workflows if the Mac Mini restarts?
Because we used --restart unless-stopped in the Docker run command and your workflows are saved in the mounted volume, n8n will restart automatically and your workflows will be exactly where you left them.
Is this setup secure?
Access is gated by Tailscale, which uses WireGuard encryption. As long as your Tailscale account is secure, only your devices can reach the Mini. Don’t expose port 5678 directly to the public internet.
Can I run other tools alongside n8n?
Yes — Docker lets you run multiple containers. Common additions:
- Ollama (local LLM serving)
- Postgres (persistent storage for agents)
- A second n8n instance for staging vs. production
Want More Like This?
If you found this walkthrough useful, you’ll get more like it in the AI for the Stack newsletter — practical, no-fluff coverage of agentic AI patterns and tools for builders.
Subscribe at aiforthestack.com →
Related reading
Enjoyed this?
Stay in the loop.
New guides, tools, and picks from the agentic AI space — delivered when there's something worth reading. Free forever.
Subscribe Free →