Self-host Metorial with Docker Compose
Run the open-source Metorial Platform on your own machine or server with the Docker Compose file and run.sh script in the metorial-platform repository.
To self-host Metorial, clone the open-source Metorial Platform repository and run ./self-hosting/run.sh --host localhost --secret "$(openssl rand -hex 32)" from the repository root. The script builds the dashboard, starts the API and its backing services (PostgreSQL, Redis, MongoDB, Meilisearch, MinIO, OpenSearch, and etcd) with Docker Compose, and serves the dashboard on port 3300. You need Docker with Compose, at least 8 GB of RAM, about 20 GB of disk, and Node.js, npm, and Bun for the frontend build.
What you'll learn
- What the self-hosted stack contains
- How to start, check, and stop it
- What to change before you expose it to anyone
Before you start
- Docker and Docker Compose
- At least 8 GB of RAM and 20 GB or more of free disk
- Node.js, npm, and Bun on the machine that builds the frontend
Important
The repository's self-hosting setup is aimed at running and evaluating the open-source platform. For production deployments with strict compliance needs, Metorial offers on-prem hosting with dedicated support and SLAs.
What runs
| Service | Image or source | Host ports |
|---|---|---|
| API (core, MCP, marketplace, OAuth, private, portals, integrations, ID) | ghcr.io/metorial/metorial-api:dev | 4310 to 4316, 4321 |
| PostgreSQL | postgres:latest | 35432 |
| Redis | redis:latest | 36379 |
| MongoDB | mongo:latest | 32707 |
| Meilisearch | getmeili/meilisearch:v1.14 | 37700 |
| MinIO | minio/minio:latest | 9000, 9001 (console) |
| OpenSearch and OpenSearch Dashboards | opensearchproject/opensearch:2.18.0 | 9200, 9600, 5601 |
| etcd | bitnamilegacy/etcd:latest | 32379, 32380 |
| Dashboard and MCP Inspector | Built from source by run.sh | 3300, 6050 |
Start Metorial
Clone the repository
Run the setup script
The script installs frontend dependencies, generates the Prisma client, builds the dashboard and the MCP Inspector, writes self-hosting/.env, pulls the images, runs docker compose up -d, and starts two small web servers for the frontends.
Open the dashboard
Open http://localhost:3300 and create an account. The MCP Inspector runs on http://localhost:6050, and the core API on http://localhost:4310.
Connect a first integration
Configure an MCP server or integration in the dashboard, then try its tools in the Explorer. See Integrations and the SDK quickstart.
Script options
| Option | What it does |
|---|---|
--host, -h | Hostname for the deployment, for example localhost or mydomain.com (required) |
--secret, -s | Secret for encryption and auth tokens (required) |
--env, -e | production (default) or development |
--email-host, --email-port, --email-user, --email-pass, --email-from | SMTP settings for outgoing email |
--skip-build, --skip-backend, --skip-serve | Skip the frontend build, the Docker services, or the web servers |
--status, --logs, --stop | Show status, follow logs, or stop everything |
You can also set METORIAL_HOST and METORIAL_SECRET as environment variables instead of passing flags.
Manage the stack
To work with the containers directly, use the compose file:
Data lives in named Docker volumes: postgres_data, mongodb_data, redis_data, meilisearch_data, minio_data, and opensearch_data. Back them up regularly. docker compose down -v deletes them.
Before you expose it
The compose file is set up for a local machine. Before anyone else uses it:
- Replace the default credentials in
docker-compose.yml: PostgreSQLpostgres/postgres, MongoDBmongo/mongo, MinIOminio/minio123, and OpenSearchadmin/admin. - Turn on OpenSearch security. The compose file sets
DISABLE_SECURITY_PLUGIN=true. - Use a strong, unique
--secret. It is used for encryption and auth tokens. - Put a reverse proxy with TLS in front of the dashboard and API ports, and stop publishing database ports to the host.
- Set resource limits, schedule backups, and consider managed databases.
- Pin image tags instead of
latestanddev, and update them for security patches.
Troubleshooting
Services do not start
Check the logs of the API with docker compose -f ./self-hosting/docker-compose.yml logs api.
The API cannot reach the database
PostgreSQL may not have finished starting. Restart the API service once PostgreSQL is up.
A port is already in use
Change the host port in self-hosting/docker-compose.yml, and update the matching URL environment variables of the API service.
Containers crash or run slowly
Give Docker more memory. The stack needs at least 8 GB of RAM.
FAQ
Is Metorial really open source?
Yes. The platform code is on GitHub at metorial/metorial-platform under the Functional Source License (FSL-1.1-ALv2), which converts to Apache 2.0 two years after each release. The integration catalog in metorial/metorial is Apache 2.0, and so is the Outpost proxy.
Is the self-hosted version the same as the hosted platform?
It is built from the same platform repository, but the hosted platform includes managed infrastructure and operations. Ask Metorial which features your deployment needs before choosing between self-hosting, on-prem hosting, and the hosted platform.
Do we have to self-host to keep data in our network?
No. An Outpost keeps MCP traffic inspection and redaction in your network while you use the hosted platform, and the None retention level stops Metorial from storing message data.
What does self-hosting cost?
The code is free to run. You pay for your own infrastructure. For hosted and on-prem plans, see pricing.
To see which other MCP gateways can be self-hosted and under what license, see Self-hosted and open-source MCP gateways in the MCP gateway comparison.