This guide walks you through self-hosting Metorial on your own infrastructure using Docker Compose.
- Docker and Docker Compose installed
- At least 8GB of RAM available
- Sufficient disk space for volumes (recommended: 20GB+)
Metorial consists of three main application components and several supporting services:
API Service - The core backend service built with Bun/TypeScript that handles:
- REST API endpoints
- MCP protocol implementation
- OAuth provider integration
- Portal management
- Integration APIs
Engine Service - A Go-based gRPC service that:
- Manages MCP server instances
- Handles containerized tool execution
- Provides resource management
Frontend - React-based dashboard providing:
- Web interface for managing integrations
- MCP server explorer
- Monitoring and debugging tools
- PostgreSQL - Primary database for application data
- MongoDB - Stores usage data and logs
- Redis - Caching and real-time data processing
- Meilisearch - Search functionality
- MinIO - Object storage
- OpenSearch - Log aggregation and search
- etcd - Distributed configuration management
Create a .env file in the deployment/compose/ directory with the following required variables:
# Required
SECRET=your-secret-key-min-32-chars
HOST=http://localhost
# Email (AWS SES)
EMAIL_SES_ACCESS_KEY_ID=your-access-key
EMAIL_SES_SECRET_ACCESS_KEY=your-secret-key
EMAIL_SES_REGION=us-east-1
EMAIL_FROM_NAME=Metorial
# Optional: GitHub SCM integration
SCM_GITHUB_CLIENT_ID=your-github-client-id
SCM_GITHUB_CLIENT_SECRET=your-github-client-secret
# Optional: Deno Deploy
DENO_DEPLOY_TOKEN=your-deno-token
DENO_ORGANIZATION_ID=your-org-idThe following ports will be exposed on your host:
Application Ports:
- 4300 - Dashboard frontend
- 4310 - Core API
- 4311 - MCP API
- 4312 - Marketplace API
- 4313 - OAuth provider
- 4314 - Private API
- 4315 - Portals API
- 4316 - Integrations API
- 4321 - ID API
- 50050 - Engine gRPC
Service Ports:
- 35432 - PostgreSQL
- 36379 - Redis
- 32707 - MongoDB
- 37700 - Meilisearch
- 32379, 32380 - etcd
- 9000, 9001 - MinIO
- 9200, 9600 - OpenSearch
- 5601 - OpenSearch Dashboards
From the repository root, run:
docker compose -f ./deployment/compose/metorial.docker-compose.yml upAdd -d to run in detached mode:
docker compose -f ./deployment/compose/metorial.docker-compose.yml up -dOn first run, the services will:
- Download required Docker images
- Create data volumes in
deployment/compose/_volumes/ - Build the API and Engine services
- Run database migrations
- Start all services
This process may take 5-10 minutes depending on your system.
Once all services are running, verify the installation:
- Check service health:
docker compose -f ./deployment/compose/metorial.docker-compose.yml ps- Access the dashboard at
http://localhost:4300 - Check API health at
http://localhost:4310/health
docker compose -f ./deployment/compose/metorial.docker-compose.yml downTo remove volumes and reset data:
docker compose -f ./deployment/compose/metorial.docker-compose.yml down -vData is persisted in the deployment/compose/_volumes/ directory:
postgres/- Application databasemongodb/- Usage logs and analyticsredis/- Cache datameilisearch/- Search indicesminio/- Object storageopensearch/- Log data
Back up this directory regularly to prevent data loss.
Check logs for specific services:
docker compose -f ./deployment/compose/metorial.docker-compose.yml logs api
docker compose -f ./deployment/compose/metorial.docker-compose.yml logs engineEnsure PostgreSQL is fully initialized before the API starts. If needed, restart the API service:
docker compose -f ./deployment/compose/metorial.docker-compose.yml restart apiIf you have conflicts with the default ports, modify the port mappings in metorial.docker-compose.yml. Update the corresponding environment variables in the API service to match your changes.
Increase Docker's memory allocation if services crash or perform poorly. The stack requires at least 8GB of RAM to run comfortably.
For production deployments:
- Use strong, unique values for
SECRET - Configure proper SSL/TLS termination with a reverse proxy
- Set up regular database backups
- Configure appropriate resource limits in the compose file
- Enable authentication in OpenSearch and MongoDB
- Use external managed services for databases when possible
- Implement proper logging and monitoring
- Regularly update Docker images for security patches
After successful deployment:
- Create an account through the dashboard
- Configure your first MCP server integration
- Review the documentation for SDK usage
- Set up monitoring for your integrations