- Pull the latest image:
docker pull ghcr.io/miurla/morphic:latest- Configure environment:
cp .env.local.example .env.localEdit .env.local and set at least one AI provider API key:
OPENAI_API_KEY=your_openai_keyOther supported providers: Anthropic (ANTHROPIC_API_KEY), Google (GOOGLE_GENERATIVE_AI_API_KEY), Ollama (OLLAMA_BASE_URL), Vercel AI Gateway (AI_GATEWAY_API_KEY).
- Start all services:
docker compose up -d- Visit http://localhost:3000 and select your model from the model selector.
To build locally instead of using the prebuilt image:
docker compose up -d --build- PostgreSQL 17 - Database with automatic migrations
- Redis - SearXNG search caching
- SearXNG - Self-hosted search engine (no external search API key needed)
- Morphic - The application
In Docker mode, Morphic dynamically detects available AI providers based on your API keys and displays a model selector in the UI. No configuration files to edit — just set your API key and pick your model.
Docker Compose automatically sets these for you:
ENABLE_AUTH=false(anonymous mode)SEARCH_API=searxngSEARXNG_API_URL=http://searxng:8080LOCAL_REDIS_URL=redis://redis:6379MORPHIC_CLOUD_DEPLOYMENT=false
Values in docker-compose.yaml take precedence over .env.local. To override a default:
SEARCH_API=tavily docker compose up -dFile upload requires externally reachable object storage. Docker Compose does not provision storage by default.
Required environment variables:
R2_ACCESS_KEY_ID,R2_SECRET_ACCESS_KEY- One of:
R2_ACCOUNT_ID(Cloudflare R2) orS3_ENDPOINT(generic S3-compatible) R2_BUCKET_NAME
If these are not set, upload is disabled.
Customize database credentials in .env.local:
POSTGRES_USER=morphic # Default: morphic
POSTGRES_PASSWORD=morphic # Default: morphic
POSTGRES_DB=morphic # Default: morphic
POSTGRES_PORT=5432 # Default: 5432Database data is persisted in a Docker volume. To reset:
docker compose down -v # Deletes all dataBy default, Docker runs in anonymous mode: all users share a single anonymous user ID. This is intended for personal, single-user local environments only.
For a multi-user instance, use the built-in Better Auth provider. Accounts live in the bundled PostgreSQL database, and it works with the prebuilt image. Add to .env.local:
AUTH_PROVIDER=better-auth
BETTER_AUTH_SECRET=run-openssl-rand-hex-32-for-a-stable-valueThen restart with docker compose up -d. See Better Auth for sign-up modes, the first admin account, SMTP, and HTTPS.
To use Supabase authentication instead:
- Set up a Supabase project
- Build from source with the Supabase environment variables:
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-supabase-publishable-key
SUPABASE_SECRET_KEY=your-supabase-secret-key
ENABLE_AUTH=true- Build and start:
docker compose up -d --buildNote: The prebuilt image does not support Supabase authentication because NEXT_PUBLIC_* variables are embedded at build time by Next.js. You must build from source to use Supabase.
# Start all containers
docker compose up -d
# Stop all containers
docker compose down
# Stop and remove volumes (deletes database data)
docker compose down -v
# View logs
docker compose logs -f morphic
# Rebuild the image
docker compose build morphic