Skip to main content

Quick Start

The fastest way to deploy Codex-LB is using Docker with a named volume for data persistence:
Open http://localhost:2455 in your browser to access the dashboard.

Port Mapping

Codex-LB requires two ports:
Port 1455 cannot be changed. OpenAI’s OAuth flow requires this specific port for the redirect URI.

Volume Mounts

Data Directory

All persistent data is stored in /var/lib/codex-lb/ inside the container:
This directory contains:
  • 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:
See Configuration for all available options.

Docker Compose

Basic Setup

Create a docker-compose.yml file:
Start the service:

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:
The Docker entrypoint script (/app/scripts/docker-entrypoint.sh) executes:

SQLite Backup Before Migration

SQLite databases are automatically backed up before migrations:
Backup files are stored in the data directory with timestamps.

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:
Response:

Docker Health Check

Add a health check to your docker-compose.yml:
Or with plain Docker:

Container Management

Viewing Logs

Restarting

Updating

With Docker Compose:

Troubleshooting

Container Won’t Start

Check logs for errors:
Common issues:
  • 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