Skip to content

Self-Hosting

archmax supports two deployment modes. Choose the one that fits your needs:

Docker ComposeStandalone Docker
ServicesSeparate containers for archmax, MongoDB, and RedisSingle container with embedded MongoDB and Redis
SetupClone repo, configure .env, run docker compose upSingle docker run command
BackupsEach service has its own volume; easy to back up individuallySingle /data bind mount captures project data, MongoDB (embedded), and DuckDB cache
ScalingCan scale services independently; swap in managed MongoDB (Atlas, DocumentDB)All-in-one; simpler but less flexible
Best forProduction deployments, teams, long-term useQuick evaluation, demos, single-user setups

The recommended way to run archmax, with separate containers for the app, MongoDB, and Redis:

Terminal window
git clone https://github.com/archmaxai/archmax.git
cd archmax
cp .env.example .env
# Edit .env with your values
docker compose up -d

The included docker-compose.yml runs archmax with dedicated MongoDB 8 and Redis 8 containers.

Run archmax as a single container with embedded MongoDB and Redis, with no external dependencies:

Terminal window
docker run -d \
--name archmax \
-p 8080:8080 \
-e BETTER_AUTH_SECRET=$(openssl rand -base64 32) \
-e ENCRYPTION_KEY=$(openssl rand -base64 32) \
-e UI_USERNAME=admin \
-e UI_PASSWORD=changeme \
-e AGENT_API_KEY=your-api-key \
-v ~/.archmax:/data \
ghcr.io/archmaxai/archmax:latest

MongoDB and Redis are embedded and start automatically. To use an external MongoDB, pass MONGODB_URI. To use an external Redis, pass REDIS_URL.

AGENT_API_KEY is required for the AI-powered Semantic Model Builder and Testing Playground. The default provider is OpenRouter; see the Configuration reference for alternative providers.

archmax stores persistent data inside the container at /data. You must mount this path to retain data across container restarts and upgrades.

The docker run examples use a bind mount that maps the container’s data directory to a host directory:

Terminal window
-v ~/.archmax:/data

This single mount captures everything: semantic model YAML files (projects/), embedded MongoDB data (mongodb/), and the DuckDB extension cache (.duckdb/). Without this mount, all data is lost when the container is removed.

The included docker-compose.yml uses named Docker volumes:

VolumeContainer PathContents
archmax-data/data (archmax container)Semantic model YAML files, DuckDB extension cache
mongo-data/data/db (mongo container)MongoDB database files

Named volumes are managed by Docker and persist automatically. To use host bind mounts instead (e.g. for easier access or backup), edit docker-compose.yml:

volumes:
- ./data/archmax:/data # instead of archmax-data:/data

When deploying to platforms like Railway that mount volumes at arbitrary paths (e.g. /data), set ARCHMAX_DATA_DIR to point inside the mount:

VariableValue
ARCHMAX_DATA_DIR/data/projects

The entrypoint automatically fixes ownership on the configured data directory before starting services, so root-owned volume mounts work out of the box.

archmax stores two categories of persistent data:

DataLocationDescription
Project files/data/projects/ (archmax container)Semantic model YAML files
Embedded MongoDB/data/mongodb/ (archmax container)Database files (only when using embedded MongoDB)
DuckDB cache/data/.duckdb/ (archmax container)DuckDB extension cache
External DatabaseMongoDB service/instanceProjects, connections, conversations, test data (when using Compose or external MongoDB)
  1. Stop the container to ensure data consistency:

    Terminal window
    docker compose stop archmax
  2. Copy the volume to a backup location:

    Terminal window
    docker run --rm \
    -v archmax_archmax-data:/data \
    -v $(pwd):/backup \
    alpine tar czf /backup/archmax-projects-$(date +%Y%m%d).tar.gz -C /data .
  3. Restart:

    Terminal window
    docker compose start archmax
Terminal window
docker compose stop
docker run --rm -v archmax_mongo-data:/data -v $(pwd):/backup \
alpine tar czf /backup/archmax-mongo-$(date +%Y%m%d).tar.gz -C /data .
docker compose start
Terminal window
docker compose stop
# Restore project files
docker run --rm \
-v archmax_archmax-data:/data \
-v $(pwd):/backup \
alpine sh -c "rm -rf /data/* && tar xzf /backup/archmax-projects-20260408.tar.gz -C /data"
# Restore MongoDB
docker run --rm \
-v archmax_mongo-data:/data \
-v $(pwd):/backup \
alpine sh -c "rm -rf /data/* && tar xzf /backup/archmax-mongo-20260408.tar.gz -C /data"
docker compose start
  1. Pull the latest images:

    Terminal window
    docker compose pull
  2. Back up your data (see above)

  3. Recreate the containers:

    Terminal window
    docker compose up -d

For standalone Docker:

Terminal window
docker pull ghcr.io/archmaxai/archmax:latest
docker stop archmax && docker rm archmax
docker run -d --name archmax -p 8080:8080 \
-e BETTER_AUTH_SECRET=your-existing-secret \
-e ENCRYPTION_KEY=your-existing-key \
-e UI_USERNAME=admin \
-e UI_PASSWORD=your-password \
-e AGENT_API_KEY=your-api-key \
-v ~/.archmax:/data \
ghcr.io/archmaxai/archmax:latest
DeploymentRAMDiskCPU
Standalone (embedded MongoDB + Redis)1 GB3 GB1 vCPU
Standalone (external MongoDB)512 MB2 GB1 vCPU
Docker Compose (small)2 GB total5 GB1 vCPU
Docker Compose (production)4 GB total20 GB2 vCPU

The AI agent’s resource usage depends on your configured model provider (OpenRouter, OpenAI, etc.) and runs as API calls, not locally.

  • The embedded MongoDB and Redis bind to 127.0.0.1 only (container-internal) and are not exposed outside the container.
  • Always set a strong BETTER_AUTH_SECRET (at least 32 characters) and save it for reuse across restarts and upgrades.
  • Change UI_PASSWORD from the default changeme before exposing to users.
  • Place a reverse proxy (nginx, Caddy, Traefik) with TLS in front of port 8080 for HTTPS.

By default, database connection passwords and test agent API keys are stored in plaintext in MongoDB. To encrypt them at rest, set the ENCRYPTION_KEY environment variable:

Terminal window
# Generate a key
openssl rand -base64 32
Terminal window
# Add to your environment
ENCRYPTION_KEY=your-generated-key

When set, all stored credentials are encrypted with AES-256-GCM before being written to MongoDB. Existing plaintext credentials continue to work and will be encrypted the next time they are updated.