Local Docker run
This guide will start Maia from the source code repository, but the running way is Docker (App + Runner). It’s closer to production environment than pnpm dev.
Prerequisites
Section titled “Prerequisites”- Docker + Docker Compose v2
- Git
Start Maia
Section titled “Start Maia”-
Clone the source repo
Terminal window git clone https://github.com/obiscr/maia.gitcd maia -
Create env file
Terminal window cp env.example .env.production -
Edit
.env.production(minimum required).env.production RUNNER_TOKEN=your-tokenRecommended for production:
.env.production RUNNER_TOKEN=your-tokenSETTINGS_ENCRYPTION_KEY=your-stable-key -
Build sandbox image
Terminal window docker build -f Dockerfile.sandbox -t maia-sandbox .Then set
MAIA_SANDBOX_IMAGE=maia-sandboxin.env.productionfile and restart..env.production RUNNER_TOKEN=your-tokenSETTINGS_ENCRYPTION_KEY=your-stable-keyMAIA_SANDBOX_IMAGE=maia-sandbox -
Build and start
Terminal window docker compose --env-file .env.production up -d --build
Then open:
LAN access
Section titled “LAN access”If you deploy Maia on a server and access it over plain HTTP (for example http://<IP>:3690), you may hit a login loop because the browser won’t persist Secure session cookies on HTTP.
Recommended: put Maia behind an HTTPS reverse proxy and set SESSION_COOKIE_SECURE=auto. If you intentionally run HTTP only on a trusted LAN, set SESSION_COOKIE_SECURE=false (not recommended for public access).
See:
Data storage location
Section titled “Data storage location”In Docker mode, data is stored in Docker named volume by default. If you want to store it on the host machine, you can set:
MAIA_DATA_MOUNT_TYPE=bindMAIA_HOST_DATA_DIR=/absolute/path/on/hostFor example:
MAIA_HOST_DATA_DIR=/Users/alice/maia-dataMAIA_HOST_DATA_DIR=/home/alice/maia-dataMAIA_HOST_DATA_DIR=C:\Users\alice\maia-dataAfter setting, you need to restart the container.
Get updates
Section titled “Get updates”When maia source code has updates, run the following commands in the source code directory:
git pulldocker compose --env-file .env.production up -d --build --force-recreateDatabase migration
Section titled “Database migration”In Docker (from source code) mode, database migrations are handled by a one-time migrator service:
- After you run
docker compose up ..., themigratorwill runprisma migrate deployfirst - The
migratorwill Exited (0) and exit (this is normal) after the migration is successful maia/runnerwill only start after the migration is successful
If you need to manually trigger migrations (for example, for debugging), you can run the migrator:
docker compose --env-file .env.production run --rm migratorVerify migration status
Section titled “Verify migration status”docker compose --env-file .env.production ps -adocker compose --env-file .env.production logs migrator --no-log-prefix