# Self-host Moon (Mac mini)

Start Studio on your Mac mini and optionally pair it with Cloud Studio.

Run Moon on a Mac mini with one executable. Local and LAN access work without a SoyaOS Cloud account. Moon embeds PocketBase and stores data and SoyaPack files on the Mac.

## Start Moon

Run these commands in an empty directory. They detect Apple silicon or Intel, download the matching binary from the [SoyaOS release](https://github.com/soyaos/soyaos/releases/tag/v0.1.0-alpha.6), and start Moon.

```sh
(
  case "$(uname -m)" in
    arm64) asset=soya-darwin-arm64 ;;
    x86_64) asset=soya-darwin-amd64 ;;
    *) printf '%s\n' 'Unsupported chip architecture' >&2; exit 1 ;;
  esac

  curl -fL --retry 3 "https://github.com/soyaos/soyaos/releases/download/v0.1.0-alpha.6/$asset" -o soya &&
    chmod +x soya &&
    ./soya moon start
)
```

Open [local Studio](http://127.0.0.1:7474/) and enter the admin key shown in the terminal. For trusted LAN access, start Moon with your Mac mini's private IP, for example `./soya moon start --listen 192.168.1.20:7474`. From another device, open `http://192.168.1.20:7474/` and use the same key.

## Create an agent

Save a draft with a name, description, and system prompt. Publishing loads the agent into Moon and makes its `.spk` available for download from local Studio.

### Configure a model for preview

Press Ctrl+C in the terminal that started Moon, then run the commands below from the directory containing `soya`. This example uses OpenAI. For another OpenAI-compatible provider, replace the base URL and model name before entering that provider’s API key.

Saving and publishing drafts work without a model key. Drafts and published agents remain in your data directory after restart.


```sh
export SOYA_MODEL_BASE_URL='https://api.openai.com/v1'
export SOYA_MODEL_DEFAULT='gpt-4o-mini'
printf '%s ' 'Enter model API key'
IFS= read -rs SOYA_MODEL_API_KEY
printf '\n'
export SOYA_MODEL_API_KEY
./soya moon start
```

## Connect remotely

Sign in to [Cloud Studio](https://developer.soyaos.ai/en/studio) with GitHub and generate a pairing code. Paste the code into local Studio, then select the online Moon in Cloud Studio. Moon uses an outbound HTTPS connection and requires no public IP, custom DNS, or router port forwarding. Disconnect the node in Cloud Studio to revoke remote access.

The default data directory is `~/.local/share/soyaos/moon`. To back it up, stop Moon and copy the entire directory. You don't need to install PocketBase, Postgres, or an S3 service separately.

---

Canonical HTML: https://soyaos.ai/en/docs/self-host-moon-mac-mini
