Quickstart
Prerequisites
Section titled “Prerequisites”- Python 3.12+
- Redis (for background job processing)
- PostgreSQL (recommended) or SQLite
- UV package manager
Step 1: Install dependencies
Section titled “Step 1: Install dependencies”# Install UV if you don't have itcurl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and installgit clone https://github.com/boxbilling/boxbilling.gitcd boxbilling/backenduv syncStep 2: Configure environment
Section titled “Step 2: Configure environment”cp .env.example .envEdit .env with your settings:
APP_DOMAIN=localhostAPP_DATA_PATH=/var/lib/appAPP_DATABASE_DSN=postgresql://user:pass@localhost:5432/boxbillingREDIS_URL=redis://localhost:6379Step 3: Run database migrations
Section titled “Step 3: Run database migrations”alembic upgrade headStep 4: Start the server
Section titled “Step 4: Start the server”fastapi dev app/main.pyThe API is now available at http://localhost:8000.
Step 5: Start the background worker
Section titled “Step 5: Start the background worker”In a separate terminal:
arq app.worker.WorkerSettingsFirst API call
Section titled “First API call”Create your organization and get an API key:
curl -X POST http://localhost:8000/v1/organizations \ -H "Content-Type: application/json" \ -d '{"name": "My Company"}'The response includes a raw_key — save this, it’s only shown once:
{ "organization": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My Company" }, "raw_key": "bxb_live_abc123..."}Use this key for all subsequent requests:
curl http://localhost:8000/v1/customers \ -H "Authorization: Bearer bxb_live_abc123..."Docker
Section titled “Docker”docker build -t boxbilling .docker run -p 80:80 --env-file .env boxbillingNext steps
Section titled “Next steps” Architecture Understand the system design.
API Reference Explore all API endpoints.
Subscriptions Set up your first subscription.
Usage billing Configure usage-based pricing.