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
Section titled “Local Development”Local development with SQLite is the recommended default. No database setup is needed.
Prerequisites
Section titled “Prerequisites”- Bun 1.0+
- At least one AI assistant configured (Claude Code or Codex)
- A GitHub token for repository cloning (
GH_TOKEN/GITHUB_TOKEN)
# 1. Clone and installgit clone https://github.com/coleam00/Archoncd Archonbun install
# 2. Configure environmentcp .env.example .envnano .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:5173In development mode, two servers run simultaneously:
| Service | URL | Purpose |
|---|---|---|
| Web UI | http://localhost:5173 | React frontend (Vite dev server) |
| API Server | http://localhost:3090 | Backend API + SSE streaming |
Optional: Use PostgreSQL Instead of SQLite
Section titled “Optional: Use PostgreSQL Instead of SQLite”If you prefer PostgreSQL for local development:
docker compose --profile with-db up -d postgres# Set DATABASE_URL=postgresql://postgres:postgres@localhost:5432/remote_coding_agent in .envNote: The database schema is created automatically on first container startup via the mounted migration file. No manual
psqlstep is needed for fresh installs.
Production Build (Local)
Section titled “Production Build (Local)”bun run build # Build the frontendbun run start # Server serves both API and Web UI on port 3090Verify It Works
Section titled “Verify It Works”curl http://localhost:3090/health# Expected: {"status":"ok"}Docker with Remote PostgreSQL
Section titled “Docker with Remote PostgreSQL”Use this option when your database is hosted externally (Supabase, Neon, AWS RDS, etc.). This starts only the app container.
Prerequisites
Section titled “Prerequisites”- Docker & Docker Compose
- A remote PostgreSQL database with
DATABASE_URLset 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.
# 1. Get the deployment filesmkdir archon && cd archoncurl -fsSL https://raw.githubusercontent.com/coleam00/Archon/main/deploy/docker-compose.yml -o docker-compose.ymlcurl -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 logsdocker compose logs -f app
# 5. Verifycurl http://localhost:3000/api/healthDatabase Migration (First Time)
Section titled “Database Migration (First Time)”For fresh installations, run the combined migration:
psql $DATABASE_URL < migrations/000_combined.sqldocker compose downDocker with Local PostgreSQL
Section titled “Docker with Local PostgreSQL”Use this option to run both the app and PostgreSQL in Docker containers. The database schema is created automatically on first startup.
# 1. Configure .env# 2. Start both containersdocker compose --profile with-db up -d --build
# 3. Wait for startup (watch logs)docker compose logs -f app
# 4. Verifycurl http://localhost:3000/api/healthNote: Database tables are created automatically via the init script on first startup. No manual migration step is needed.
Updating an Existing Installation
Section titled “Updating an Existing Installation”When new migrations are added, apply them manually:
# Connect to the running postgres containerdocker 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).\qdocker compose --profile with-db downProduction Deployment
Section titled “Production Deployment”For deploying to a VPS (DigitalOcean, Linode, AWS EC2, etc.) with automatic HTTPS via Caddy, see the Cloud Deployment Guide.
Database Options Summary
Section titled “Database Options Summary”| Option | Setup | Best For |
|---|---|---|
| SQLite (default) | Zero config, just omit DATABASE_URL | Single-user, CLI usage, local development |
| Remote PostgreSQL | Set DATABASE_URL to hosted DB | Cloud deployments, shared access |
| Local PostgreSQL | Docker --profile with-db | Self-hosted, Docker-based setups |
SQLite stores data at ~/.archon/archon.db (or /.archon/archon.db in Docker). It is auto-initialized on first run.
Port Configuration
Section titled “Port Configuration”| Context | Default Port | Notes |
|---|---|---|
Local dev (bun run dev) | 3090 | Default server port |
| Docker | 3000 | Set via PORT in .env |
| Worktrees | 3190-4089 | Auto-allocated, hash-based on path |
| Override | Any | Set PORT=4000 bun dev |
Health Endpoints
Section titled “Health Endpoints”| Context | Endpoint | Notes |
|---|---|---|
| Docker / production | /api/health | Used by Docker healthcheck |
| Local dev | /health | Convenience alias (also supports /api/health) |
# Dockercurl http://localhost:3000/api/health
# Local devcurl http://localhost:3090/health
# Additional checks (both contexts)curl http://localhost:3090/health/db # Database connectivitycurl http://localhost:3090/health/concurrency # Concurrency statusTroubleshooting
Section titled “Troubleshooting”Container Won’t Start
Section titled “Container Won’t Start”# Check logsdocker compose logs app # default (SQLite or external DB)docker compose logs app # --profile with-db
# Verify environmentdocker compose config
# Rebuild without cachedocker compose build --no-cachedocker compose up -dPort Conflicts
Section titled “Port Conflicts”# Check if port is in uselsof -i :3090 # macOS/Linuxnetstat -ano | findstr :3090 # Windows