Skip to main content
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:
The service will not start without these three required variables.

Optional Environment Variables

When both SSL_CERT_PATH and SSL_KEY_PATH are provided and the files exist, the service automatically enables HTTPS.
These variables provide granular control over database connections. If not set, they fall back to the main database configuration:
These variables allow you to customize the table/collection names used by the service:
These variables allow you to optimize performance based on your hardware and workload:
These variables control system-level settings:

Connection Formats

Use the standard PostgreSQL connection string format:
Parameters:
  • host - Database server hostname
  • port - Database server port (default: 5432)
  • dbname - Database name
  • user - Database username
  • password - Database password
Use a comma-separated format for Redis connections:
Parameters:
  • host - Redis server hostname
  • port - Redis server port (default: 6379)
  • db - Redis database number (default: 0)
  • password - Redis password (optional)
Redis URI format (redis:// or rediss://) is not supported. Use the comma-separated format shown above.

Configuration Examples

Docker Configuration

When using Docker, you can pass environment variables using the -e flag:
Or use an environment file:

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

  • Ensure CYBORGDB_API_KEY is set
  • Check for typos in the variable name
  • Verify the API key format starts with cyborg_
  • Verify database is running and accessible
  • Check connection string format
  • Test database connectivity manually
  • Ensure firewall allows connections
  • Verify certificate files exist at specified paths
  • Check file permissions (service must be able to read certificates)
  • Ensure certificate and key files match
  • Use absolute paths for certificate locations