Guide

Where to run a coding agent around the clock

A coding agent that runs all day needs a computer that runs all day. There are five realistic places to put it. Each one is right for someone. This page lays them out with real prices and the thing each one cannot do, then gives a rule for choosing.

The five options at a glance

OptionMonthly costRuns XcodeThe catch
Your laptop$0YesSleeps, travels, and holds your whole life
Linux VPS$5 to $40NoNo macOS, no simulators, no Mac apps
EC2 Mac (mac2.metal, M1)about $475Yes24-hour minimum, bare metal you administer
Mac mini you buy$599 once, plus powerYesYour setup, your uptime, your outages
Hosted Mac mini (MacRun)$149YesMonthly commitment, one machine per lease

EC2 prices are AWS on-demand host rates of $0.65 an hour for the M1 host, $0.878 for the M2 host, and $1.56 for the M2 Pro host, times 730 hours. Apple's license sets the 24-hour minimum, and you pay for the host while it is allocated, even when the instance is stopped.

Your laptop

Free, already set up, and the right place to start. Every long-running agent begins on someone's laptop. It stops being the right place the first time you close the lid and lose a run, or the first time you want to take the laptop somewhere. You can force it to stay awake. The sleep guide shows how. But an agent with broad permissions on the machine that holds your email and your password manager is a bad combination. It gets worse the more autonomy you give it.

A Linux VPS

The cheapest real server. For a web backend, a CLI tool, a Python service, or anything that ships to Linux anyway, this is the obvious choice. Claude Code and Codex both run on Linux. Set up tmux, give the agent a scoped token, and it will happily work all night for the price of a coffee. It cannot build an iOS or Mac app, run a simulator, or drive a Mac application, because none of that exists on Linux. If your project is not an Apple project, stop reading and rent one of these.

An EC2 Mac

Real Apple hardware in an AWS data center. You get a whole machine, macOS, and everything AWS around it. The price is the issue. The cheapest host is an M1 from 2020 and costs about $475 a month if you keep it allocated. The M2 Pro host is about $1139. You also administer it yourself, from the AMI to the sleep settings to the login session an agent needs. Worth it if you are already deep in AWS and want the agent inside your VPC. Otherwise it is the expensive way to get a Mac.

A Mac mini you buy

The best value if you will use it for a year or more and you enjoy running a small server. A base M4 mini is $599. Power is a dollar or two a month at idle. The cost is your time. Sleep settings, automatic login, and a supervised session. Screen access for when it gets stuck. A UPS so a power blip does not corrupt a run. A way to reach it from outside the house. The always-on checklist is the full list. The rent versus buy math works out where the break-even sits for your situation.

A hosted Mac mini

Someone else does the checklist. You get a dedicated M4 with Claude Code and Codex installed, sleep off, wired network, battery backup, and a desktop you open in a browser. It costs $149 a month, which is more than a VPS and less than a third of an EC2 Mac. It is the right choice when you need macOS and do not want to be the sysadmin. It also fits when you are not sure yet whether this is a one-month experiment or a permanent fixture.

The decision rule

  • Not an Apple project: Linux VPS. Nothing else comes close on price.
  • Apple project, trying it out: your laptop, awake, for a week.
  • Apple project, needs to run every night, you like ops: buy a Mac mini.
  • Apple project, needs to run every night, you do not: hosted Mac mini.
  • Apple project, must live inside your AWS account: EC2 Mac.

Frequently asked questions

Can Claude Code run on Linux?

+

Yes. Claude Code and Codex CLI both run on Linux and Windows through WSL. The Mac requirement comes from the project, not the agent. If you build for iOS or macOS, you need macOS to build and test it.

Why is an EC2 Mac so much more expensive than a hosted Mac mini?

+

AWS sells whole Mac hosts by the hour with a 24-hour minimum, on hardware in its own data centers, with its own margins. A hosted Mac mini is the same idea at a smaller scale with a monthly price. Both are legitimate. The AWS price buys the AWS ecosystem around it.

Is a Mac mini at home reliable enough for an agent?

+

Yes, with the checklist done. The usual failures are sleep, a power blip, a router reboot, and a macOS update that lands on a login screen. Each has a fix. Together they are an evening of setup and an occasional Saturday.

Do I need a Mac for Claude Code's Remote Control?

+

No. Remote Control attaches the Claude app to a running session on any supported machine. You need a Mac for Apple projects, not for the phone feature.

Related guides