Installation
This guide covers installing DBOS Transact and setting up your development environment.Requirements
DBOS Transact requires:- Python 3.10 or later (Python 3.10, 3.11, 3.12, and 3.13 are supported)
- Postgres 14+ or SQLite 3.35+ for the system database
- pip for package installation
Installing DBOS
Install the Package
Install DBOS using pip:This installs the core DBOS library with all required dependencies:
pyyaml- Configuration file parsingpython-dateutil- Date and time utilitiespsycopg[binary]- PostgreSQL adapterwebsockets- WebSocket supportsqlalchemy- Database ORM and query builder
DBOS is compatible with SQLAlchemy 2.0+. If you have an older version, it will be upgraded.
Optional Dependencies
DBOS provides optional dependencies for additional features:OpenTelemetry (OTLP)
For distributed tracing and logging with OpenTelemetry:opentelemetry-apiopentelemetry-sdkopentelemetry-exporter-otlp-proto-http
Validation
For request/response validation with Pydantic:pydantic(version 2.0+)
All Optional Dependencies
To install all optional dependencies:Database Setup
DBOS stores workflow state in a system database. You can use either Postgres or SQLite.Option 1: SQLite (Development)
SQLite is perfect for local development and testing. No setup required—DBOS creates the database file automatically.Option 2: Postgres (Production)
Postgres is recommended for production use. It provides better performance, reliability, and supports advanced features.- Docker
- Local Installation
- Cloud Providers
Start a Postgres database with Docker:The database will be available at
localhost:5432.Configuration
DBOS uses a configuration file or Python dictionary to specify database connections and other settings.Configuration File
Create a file nameddbos-config.yaml in your project root:
Python Configuration
Alternatively, configure DBOS directly in Python:Configuration Options
Key configuration options:| Option | Type | Description |
|---|---|---|
name | str | Required. Application name |
system_database_url | str | Connection string for DBOS system database. Defaults to sqlite:///{name} |
application_database_url | str | Connection string for application database (used in @DBOS.transaction()) |
log_level | str | Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL. Default: INFO |
admin_port | int | Port for admin server. Default: 8080 |
run_admin_server | bool | Whether to run the admin server. Default: true |
enable_otlp | bool | Enable OpenTelemetry tracing/logging. Default: false |
max_executor_threads | int | Maximum worker threads for executing steps. Default: 100 |
sys_db_pool_size | int | System database connection pool size |
dbos_system_schema | str | Schema name for DBOS system tables. Default: dbos |
Environment variables in the format
DBOS__OPTION_NAME override configuration file values. For example, DBOS__NAME=my-app overrides the name field.Database Migrations
DBOS automatically creates system tables in your system database on first launch. If you’re using an application database for transactions, you’ll need to manage your application schema separately.Running Migrations
DBOS provides a migration command to set up or update your database schema:Application Schema
For your application database, define your schema using SQLAlchemy:Verifying Your Setup
Create a simple test to verify everything is working:test_setup.py
Next Steps
Quickstart
Build your first durable workflow
Core Concepts
Learn about workflows, steps, and transactions
Workflow Tutorial
Explore advanced features and patterns
Configuration Reference
Complete configuration options reference
Troubleshooting
Import errors after installation
Import errors after installation
If you get import errors, ensure you’re using the correct Python environment:If DBOS isn’t listed, reinstall it:
Postgres connection refused
Postgres connection refused
If you can’t connect to Postgres:
-
Verify Postgres is running:
-
Check your connection string format:
- Ensure the database exists or DBOS has permission to create it
SQLite permission errors
SQLite permission errors
If you get permission errors with SQLite:
- Ensure the directory exists and is writable
- Use an absolute path in your configuration:
Version conflicts with SQLAlchemy
Version conflicts with SQLAlchemy
DBOS requires SQLAlchemy 2.0+. If you have conflicts:If you need to keep an older version for another project, use a virtual environment: