Skip to content

Local Development

This guide covers how to run the Archon server locally, with Docker, and in production. For VPS deployment with automatic HTTPS, see the Cloud Deployment Guide.

Quick links: Local Development | Docker with Remote DB | Docker with Local PostgreSQL | Production


Local development with SQLite is the recommended default. No database setup is needed.

  • Bun 1.0+
  • At least one AI assistant configured (Claude Code or Codex)
  • A GitHub token for repository cloning (GH_TOKEN / GITHUB_TOKEN)
Terminal window
# 1. Clone and install
git clone https://github.com/coleam00/Archon
cd Archon
bun install
# 2. Configure environment
cp .env.example .env
nano .env # Add your AI assistant tokens (Claude or Codex)
# 3. Start server + Web UI (SQLite auto-detected, no database setup needed)
bun run dev
# 4. Open Web UI
# http://localhost:5173

In development mode, two servers run simultaneously:

ServiceURLPurpose
Web UIhttp://localhost:5173React frontend (Vite dev server)
API Serverhttp://localhost:3090Backend API + SSE streaming

Optional: Use PostgreSQL Instead of SQLite

Section titled “Optional: Use PostgreSQL Instead of SQLite”

If you prefer PostgreSQL for local development:

Terminal window
docker compose --profile with-db up -d postgres
# Set DATABASE_URL=postgresql://postgres:postgres@localhost:5432/remote_coding_agent in .env

Note: The database schema is created automatically on first container startup via the mounted migration file. No manual psql step is needed for fresh installs.

Terminal window
bun run build # Build the frontend
bun run start # Server serves both API and Web UI on port 3090
Terminal window
curl http://localhost:3090/health
# Expected: {"status":"ok"}

Use this option when your database is hosted externally (Supabase, Neon, AWS RDS, etc.). This starts only the app container.

  • Docker & Docker Compose
  • A remote PostgreSQL database with DATABASE_URL set in .env
  • AI assistant tokens configured in .env

The app container runs without any profile when using an external database. There is no external-db profile — the base app service always starts.

Terminal window
# 1. Get the deployment files
mkdir archon && cd archon
curl -fsSL https://raw.githubusercontent.com/coleam00/Archon/main/deploy/docker-compose.yml -o docker-compose.yml
curl -fsSL https://raw.githubusercontent.com/coleam00/Archon/main/deploy/.env.example -o .env
# 2. Configure (edit .env with your tokens and DATABASE_URL)
nano .env
# 3. Start app container (no profile needed for external DB)
docker compose up -d
# 4. View logs
docker compose logs -f app
# 5. Verify
curl http://localhost:3000/api/health

For fresh installations, run the combined migration:

Terminal window
psql $DATABASE_URL < migrations/000_combined.sql
Terminal window
docker compose down

Use this option to run both the app and PostgreSQL in Docker containers. The database schema is created automatically on first startup.

5432/remote_coding_agent
# 1. Configure .env
# 2. Start both containers
docker compose --profile with-db up -d --build
# 3. Wait for startup (watch logs)
docker compose logs -f app
# 4. Verify
curl http://localhost:3000/api/health

Note: Database tables are created automatically via the init script on first startup. No manual migration step is needed.

When new migrations are added, apply them manually:

Terminal window
# Connect to the running postgres container
docker compose exec postgres psql -U postgres -d remote_coding_agent
# For a fresh install, run the combined migration (idempotent, creates all 7 tables):
\i /migrations/000_combined.sql
# Or apply individual migrations you haven't applied yet.
# Check the migrations/ directory for the full list (currently 001 through 019).
\q
Terminal window
docker compose --profile with-db down

For deploying to a VPS (DigitalOcean, Linode, AWS EC2, etc.) with automatic HTTPS via Caddy, see the Cloud Deployment Guide.


OptionSetupBest For
SQLite (default)Zero config, just omit DATABASE_URLSingle-user, CLI usage, local development
Remote PostgreSQLSet DATABASE_URL to hosted DBCloud deployments, shared access
Local PostgreSQLDocker --profile with-dbSelf-hosted, Docker-based setups

SQLite stores data at ~/.archon/archon.db (or /.archon/archon.db in Docker). It is auto-initialized on first run.


ContextDefault PortNotes
Local dev (bun run dev)3090Default server port
Docker3000Set via PORT in .env
Worktrees3190-4089Auto-allocated, hash-based on path
OverrideAnySet PORT=4000 bun dev

ContextEndpointNotes
Docker / production/api/healthUsed by Docker healthcheck
Local dev/healthConvenience alias (also supports /api/health)
Terminal window
# Docker
curl http://localhost:3000/api/health
# Local dev
curl http://localhost:3090/health
# Additional checks (both contexts)
curl http://localhost:3090/health/db # Database connectivity
curl http://localhost:3090/health/concurrency # Concurrency status

Terminal window
# Check logs
docker compose logs app # default (SQLite or external DB)
docker compose logs app # --profile with-db
# Verify environment
docker compose config
# Rebuild without cache
docker compose build --no-cache
docker compose up -d
Terminal window
# Check if port is in use
lsof -i :3090 # macOS/Linux
netstat -ano | findstr :3090 # Windows