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.sherror 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
- A clone of metorial-platform, with your shell at its root
- Docker with Compose, Node.js, npm, and Bun
Arguments
Host is required!
The script needs a hostname. Pass it with --host, or set METORIAL_HOST:
Secret is required!
The backend needs a secret for encryption and auth tokens. Pass it with --secret, or set METORIAL_SECRET:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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.
Containers that exit or restart in a loop usually lack memory. The stack needs at least 8 GB of RAM for Docker.
Start over
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
- Docker Compose setup files in the Metorial Platform repository
- Keep data in your network: Outposts and retention levels on the hosted platform
- Error reference: Metorial error messages with their fixes