CyborgDB Service uses environment variables to configure various aspects of the service, such as database connections, API keys, SSL settings, and performance tuning. This allows for flexible configuration without hardcoding values in your codebase. Below are the key environment variables you can set for the CyborgDB service:

Required Environment Variables

These environment variables must be set for the service to run:
VariableDescriptionRequiredExample
CYBORGDB_API_KEYYour CyborgDB API key for authenticationcyborg_abc123...
CYBORGDB_DB_TYPEDatabase backend typepostgres or redis
CYBORGDB_CONNECTION_STRINGDatabase connection detailsSee Connection Formats
The service will not start without these three required variables.

Optional Environment Variables

Connection Formats

Configuration Examples

Docker Configuration

When using Docker, you can pass environment variables using the -e flag:
docker run -p 8000:8000 \
  -e CYBORGDB_API_KEY="cyborg_your_api_key_here" \
  -e CYBORGDB_DB_TYPE="postgres" \
  -e CYBORGDB_CONNECTION_STRING="host=host.docker.internal port=5432 dbname=cyborgdb user=cyborgdb password=secure_password" \
  cyborginc/cyborgdb-service:latest
Or use an environment file:
docker run -p 8000:8000 --env-file .env cyborginc/cyborgdb-service:latest

Environment Variable Priority

Environment variables are loaded in the following order (later sources override earlier ones):
  1. Default values - Set in the application code
  2. .env file - Local environment file in the working directory
  3. System environment variables - Set via export or container environment
  4. Command line arguments - Passed directly to the application

Validation and Error Handling

The CyborgDB service performs automatic validation of environment variables on startup:
  • Missing required variables - Service will exit with error messages
  • Invalid database types - Only postgres and redis are supported
  • Connection testing - Database connections are tested on startup
  • SSL certificate validation - Certificate files are checked for existence
If validation fails, the service will display helpful error messages with examples of correct configuration.

Troubleshooting