Skip to content

Configuration via .env

Silobase is configured entirely through environment variables, making it easy to connect to your infrastructure and deploy across different environments. Below is a complete overview of the required and upcoming configuration options available through the .env file.

Required Configuration

These are the core environment variables required to run Silobase:

env
DB_CLIENT= pg # or mssql
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_PORT=
DB_NAME=

API_KEY_READ=
API_KEY_WRITE=
API_KEY_FULL=

Environment Variable Descriptions

VariableDescription
DB_CLIENTDatabase driver to use. Currently supports only pg (PostgreSQL) and mssql (SQL Server).
DB_HOSTHostname or IP address of the database server.
DB_USERUsername for authenticating with the database.
DB_PASSWORDPassword for the specified database user.
DB_PORTPort number for connecting to the database. Default is 5432 for PostgreSQL and 1433 for MSSQL.
DB_NAMEName of the database to connect to.
API_KEY_READAPI key used to authorize GET requests (read-only access).
API_KEY_WRITEAPI key used to authorize POST, PUT, and DELETE requests (write access).
API_KEY_FULLMaster key with full access to all operations (read, write, update, delete).

All API requests to Silobase must include the appropriate key in the x-api-key header.


Coming Soon

These environment variables are planned for future releases as Silobase expands its provider support and feature set:

Storage Configuration (Planned)

VariableDescription
STORAGE_PROVIDERStorage provider (e.g., aws, azure, gcs).
STORAGE_BUCKET_NAMEName of the storage bucket or container.
STORAGE_ACCESS_KEYAccess key for the storage service.
STORAGE_SECRET_KEYSecret key or credential used to authenticate storage access.

Email Provider Configuration (Planned)

VariableDescription
EMAIL_PROVIDEREmail service provider (e.g., resend, mailgun, smtp).
EMAIL_API_KEYAPI key or SMTP credentials for sending transactional emails.
EMAIL_FROM_ADDRESSDefault "from" email address for outgoing messages.

Best Practices

  • Never commit .env files to version control. Use .env.example to provide a safe template.
  • Use strong, unique API keys for each permission level.
  • Scope keys appropriately in production to limit exposure and follow the principle of least privilege.
  • Use secrets management tools (e.g., GitHub Actions secrets, Docker secrets, Vault) in CI/CD pipelines.

Example .env Template

env
# Database
DB_CLIENT= pg # or mssql
DB_HOST=
DB_USER=
DB_PASSWORD=
DB_PORT=
DB_NAME=

# API Keys
API_KEY_READ=read-only-key
API_KEY_WRITE=write-access-key
API_KEY_FULL=admin-master-key

Silobase’s environment-first design enables you to stay backendless and flexible — just plug in your infrastructure and start building with clean HTTP APIs.