Skip to main content

Choose your installation method

Codex-LB supports multiple installation methods depending on your use case.

Docker

Recommended for production and quick testing

uvx

Easiest for personal use and experimentation

Local Dev

Required for contributing or customizing

Docker Installation

The recommended method for most users. Provides a fully isolated environment with all dependencies.

Basic Setup

Data persistence: All data (accounts, API keys, usage stats) is stored in the codex-lb-data volume at /var/lib/codex-lb.

With Environment Variables

Customize Codex-LB with environment variables:
See Environment Variables for all available options.

Using Docker Compose

For more complex setups, use Docker Compose:
docker-compose.yml
Run it:

With PostgreSQL

For production deployments, use PostgreSQL instead of SQLite:
docker-compose.yml
PostgreSQL is recommended for production deployments with high request volumes or multiple instances.

Container Management

uvx Installation

The quickest way to run Codex-LB without Docker. Requires Python 3.13+.

Install and Run

That’s it! Codex-LB will start on ports 2455 and 1455.
Data location: ~/.codex-lb/ — includes database, encryption keys, and logs.

With Custom Settings

Pass environment variables when running:
Or create a .env.local file in your working directory:
.env.local
Then run:

Stopping uvx

Press Ctrl+C in the terminal running Codex-LB.

Local Development

For contributors or users who want to customize Codex-LB.

Prerequisites

  • Python 3.13+
  • uv (Python package manager)
  • Bun (for frontend development)
  • Git

Clone and Install

1

Clone the repository

2

Install Python dependencies

This creates a virtual environment at .venv/ and installs all dependencies.
3

Install frontend dependencies

4

Build the frontend

This creates production assets in app/static/.

Development Servers

Run the backend and frontend separately for hot reloading:
In development mode, the frontend runs on port 5173 and proxies API requests to the backend on port 2455.

Docker Development

Alternatively, use Docker Compose for local development with hot reload:
This watches for file changes and automatically syncs them to the running containers.

Environment Configuration

Copy the example environment file:
Edit .env.local to customize settings. See Environment Variables for all options.

Database Migrations

Run migrations manually:
Create a new migration:

Running Tests

Data Storage

Codex-LB stores data in different locations depending on the installation method:
Backup your data! The data directory contains:
  • Account tokens (encrypted)
  • API keys
  • Usage history
  • Configuration settings
Losing this directory means losing all accounts and settings.

Backing Up

Restoring

Next Steps

Add accounts

Link your ChatGPT accounts via OAuth

Configure clients

Set up Codex CLI, OpenCode, or other clients

Environment variables

Customize timeouts, OAuth, database, and more

Production deployment

Best practices for running Codex-LB in production