Skip to Content
NeoRun

Self-host with Docker Compose

Run the whole NeoRun control plane with one docker compose up.

One docker compose up runs the whole control plane: PostgreSQL, NeoRun itself (the console, sign-in, and the MCP endpoint at /mcp), and Caddy in front for HTTPS. Everything happens in the deploy/ folder of the repository.

Run it on its own machine

Do not run NeoRun on a server you let agents deploy to. A broken deploy on that server would take the approval page with it, and an app an agent deployed would sit next to NeoRun's database and the key that unlocks your SSH credentials.

Planned

Signing in through your company's own identity provider is planned and not built. Today NeoRun has its own accounts: a username and a password.

You need Docker with Compose 2.24 or later. Check with docker compose version.

1. Settings

From the deploy/ folder:

cp .env.example .env
chmod 600 .env

Fill in the two secrets as the comments in .env say:

openssl rand -base64 32   # NEORUN_ENCRYPTION_KEY
openssl rand -hex 24      # NEORUN_DB_PASSWORD

Keep NEORUN_ENCRYPTION_KEY safe and never change it. It decrypts the SSH credentials NeoRun stores, and backups deliberately do not contain it.

Then pick one of two modes.

Local mode (default)

For one machine or a home network. Caddy issues its own certificate, so nothing about your instance reaches a public certificate authority.

  • On this machine only: leave the defaults and open https://localhost:8765.
  • On a home network: set NEORUN_PUBLIC_HOST to a stable local name for the machine and NEORUN_BIND_ADDRESS=0.0.0.0.

Every device has to trust Caddy's root certificate once, or browsers warn and agents refuse to sign in. After the first start, copy it out and install it as a trusted root on each device:

docker compose cp caddy:/data/caddy/pki/authorities/local/root.crt ./neorun-root.crt

Public mode

For a server with a DNS name, reachable from the internet, with a Let's Encrypt certificate that every browser and phone trusts. You need:

  1. A DNS name. An A record (and AAAA for IPv6) pointing at the server, for example app.example.org.
  2. Open ports. 80 and 443 reachable from the internet, in the server's firewall and in your cloud provider's firewall. Port 80 answers Let's Encrypt's check and redirects to HTTPS.
  3. Settings in .env.
NEORUN_PUBLIC_HOST=app.example.org
COMPOSE_FILE=docker-compose.yml:docker-compose.public.yml
NEORUN_ACME_EMAIL=you@example.org

COMPOSE_FILE adds docker-compose.public.yml, so every docker compose command below works unchanged.

A separate address for agents (optional)

By default one address serves everything. To give agents their own address (say mcp.example.org next to a console at console.example.org), add a DNS record for it that points at the same server and set:

NEORUN_PUBLIC_HOST=console.example.org
NEORUN_MCP_HOST=mcp.example.org

Then agents connect to https://mcp.example.org/mcp, and that address serves only the agent endpoint and its OAuth discovery document. The console address stops serving /mcp. A token is valid only for the address it was issued for, so agents connected before you set this have to connect again.

To move an old hostname to the console address, list it in NEORUN_REDIRECT_HOSTS (separated by spaces). It then redirects permanently (301) to the console address, keeping the path and query.

2. Start

docker compose up -d --build
docker compose ps        # all three healthy

In public mode the certificate arrives within a minute or so. docker compose logs caddy shows it.

3. Create the admin account

Until an admin exists, anyone who can reach the console could create one. That is why setup asks for a one-time code that only someone with access to the server can read:

docker compose logs control | grep "setup code"

Open https://<your host>/, enter the code, and choose a username and password. A restart before setup prints a new code. If you forget the password later:

docker compose exec control neorun reset-password <username>

To add someone:

docker compose exec control neorun add-user <name> --role viewer

The role is admin, member or viewer. Only setup creates the owner. The command prints a generated password once. Add --password-stdin to give one yourself. A viewer sees everything a member sees and decides nothing.

4. Connect an agent

In the console, open Connect agent. The MCP endpoint is https://<your host>/mcp, or https://<NEORUN_MCP_HOST>/mcp if you gave agents their own address. The agent signs in through your browser, and write access always needs your password. See Connect your agent.

Phone notifications

Settings, then Notifications, tells your phone when something waits for your approval. A browser only accepts notifications from an address it trusts: they need public mode, or a local certificate that the device has trusted as above. On an iPhone or iPad, add NeoRun to the Home Screen first (Share, then Add to Home Screen) and turn them on from that icon.

The control plane needs to reach the browsers' push services (Google, Mozilla, Apple, Microsoft) on port 443 to send them. Optionally set NEORUN_PUSH_CONTACT (a mailto: or https: address) as a contact for those services.

Settings reference

VariableWhat it does
NEORUN_ENCRYPTION_KEYRequired. Decrypts stored SSH credentials. Never change it.
NEORUN_DB_PASSWORDRequired. Password for the bundled PostgreSQL. Read only when the database volume is first created.
NEORUN_PUBLIC_HOSTThe address browsers and agents use. Default localhost.
NEORUN_HTTPS_PORTLocal mode port. Default 8765.
NEORUN_BIND_ADDRESSLocal mode bind address. Default 127.0.0.1.
COMPOSE_FILESet to docker-compose.yml:docker-compose.public.yml for public mode.
NEORUN_ACME_EMAILPublic mode: the Let's Encrypt account email.
NEORUN_MCP_HOSTPublic mode, optional: a separate address for agents.
NEORUN_REDIRECT_HOSTSPublic mode, optional: old hostnames that redirect to the console address.
NEORUN_BACKUP_INTERVAL_SECONDSOptional: run scheduled backups. Unset or 0 means off.
NEORUN_BACKUP_KEEPOptional: how many scheduled archives to keep.
NEORUN_PUSH_CONTACTOptional: contact for push services.

Backups

docker compose exec control neorun backup --output-dir /backups --keep 14

Archives land in ./backups next to the Compose file. Copy them off the machine yourself, and keep .env (the encryption key) somewhere safe too: without the key, a restored database cannot decrypt its SSH credentials.

To restore, the control plane must be stopped:

docker compose stop control
docker compose run --rm control neorun restore /backups/<archive> --confirm
docker compose start control

Updates

git pull
docker compose up -d --build

Database migrations run when the control plane starts. Take a backup first.

Edit this page on GitHub

On this page