MetorialDocs

Fix errors from the Metorial self-hosting script

What each error from self-hosting/run.sh means, from Host is required! to Failed to start backend services, and the command that gets the Docker Compose stack running.

./self-hosting/run.sh stops at the first failed check and prints a line that starts with ✗. Find that line below. To see the state of a stack that did start, run ./self-hosting/run.sh --status, then ./self-hosting/run.sh --logs.

What you'll learn

  • What each run.sh error means and how to fix it
  • How to read the logs of a service that does not start
  • How to stop the stack and start again

Before you start

Arguments

Host is required!

The script needs a hostname. Pass it with --host, or set METORIAL_HOST:

./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)"

Secret is required!

The backend needs a secret for encryption and auth tokens. Pass it with --secret, or set METORIAL_SECRET:

export METORIAL_SECRET="$(openssl rand -hex 32)"
./self-hosting/run.sh --host localhost

Invalid environment:

--env accepts development or production. Leave the flag out to get production.

Unknown option:

The script does not know the flag that follows the colon. Print the accepted ones:

./self-hosting/run.sh --help

Frontend build

Could not find repository root with src/metorial-frontend/apps/dashboard

The script walks up from its own folder to find the repository root and did not find the dashboard source. Run it from a full clone:

git clone https://github.com/metorial/metorial-platform.git
cd metorial-platform
./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)"

Inspector directory not found at:

The script builds the MCP Inspector from vendor/mcp-inspector, and that folder is missing in your clone. To start only the backend services, skip the frontend build and the web servers:

./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)" --skip-build --skip-serve

Node.js is not installed!

The script needs Node.js, npm, and Bun to build the dashboard. npm is not installed! and Bun is not installed! are the same check for the other two. Install Node.js 18 or later, which includes npm, then install Bun:

curl -fsSL https://bun.sh/install | bash

Prisma generation failed!

bun run prisma:generate failed at the repository root. The error is in the output above the line. Install dependencies and run the step on its own to read it:

bun install
bun run prisma:generate

Root build failed!

bun run build failed at the repository root. Dashboard build failed! is the same for the dashboard. Scroll up to the first error in the build output. Once you have a working build, later runs can skip it:

./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)" --skip-build

Backend services

Docker is not installed!

Install Docker from docs.docker.com/get-docker. Docker Compose is not available! means docker compose version failed, so install the Compose plugin or a current Docker Desktop.

Docker daemon is not running!

docker info failed. Start Docker Desktop, or on Linux:

sudo systemctl start docker
docker info

Failed to pull required images

docker compose pull failed for a reason other than a missing image. The script prints the pull log. Check your network and registry access, then pull by hand:

docker compose -f ./self-hosting/docker-compose.yml pull

The warning Some images could not be pulled (possibly private/unavailable) does not stop the script. It continues with the images it has.

Failed to start backend services

docker compose up -d failed, and the script prints the output under Error details:. If it also prints Some Docker images are not available, an image is private or missing for your CPU architecture. Sign in to the registry and start again:

docker login ghcr.io
./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)" --skip-build

A port that is already in use fails here too. Change the host port in self-hosting/docker-compose.yml and update the matching URL variables of the api service.

A service starts and does not work

The script only waits five seconds after docker compose up, so a service can still be starting or crash later.

# Which containers are up
docker compose -f ./self-hosting/docker-compose.yml ps

# Logs of the API
docker compose -f ./self-hosting/docker-compose.yml logs api

# Restart the API once PostgreSQL is up
docker compose -f ./self-hosting/docker-compose.yml restart api

Containers that exit or restart in a loop usually lack memory. The stack needs at least 8 GB of RAM for Docker.

Start over

./self-hosting/run.sh --stop
./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)"

Note

Data lives in named Docker volumes and survives --stop. docker compose -f ./self-hosting/docker-compose.yml down -v deletes the volumes and all data in them.

When the script finishes, the dashboard answers on http://localhost:3300.

Next steps