Installation
Full installation guide for CodeSpar covering npm from source, Docker Compose, Railway one-click deploy, and building from source.
Installation
CodeSpar can be installed and deployed in several ways depending on your needs. Choose the method that fits your environment.
Prerequisites
| Requirement | Version | Notes |
|---|---|---|
| Node.js | 22+ | Required for running from source |
| npm | 11+ | Included with Node.js 22+ |
| Docker | 24+ | Required for Docker Compose and sandboxed agent execution |
| Docker Compose | v2+ | Required for Docker Compose deployment |
| Git | 2.40+ | For cloning the repository |
Option 1: Install from Source
The most straightforward method for development and local use.
Clone and install
Configure environment
Edit .env with your configuration. At minimum, set:
See the Quickstart for the full environment variable reference.
Start the server
To enable specific channels, pass the relevant environment variables:
Option 2: Docker Compose
Docker Compose is the recommended method for production deployments. It runs CodeSpar with all required services in isolated containers.
Clone the repository
Configure environment
Edit .env with your API keys and channel credentials.
Start with Docker Compose
This starts CodeSpar using the included docker-compose.yml:
To run in detached mode:
To view logs:
To stop all services:
Option 3: Railway One-Click Deploy
Deploy CodeSpar to Railway with a single click for a managed cloud deployment.
- Click the Deploy on Railway button in the CodeSpar repository README
- Railway will fork the repo and create a new project
- Set your environment variables in the Railway dashboard:
ANTHROPIC_API_KEY- Channel-specific variables (Slack, Discord, etc.)
- Railway automatically builds and deploys
Railway provides:
- Automatic HTTPS
- Built-in logging and monitoring
- Easy environment variable management
- Automatic redeploys on git push
Option 4: Build from Source
For custom builds, CI/CD pipelines, or contributing to CodeSpar.
Clone and install
Build all packages
This runs Turborepo to build all 13 packages in the monorepo in the correct dependency order. The build output includes:
- Core engine
- Agent runtime
- Channel bridges (Slack, Discord, Telegram, WhatsApp, CLI)
- Shared utilities and types
- Documentation site
Verify the build
Run the production build
Monorepo Structure
CodeSpar uses Turborepo to manage a monorepo with 13 packages:
Verifying Your Installation
After starting CodeSpar by any method, verify it is running:
Expected response:
Next Steps
- First Agent — deploy your first agent, link a repo, and start issuing commands
- Quickstart — the 5-minute version if you just want to try it out