---
title: "Run it on a Mac mini"
description: "The settings that make a Mac mini turn on, log in and stay awake by itself."
canonical_url: "https://www.harness-sdk.dev/harnessd/docs/mac-mini"
markdown_url: "https://www.harness-sdk.dev/harnessd/docs/mac-mini.md"
x_farming_labs_generated_preamble: true
---

# Run it on a Mac mini
URL: /harnessd/docs/mac-mini
LLM index: /llms.txt
Description: The settings that make a Mac mini turn on, log in and stay awake by itself.

A Mac mini with nobody at it has to do three things alone: turn on, log in, and stay awake. harnessd does the rest.

## Turn on after a power cut

Which setting does it depends on the Mac.

- **Mac mini 2024 or later, on macOS 26.5 or later.** In System Settings, under Energy, set "Start up when power is connected" to Always.
- **Older Macs.** In System Settings, under Energy, turn on "Start up automatically after a power failure". This command does the same:

```sh
sudo pmset -a autorestart 1
```

## Log in by itself

macOS starts harnessd when your user logs in, not when the Mac starts. A Mac that waits at the login window runs no agent. You pick one:

| | What you do |
| --- | --- |
| Login item with automatic login | In System Settings, under Users & Groups, set "Automatically log in as" to the agent's user. |
| Boot service | Run `sudo harnessd service install`. harnessd starts when the Mac boots, with nobody logged in. It signs in with a token. |

[Install](/harnessd/docs/setup#install) has both kinds.

## FileVault or automatic login

macOS offers automatic login only while FileVault is off:

| | After a power cut | If the Mac is stolen |
| --- | --- | --- |
| FileVault off, automatic login on | The agent comes back by itself. | The disk can be read. |
| FileVault on | The Mac waits at the unlock screen until someone types the password. Nothing runs, and your private network can't reach it. | The disk can't be read. |

A planned restart works with FileVault on: `sudo fdesetup authrestart` restarts the Mac and unlocks the disk once.

## Never sleep

harnessd does not keep the Mac awake. A sleeping Mac runs no agent and answers no SSH.

```sh
sudo pmset -a sleep 0   # never sleep; the display can still sleep
sudo pmset -a womp 1    # "Wake for network access" in System Settings
```

## Reach it

[Secure remote access](/harnessd/docs/setup#secure-remote-access) sets up SSH. Turn on Screen Sharing too: macOS shows its own permission prompts on the Mac's screen, not in the terminal.

## What stopped a real agent

These come from running an agent on a Mac mini for weeks. Each one stopped the agent, or would have.

- **The Mac's own sign-in expired, or the keychain was locked.** Use a token from `claude setup-token`.
- **One account ran out.** Name a second [account](/harnessd/docs/concepts#accounts). The agent goes on with it instead of waiting for a reset.
- **A restart of Claude Code ended its subagents and background commands.** The agent has to start them again.
- **Node.js was upgraded with a version manager.** Run `harnessd service install` again before you remove the old version.
- **macOS asked for a permission on the screen and waited.** Grants belong to a program, not to Terminal. Add the program itself in System Settings, under Privacy & Security.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
