---
title: "Run Meta's Muse Code on a remote server"
description: "Run Muse Code, Meta's terminal coding agent, on an always-on exe.dev VM: goals and subagents keep working after you disconnect, and sessions resume."
url: https://exe.dev/deploy/muse-code
category: "AI agents"
updated: 2026-11-13
---

# Run Meta's Muse Code on a remote server

Meta's coding agent, on a computer that stays up all night.

- **Software:** Muse Code (https://dev.meta.ai/products/muse-code)
- **License:** Proprietary (Meta Model API Terms of Service)
- **Time:** 5 minutes
- **Example VM name:** `my-muse-code` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://exe.dev/deploy/muse-code/manifest.json

## What you get

- Muse Code installed with Meta's official installer, answering a test prompt with no account
- A project folder at `~/project` on persistent disk
- A `muse` tmux session that survives disconnects, ready for you to sign in to Meta

Running on the VM:

- **Muse Code**: `muse` 1.4, Meta's official installer; updates itself, data in `~/.config/muse and ~/.local/share/muse`
- **Your project**, data in `~/project`
- **tmux**: keeps Muse running when you disconnect
- **Muse models**: Meta's Model API, signed in with your Meta account or an API key

How it is reached:

- ssh my-muse-code.exe.xyz (private): your terminal, with Muse in a tmux session

## Deploy with Shelley

Open https://exe.dev/new?prompt=Set%20up%20Muse%20Code%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe.dev%2Fdeploy%2Fmuse-code.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-muse-code.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-muse-code.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20Muse%20Code%20installed%20with%20Meta%27s%20official%20installer%2C%20answering%20a%20test%20prompt%20with%20no%20account%0A-%20A%20project%20folder%20at%20%60~%2Fproject%60%20on%20persistent%20disk%0A-%20A%20%60muse%60%20tmux%20session%20that%20survives%20disconnects%2C%20ready%20for%20you%20to%20sign%20in%20to%20Meta%0A%0ARun%20only%20the%20VM-side%20commands%20in%20%22Install%20Muse%20Code%22%20%28skip%20VM%20creation%0Aand%20SSH%29.%20If%20~%2Fproject%20already%20exists%2C%20use%20it%20as%20it%20is.%20Create%20tmux%0Adetached%20%28%60tmux%20new%20-d%20-s%20muse%20-c%20~%2Fproject%60%29%20rather%20than%20attaching%2C%0Aand%20reuse%20the%20session%20if%20it%20exists.%20Do%20not%20start%20interactive%20%60muse%60%2C%0Arun%20%60muse%20login%60%2C%20or%20ask%20for%20a%20Meta%20API%20key%3A%20signing%20in%20is%20the%20owner%27s%0Astep.%20Don%27t%20change%20an%20existing%20~%2F.config%2Fmuse.%0AVerify%20%60~%2F.local%2Fbin%2Fmuse%20--version%60%20prints%20a%20version%20and%2C%20from%0A~%2Fproject%2C%20%60~%2F.local%2Fbin%2Fmuse%20exec%20--provider%20echo%20--trust-workspace%0A%27ready%27%60%20prints%20%60echo%3A%20ready%60%20%28no%20account%20needed%29.%20Check%0A%60tmux%20has-session%20-t%20muse%60.%20Skip%20the%20later%20optional%20sections%20and%20FAQ.%0AFinish%20with%20the%20SSH%20command%20from%20%22Leave%20it%20running%22%2C%20using%20this%20VM%27s%0Aname%2C%20and%20tell%20the%20owner%20to%20run%20%60muse%60%20inside%20it%20and%20sign%20in.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open.%0A to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://exe.dev/deploy/muse-code/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Or follow the steps below by hand.

[Muse Code](https://dev.meta.ai/docs/muse-code) is Meta's terminal coding
agent, in the same family as Claude Code and Codex. Meta
[released it](https://research.meta.ai/blog/introducing-muse-code-and-muse-spark-1-2)
on August 5, 2026 alongside Muse Spark 1.2; it now also runs Muse Spark 1.3
and Muse Wonder. It's built for long jobs: `/goal` keeps the agent working
until a goal is met, `/loop` reruns a prompt on a schedule, subagents work
in parallel (each in its own git worktree when they write), and every
session is an append-only event log, so a crashed run resumes where it
stopped.

All of that works best on a computer that stays on. On an exe.dev VM, Muse
runs in tmux on a persistent disk: close your laptop, and the goal, the
loops, and the subagents keep going. SSH back in and reattach. If the VM
ever restarts, the event log is still on disk and `muse resume --last`
carries on.

## Install Muse Code

On your computer, create a VM and connect. Pick any free name; if you've
already clicked Deploy or have a VM, skip the first command and use its
name:

```bash
ssh exe.dev new --name=my-muse-code
ssh my-muse-code.exe.xyz
```

On the VM, install Muse Code with Meta's installer, make a project folder,
and open a tmux session:

```bash
curl -fsSL https://dev.meta.ai/install.sh | bash
source ~/.bashrc
muse --version
mkdir -p ~/project && git -C ~/project init -q
tmux new -A -s muse -c ~/project
```

`muse --version` should print `Muse Code 1.4.18` or newer. The installer
puts a launcher at `~/.local/bin/muse` and adds that folder to your `PATH`.

## Sign in and start coding

Inside the tmux session, start Muse:

```bash
muse
```

It asks whether to trust the folder (choose **Trust and continue**), then
how to sign in. **Sign in with your browser** works over SSH: Muse prints a
`https://auth.meta.com/oauth/device/...` link and a code. Open the link on
your computer, check the code matches, and approve. You can also run
`muse login` for the same flow. Muse keeps the sign-in in
`~/.config/muse` on the VM. A Muse Code subscription works only through
this sign-in.

Then give it a task. For example:

> Build a small command-line tool that prints the weather for a city, with tests.

For longer work, set a goal and let it run:

```text
/goal Add a JSON output flag and make every test pass
```

Commands run in Muse's OS sandbox, which works on exe.dev VMs as it is:
the agent can write in the project folder and its temp directory, and the
rest of the disk is read-only to it. Risky commands and new network
destinations need approval, and its automated reviewer clears the safe
ones. See
[Permissions and safety](https://dev.meta.ai/docs/muse-code/permissions)
for the other profiles.

Muse reads `AGENTS.md` or `CLAUDE.md` for project instructions (`muse init`
writes a starter `AGENTS.md`). It also reads your personal Claude Code
rules; on exe.dev those include notes on how the VM's HTTPS proxy works.

## Leave it running

Press **Ctrl-b**, then **d** to detach. Muse keeps working on the VM while
you're gone. On your computer, use this command to hop back in:

```bash
ssh -t my-muse-code.exe.xyz 'tmux new -A -s muse -c ~/project'
```

When you come back after a couple of minutes away, Muse shows a recap of
what happened. `/tasks` and `/subagents` show background work, and `/stop`
stops background commands (`Esc` only interrupts the current turn).

A VM restart ends the tmux session but not your work. Reconnect and, from
the project folder, run:

```bash
muse resume --last
```

Muse rebuilds the conversation from its log, notes that the last run ended
abnormally, and continues. Meta's docs warn that an interrupted step with
side effects is marked as unknown for the agent to check, not repeated
blindly.

For a second, independent task, open another tmux window (**Ctrl-b**, then
**c**) and start `muse` in another folder or git worktree. Named sessions
can send each other handoffs with
[session messaging](https://dev.meta.ai/docs/muse-code/session-messaging).

## Make yourself at home

- **Bring your code:** [connect a GitHub repo](/docs/integrations-github)
  and clone it with `git clone https://github.int.exe.xyz/you/repo.git`.
  No GitHub token goes on the VM. Muse won't commit or push unless you
  ask, and `GH_HOST=github.int.exe.xyz` lets it use `gh` for pull requests.
- **Peek at your app:** the sandbox's default network mode keeps ports the
  agent opens inside the sandbox, so a dev server it starts isn't reachable
  from your browser. Either start the server yourself in another tmux
  window, or start Muse with `muse --sandbox-network enabled`, which lets
  sandboxed commands use the network freely. Then serve on
  `0.0.0.0:8000` and open `https://my-muse-code.exe.xyz/`, which only you
  can reach. [More about previews](/docs/proxy).
- **Run it headless:** `muse exec "Run the tests and fix what fails"` runs
  one prompt to the end, for scripts and cron. Add `--max-model-steps` to
  cap a run, and `muse exec --session-id <uuid> "Continue."` resumes one.
  See [headless and CI](https://dev.meta.ai/docs/muse-code/extending#headless).
- **One VM per task:** `ssh exe.dev cp my-muse-code my-muse-code-2` copies
  the VM, with Muse, its sign-in, and your code, so a risky job can't touch
  the original. Or give an agent [exe.dev's MCP server](/deploy/exe-mcp)
  with a token limited to one tag, and it can make VMs of its own.
- **Shelley is here too:** exe.dev's own agent runs on the same VM at
  `https://my-muse-code.shelley.exe.xyz/`, and Claude Code and Codex are
  preinstalled, all on exe.dev's LLM integration with no key. Use one for
  a second opinion on what Muse built.

Other agents with pages here: [Claude Code](/deploy/claude-code),
[Codex](/deploy/codex), [Gemini CLI](/deploy/gemini-cli),
[Kimi Code](/deploy/kimi-code), and the rest of the
[AI agents category](/deploy/category/ai-agents).

## Keep a Meta API key off the VM

Pay-as-you-go accounts can use a Meta API key instead of signing in, and
Meta Managed Account (Business & Enterprise) users must. `muse auth set
--api-key-stdin` would store the key on the VM. To keep it at exe.dev's
edge instead, put it in an [HTTP proxy integration](/docs/integrations-http-proxy)
and point Muse at the integration.

On your computer, create the integration; paste the key at the prompt:

```bash
printf 'Meta API key: '; read -rs K; echo
printf %s "$K" | ssh exe.dev integrations add http-proxy --name meta-api \
  --target https://api.meta.ai --bearer=- --attach vm:my-muse-code
unset K
```

On the VM, point Muse's Meta provider at it and give Muse a placeholder
key; the integration sends the real one to Meta. This adds one setting to
`~/.config/muse/settings.json`, which Muse creates on its first run:

```bash
f=~/.config/muse/settings.json
mkdir -p ~/.config/muse
[ -f $f ] || echo '{"schema_version": 1}' > $f
jq '.endpoint_transport.base_url = "https://meta-api.int.exe.xyz/v1"' $f > $f.new && mv $f.new $f
echo 'export META_API_KEY=kept-by-exe-dev' >> ~/.bashrc
source ~/.bashrc
cd ~/project && muse exec "Reply with exactly: OK"
```

An environment key takes priority over a browser sign-in, so use one or
the other. `muse exec` asks you to trust the folder the first time; run
`muse` once there, or add `--trust-workspace`.

> [!NOTE]
> We checked that Muse sends its requests to the integration's address
> with this setting, but haven't run it with a real Meta API key.

## Troubleshooting

- **`Read-only file system`**: the sandbox at work. Start `muse` from the
  folder it should write to; the rest of the disk, and `.git` inside the
  project, are read-only to sandboxed commands.
- **`failed to fetch model catalog: authentication failed`**: the key in
  `META_API_KEY` was rejected. It takes priority over a sign-in, so unset
  it to use your browser sign-in, or fix it.
- **`workspace trust ... is undecided`** from `muse exec`: run `muse` once
  in that folder and trust it, or pass `--trust-workspace`.
- **A preview doesn't load:** see "Peek at your app" above.
- **`invalid value 'unrestricted' for '--sandbox-network'`**: Meta's docs
  use the new name; version 1.4.18 still wants `enabled`.
- **Anything else:** `MUSE_TRANSPORT_TRACE=1 muse ...` prints the requests
  to Meta's API, with credentials scrubbed, and Muse keeps its own logs in
  `~/.local/share/muse/local-tracing`. `/feedback` reports a bug to Meta.

## Frequently asked questions

### Can I use exe.dev's LLM integration instead of a Meta account?

No. Muse Code only talks to Meta's Model API (its `--provider` choices are `meta`, a test `echo` provider, and a `local` option that is disabled behind an experiment), and the [LLM integration](/docs/integrations-llm) serves OpenAI, Anthropic and Fireworks models. Sign in with your Meta account, or keep a Meta API key in an [HTTP proxy integration](/docs/integrations-http-proxy) as shown above. Claude Code and Codex, preinstalled on the VM, do use the LLM integration with no key.

### What does it cost?

Your [VM plan](https://exe.dev/pricing) plus Meta's charges. Muse Code has monthly [subscriptions](https://dev.meta.ai/docs/muse-code/subscriptions) (Everyday, High, Power and Maximum Usage) or [pay-as-you-go](https://dev.meta.ai/docs/pricing-rate-limits) billing: Muse Spark is $1.25 per million input tokens and $4.25 per million output in Standard mode, and its `-contributor` models are $0.10 and $0.20. Its background observer agents make model calls of their own.

### What is Contributor mode?

Meta's cheaper tier: you get more usage, or lower token prices, and Meta may use your prompts, code, files and the responses to train future models. In Standard mode it doesn't. Subscriptions default to Contributor mode, and Meta's docs say the first interactive session on a new computer turns it on, so a new VM counts. Switch it in `/settings` under Model, or per run with `--contributor-mode off`. On pay-as-you-go, you choose by model ID (`muse-spark-1.3` or `muse-spark-1.3-contributor`).

### Does it keep working when I close my laptop?

Yes, while the VM is up: Muse runs in tmux on the VM, not on your laptop, so turns, subagents, `/goal` and `/loop` carry on. A VM restart stops the process; `muse resume --last` from the project folder picks the session up again from its event log.

### How do I update Muse Code?

The `muse` launcher checks for a new release at most once an hour when you start it and updates in the background. To update right away, rerun the installer. Set `MUSE_NO_AUTO_UPDATE=1` to stop automatic updates. See Meta's [changelog](https://dev.meta.ai/docs/muse-code/changelog).

### How do I back up my work?

Commit and push your code. For a copy of the whole VM, including Muse's sessions and sign-in, run `ssh exe.dev cp my-muse-code my-muse-code-backup` on your computer. Reattach any [VM-specific integrations](/docs/integrations-attach) to the copy.


## Related

- [Run Claude Code on a remote server](https://exe.dev/deploy/claude-code.md): A computer for Claude. A breather for your laptop.
- [Run Codex on a remote server](https://exe.dev/deploy/codex.md): A computer for Codex. An early night for your laptop.
- [Run Kimi Code CLI on a remote server](https://exe.dev/deploy/kimi-code.md): Moonshot's coding agent, with a Linux box that never sleeps.
- [Run Gemini CLI on a remote server](https://exe.dev/deploy/gemini-cli.md): Google's terminal agent on a VM of its own, with the API key kept off it.
- [Give any agent a sandbox over MCP](https://exe.dev/deploy/exe-mcp.md): One URL gives your agent real VMs to run code on, host apps from, and hand work to.
- [Give agents API access without giving them the keys](https://exe.dev/deploy/agent-secrets.md): Your agents call your APIs. The keys stay with exe.dev, outside the VM.
