Prerequisites
Before you begin, ensure you have the following installed:- Go 1.25 or later
- Atlas CLI (for database migrations)
- SQLite (bundled with most systems) or S3 credentials (for production deployments)
Installation
1
Navigate to the taco directory
From your project root, navigate to the Statesman directory:
2
Run database migrations
If you’re using SQLite with persistence, create the data directory and apply the migrations before starting Statesman:
If you encounter checksum errors, regenerate the hash first:
3
Build Statesman
Build the Statesman service:This creates the
statesman executable in your current directory.4
Start the service
Run Statesman with your preferred configuration:The service will start on port
8080 by default.Configuration
Configure Statesman using environment variables:Basic Configuration
UI Integration
To enable the UI to communicate with Statesman, set the webhook secret:Advanced Configuration Options
Advanced Configuration Options
Using Statesman as a Terraform Backend
Once Statesman is running, you can configure Terraform to use it as a remote backend.Terraform Configuration
Add the following backend configuration to your Terraform code:For production deployments, replace
localhost:8080 with your Statesman instance’s public URL. If authentication is enabled, you’ll also need to configure credentials.Authentication
If you’ve enabled authentication (not using-auth-disable), configure your Terraform credentials:
Syncing Organizations and Users
Syncing for UI Integration
Syncing for UI Integration
The UI requires organization and user data to be synced to Statesman. Statesman resolves organizations by
external_org_id (your WorkOS organization ID). If the organization cannot be resolved, /internal/api/units will return a 500 error.Using the Sync Script
A helper script is available to simplify the sync process:Edit the script with your WorkOS organization and user IDs before running it.
Manual Sync
Alternatively, you can sync manually using curl commands:Troubleshooting
Database Errors
“unable to open database file: no such file or directory” This error occurs when the data directory doesn’t exist. Create it first:Authentication Errors
403 Forbidden This typically indicates a webhook secret mismatch. Verify thatOPENTACO_ENABLE_INTERNAL_ENDPOINTS matches STATESMAN_BACKEND_WEBHOOK_SECRET in your UI configuration.
Organization Resolution Errors
404 or 500 errors when resolving organization The organization has not been synced to Statesman. Run the sync script or manual sync commands described in the “Syncing Organizations and Users” section.Storage Configuration
SQLite quirks By default, Statesman uses SQLite as the in-process query backend. No additional configuration is needed for local development. For PostgreSQL or MySQL backends, setTACO_QUERY_BACKEND and related environment variables (see docs/ce/state-management/query-backend for details).
