---
title: "On a server"
summary: "Run the mirror on a Linux server in your own data centre or cloud account, whichever vendor: what the machine must offer, the portal over SSH, scheduled runs, and locking it down."
read_when: "the mirror should run on a server or a cloud instance, not a laptop"
url: https://mirrordimensions.com/docs/running-on-a-server/
source: https://github.com/mirrordimensions/mirrordimensions/blob/main/docs/running-on-a-server.md
---

# On a server

Run the mirror on a Linux server in your own data centre or cloud account, whichever vendor: what the machine must offer, the portal over SSH, scheduled runs, and locking it down.

The mirror runs on a Linux x64 server as it does on a laptop: the same commands, the same engine, the same checks. This page is for a team that wants it on a machine in their own data centre or their own cloud account, so that worlds can be larger, runs can be scheduled, and results sit in one place.

Nothing here depends on a cloud vendor. The mirror calls no vendor's API and does not know where the machine is. What it needs is stated below as properties of the machine; a short section says how each of three large vendors offers them.

**What has been checked.** The Linux path is run on every change in the project's CI, on a hosted Linux x64 runner with KVM. No row in [platforms.md](https://mirrordimensions.com/docs/platforms/) is from a rented cloud server yet. Treat the first setup on yours as a verification: run `mirror engine check` and `mirror doctor`, and trust the result only when every line passes.

## What this is, and what it is not

It is one operator's tool on a machine reached over SSH. You sign in, run `mirror` commands, and open the portal through an SSH tunnel.

It is not a shared service:

- **One operator at a time.** The portal and the operator MCP server listen on `127.0.0.1` only, with one token. Everyone who reaches them acts as the same person. Neither has an option to listen elsewhere, and none should be added with a proxy: they are the control plane.
- **One world at a time per engine.** Every world shares the engine, and only one world's sandbox runs. A second world's command is refused while the first is busy.
- **One engine per user account.** The engine belongs to the account that set it up. Several accounts on one server, each with an engine of its own, is how the design would serve several people, and it has not been measured.

