Quick Start
The fastest way to deploy Codex-LB is using Docker with a named volume for data persistence:Port Mapping
Codex-LB requires two ports:Volume Mounts
Data Directory
All persistent data is stored in/var/lib/codex-lb/ inside the container:
- Database:
store.db(SQLite by default) - Encryption keys:
encryption.key - Backup files: Automatic pre-migration backups (if enabled)
Environment Configuration
You can provide environment variables using:Docker Compose
Basic Setup
Create adocker-compose.yml file:
With PostgreSQL
For production deployments with higher concurrency, use PostgreSQL:PostgreSQL is optional. SQLite is sufficient for most deployments and provides zero-config startup.
Database Migrations
Automatic Migrations
By default, Codex-LB runs database migrations automatically on startup:/app/scripts/docker-entrypoint.sh) executes:
SQLite Backup Before Migration
SQLite databases are automatically backed up before migrations:Manual Migrations
To run migrations manually:Migration Validation
Check migration status and validate schema:Backup and Restore
Backing Up Data
Using Docker Volumes
Using Bind Mounts
If you’re using a bind mount, simply copy the directory:PostgreSQL Backup
For PostgreSQL deployments:Restoring Data
Restoring SQLite from Volume Backup
Restoring PostgreSQL
SQLite Recovery Tool
If your SQLite database becomes corrupted:Health Checks
Built-in Health Endpoint
Codex-LB provides a health check endpoint:Docker Health Check
Add a health check to yourdocker-compose.yml:
Container Management
Viewing Logs
Restarting
Updating
Troubleshooting
Container Won’t Start
Check logs for errors:- Port already in use: Another service is using port 2455 or 1455
- Permission denied: Volume mount permissions issue
- Database migration failed: Check migration logs
Database Issues
Verify database connectivity:Reset Everything
To start fresh:Next Steps
- Production Deployment - Set up Codex-LB for production with reverse proxy
- Configuration - Configure environment variables
- Client Setup - Connect your AI clients to Codex-LB