This guide covers running Morphic with Docker, including development setup, prebuilt images, and deployment options.
- Configure environment variables:
cp .env.local.example .env.localEdit .env.local and set the required variables:
DATABASE_URL=postgresql://morphic:morphic@postgres:5432/morphic
OPENAI_API_KEY=your_openai_key
TAVILY_API_KEY=your_tavily_key
BRAVE_SEARCH_API_KEY=your_brave_keyNote: Authentication is disabled by default (ENABLE_AUTH=false in .env.local.example).
Optional: Customize PostgreSQL credentials by setting environment variables in .env.local:
POSTGRES_USER=morphic # Default: morphic
POSTGRES_PASSWORD=morphic # Default: morphic
POSTGRES_DB=morphic # Default: morphic
POSTGRES_PORT=5432 # Default: 5432- Start the Docker containers:
docker compose up -dThe application will:
- Start PostgreSQL 17 with health checks
- Start Redis for SearXNG search caching
- Wait for the database to be ready
- Run database migrations automatically
- Start the Morphic application
- Start SearXNG (optional search provider)
- Visit http://localhost:3000 in your browser.
Note: Database data is persisted in a Docker volume. To reset the database, run:
docker compose down -v # This will delete all dataPrebuilt Docker images are automatically built and published to GitHub Container Registry:
docker pull ghcr.io/miurla/morphic:latestYou can use it with docker-compose by setting the image in your docker-compose.yaml:
services:
morphic:
image: ghcr.io/miurla/morphic:latest
env_file: .env.local
environment:
DATABASE_URL: postgresql://morphic:morphic@postgres:5432/morphic
DATABASE_SSL_DISABLED: 'true'
ENABLE_AUTH: 'false'
ports:
- '3000:3000'
depends_on:
- postgres
- redisNote: The prebuilt image runs in anonymous mode only (ENABLE_AUTH=false). Supabase authentication cannot be enabled because NEXT_PUBLIC_* environment variables are embedded at build time by Next.js. To enable authentication or customize model configurations, you need to build from source — see CONFIGURATION.md for details.
Use Docker Compose for a complete setup with PostgreSQL, Redis, and SearXNG. See the Quick Start section above.
# Start all containers in background
docker compose up -d
# Stop all containers
docker compose down
# Stop all containers and remove volumes (deletes database data)
docker compose down -v
# View logs
docker compose logs -f morphic
# Rebuild the image
docker compose build morphic