Sign-in for many users, organisations and a hosted endpoint for remote agents belong to a hosted service, not to this repository ([GOVERNANCE.md](https://github.com/mirrordimensions/mirrordimensions/blob/main/GOVERNANCE.md)).

## What the server must offer

| Property | Needed |
| --- | --- |
| Processor | x64. ARM servers are not a supported host |
| Operating system | A current Linux. Debian and Ubuntu are what the setup steps are written for |
| Virtual machines | `/dev/kvm`, which your account may open. The engine is a virtual machine of its own, and there is no way to run without one. See the next section when the server has none |
| Memory | 16 GB at least. The engine takes 6 GB by default; `mirror engine setup --memory` gives it more for a larger world |
| Disk | 30 GB free or more. About 7 GB for the engine and 6.5 GB for a small world; snapshots and agent images add to it |
| Inbound network | SSH, from where you work. Nothing else |
| Outbound network | During setup, the hosts in [restricted-networks.md](https://mirrordimensions.com/docs/restricted-networks/). During a run, your model provider only |

### Virtual machines on a rented server

A rented server is usually a virtual machine itself, and gives its guest `/dev/kvm` only when it offers nested virtualization. `mirror engine preflight` says which case you are in, before anything is downloaded.

You have two choices, in this order of preference:

1. **A size with nested virtualization, switched on.** The engine then runs as it does everywhere else, with the boundary `dedicated VM`.
2. **A bare-metal server.** The same result, at a higher price.
There is no third choice today. The `host` driver, which would use Docker Engine and gVisor on the server itself with no virtual machine, does not set up the firewall at the engine's edge, so `mirror engine setup --driver host` refuses to go on. A server without KVM cannot hold a world.

How the three largest vendors offer the first choice, as their documentation said in December 2026. None of this has been run by the project, and each vendor changes its list, so read the page linked before you choose a size.

| Vendor | Nested virtualization | Their page |
| --- | --- | --- |
| AWS | On some Intel instance families of the seventh and eighth generation (C8i, M8i and R8i among them), switched on in the instance's CPU options at launch or while it is stopped. Not on Graviton. Bare-metal instances have always had KVM | [Nested virtualization in EC2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-ec2-nested-virtualization.html) |
| Google Cloud | A setting on the instance, on most Intel machine series. Not on E2 or ARM machines, and an organisation policy can forbid it | [About nested virtualization](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview) |
| Azure | Available on many Intel sizes from Dv3 and Ev3 onward with no setting to switch on. The security type must be Standard: Trusted Launch does not allow it | [Azure virtual machine sizes](https://learn.microsoft.com/azure/virtual-machines/sizes/overview) |

Whichever you choose, the check is the same on all of them:

```sh
ls -l /dev/kvm            # it exists
mirror engine preflight   # "Virtual machines are allowed: ok"
```

## Set it up

Sign in to the server and follow "Set up your laptop" in [your-company.md](https://mirrordimensions.com/docs/your-company/), the Linux steps. In short:

```sh
sudo apt-get install -y git qemu-system-x86 qemu-utils
sudo usermod -aG kvm "$USER"                 # then sign out and in
curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/mirrordimensions/mirrordimensions
cd mirrordimensions
uv tool install --editable .

mirror engine preflight                      # can this server hold an engine?
mirror engine network                        # does its network let setup download?
mirror engine setup --memory 12 --disk 80    # sizes to suit the server
mirror engine fetch                          # everything a first world needs, now
mirror engine check                          # every line should start with ok
```

Then define a world, add your agent and run, as on a laptop.

Use an account of your own for this, not `root`, and one that nothing else on the server uses: the engine lives in its home folder, and the worlds and their keys should too.

## Use the portal from your own computer

The portal listens on the server's `127.0.0.1`. Carry that port to your computer over SSH, and keep the same port number at both ends: the portal answers only to the address it printed.

On the server, in a session that outlives your connection (`tmux` or `screen`):

```sh
cd ~/worlds/your-world
mirror portal --no-open --port 7420
```

On your computer:

```sh
ssh -N -L 7420:127.0.0.1:7420 you@the-server
```

Then open, on your computer, the address the server printed (`http://127.0.0.1:7420/?token=...`). The token is the key to the control plane: do not paste it into a chat or a ticket.

The operator MCP server works the same way. `mirror mcp serve` over stdio needs no port at all when your AI tool starts it through `ssh`; `mirror mcp serve --http` listens on `127.0.0.1` and is carried by a tunnel like the portal.

## Scheduled runs

A run needs no terminal and no portal. From `cron`, a systemd timer or your CI's runner on the server:

```sh
cd ~/worlds/your-world && mirror --json run core --agent your-agent
```

The exit code says what happened:

| Code | Meaning |
| --- | --- |
| 0 | Every run passed |
| 1 | A run failed its checks |
| 3 | Isolation failed, and nothing ran |
| 4 | A run errored inside the mirror, or its coverage is incomplete. Its result is not evidence |

Each run keeps its own folder under the world's `.mirror/runs/`, and `mirror report <run>` writes one page that opens from disk with nothing else. Copy that page, not the folder, to where the team reads results. `mirror runs rm --keep-last <n>` keeps the disk from filling.

Two schedules must not overlap in one engine: a run that starts while another world's is in progress is refused and exits with an error. Give each schedule its own time, or its own account and engine.

## Locking the server down

The sealed network is made inside the engine and does not rely on the server's firewall. These measures are for the server itself, which holds what a laptop holds and is reachable by more people.

- **Inbound: SSH only.** Open no other port in the firewall or security group. Do not put a load balancer, a reverse proxy or a public address in front of the portal.
- **Outbound: only what is used.** After setup and `mirror engine fetch`, a world needs your model provider's host on port 443 and nothing else. Restrict the server's outbound rules to that, and open the setup hosts again when you update the engine or add an agent whose image must be pulled. Where outbound rules cannot name hosts, send traffic through a proxy that can; [restricted-networks.md](https://mirrordimensions.com/docs/restricted-networks/) says how the mirror is told about a proxy.
- **No route to real systems.** Put the server in a network that cannot reach the company's own services: its own VPC or VLAN, with no peering. A world is synthetic by design, and this makes a mistake in a definition harmless.
- **No cloud identity on the server.** Give the instance no role, service account or managed identity. Nothing in the mirror uses one, and anything that runs on the server could.
- **The secrets are on the server's disk.** The model key is read from the environment variable the world names; set it for the session or the scheduled job, and keep it out of shell history and world folders. Each world's root CA key is in the world's folder, under `.mirror/`, and the engine is under `~/.mirrordimensions`. Encrypt the disk, and treat a snapshot or backup of the server as holding all of it.
- **Few accounts.** Anyone who can become your user on the server can read every world, every run and the keys, and can drive the control plane.

## Keeping it running

- The engine keeps running when you sign out, unless the server ends a user's programs at sign-out. If it does, the next `mirror` command starts the engine again and says so.
- After the server restarts, the engine is stopped. `mirror engine start`, or any command that needs it, starts it. A world's sandbox comes back with `mirror up`, and a run starts from the base snapshot whatever the state before.
- To update, follow [updating.md](https://mirrordimensions.com/docs/updating/). Stop the portal first and start it again afterwards.
- `mirror engine clean` removes images nothing needs, and `mirror engine destroy` gives back everything before the server is returned.

## What differs from a laptop, and what does not

The design goals are the same and so are the checks that test them: nothing leaves the sandbox except the model call, everything the agent touches is recorded, and nothing the agent can see says it is a test.

What changes is around them. The server is reachable over a network, so its own access matters. A rented server's virtual machine runs inside another, which no measurement in [platforms.md](https://mirrordimensions.com/docs/platforms/) covers yet: restore times and build times there may differ from the ones recorded.
