Environment Variables

Cube defines a number of environment variables that can be used to change behavior. Some of these variables can also be set via configuration options.

To see a complete list of environment variables for a specific data source, please use the Connecting to Data Sources page.

The secret key used to sign and verify JWTs. Generated on project scaffold with npx cubejs-cli create.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringN/AN/A

An application ID used to uniquely identify the Cube deployment. Can be different for multitenant setups.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringcubejscubejs

The AWS Access Key ID to use for database connections.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS Access Key IDN/AN/A

The AWS Secret Access Key to use for database connections.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS Secret Access KeyN/AN/A

The AWS region to use for database connections.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS regionN/AN/A

The S3 path to store AWS Athena query results made by Cube.

Possible ValuesDefault in DevelopmentDefault in Production
A valid S3 pathN/AN/A

The name of the AWS Athena workgroup in which the query is being started.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Athena WorkgroupN/AN/A

The name of the AWS Athena catalog to use for queries.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Athena Catalog nameN/AN/A

The name of the schema to use as information_schema filter. Reduces count of tables loaded during schema generation.

Possible ValuesDefault in DevelopmentDefault in Production
A valid schema nameN/AN/A

The cache and queue driver to use for the Cube deployment.

Possible ValuesDefault in DevelopmentDefault in Production
redis, memorymemoryredis

The number of concurrent connections each query queue has to the database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid numberSee database-specific pageSee database-specific page

The hostname of the Cube Store deployment

Possible ValuesDefault in DevelopmentDefault in Production
A valid hostnamelocalhostN/A

The port of the Cube Store deployment.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port number30303030

A comma-separated list of data source names. Data sources defined here can be used to decorate CUBEJS_DB_* environment variables.

Possible ValuesDefault in DevelopmentDefault in Production
A comma-separated list of stringsN/AN/A
CUBEJS_DATASOURCES=default,datasource1

A Base64 encoded JSON key file for connecting to Google BigQuery.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Google BigQuery JSON key file encoded as a Base64 stringN/AN/A

The path to a JSON key file for connecting to Google BigQuery.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Google BigQuery JSON key fileN/AN/A

The Google BigQuery dataset location to connect to. Required if used with pre-aggregations outside of US. If not set then BQ driver will fail with Dataset was not found in location US error.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Google BigQuery regional locationN/AN/A

The Google BigQuery project ID to connect to.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Google BigQuery Project IDN/AN/A

Whether the ClickHouse user has read-only access or not.

Possible ValuesDefault in DevelopmentDefault in Production
true, falseN/AN/A

To accept the license terms for the Databricks JDBC driver, this must be set to true.

Possible ValuesDefault in DevelopmentDefault in Production
true, falseN/AN/A

The personal access token used to authenticate the Databricks connection.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Databricks access tokenN/AN/A

The URL for a JDBC connection.

Possible ValuesDefault in DevelopmentDefault in Production
A valid JDBC URLN/AN/A

A domain name within an MS SQL database to connect to.

Possible ValuesDefault in DevelopmentDefault in Production
A valid domain name within a MS SQL databaseN/AN/A

The ID of the API key from elastic.co. Required when using Elastic Cloud.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Elastic.co API key IDN/AN/A

The API key from elastic.co. Required when using Elastic Cloud.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Elastic.co API keyN/AN/A

If true, then use the Open Distro for Elasticsearch.

Possible ValuesDefault in DevelopmentDefault in Production
true, falseN/AN/A

By default, queries return data in JDBC format, but you can also return data in standard Elasticsearch JDBC, JSON, CSV, YAML or raw formats (only JSON and JDBC are currently supported).

Possible ValuesDefault in DevelopmentDefault in Production
json, jdbcN/AN/A

The name of a bucket in cloud storage to store the database export snapshots.

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
A valid bucket in the configured cloud storageN/AN/A
CUBEJS_DB_EXPORT_BUCKET=exports-20210505

# Decorated with a data source named `datasource1`
CUBEJS_DS_DATASOURCE1_DB_EXPORT_BUCKET=exports-20210505

The cloud provider where the bucket is hosted.

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
gcp, s3N/AN/A
CUBEJS_DB_EXPORT_BUCKET_TYPE=gcp

# Decorated with a data source named `datasource1`
CUBEJS_DS_DATASOURCE1_DB_EXPORT_BUCKET_TYPE=gcp

The AWS Access Key ID to use for the export bucket.

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS Access Key IDN/AN/A

The AWS Secret Access Key to use for the export bucket.

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS Secret Access KeyN/AN/A

The AWS region of the export bucket.

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS regionN/AN/A

The mount path to use for a Databricks DBFS mount.

Possible ValuesDefault in DevelopmentDefault in Production
A valid mount pathN/AN/A

An ARN of an AWS IAM role with permission to write to the configured bucket (see CUBEJS_DB_EXPORT_BUCKET).

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
A valid ARN to an IAM Role associated with the target Redshift data sourceN/AN/A

A Base64 encoded JSON key file for connecting to Google Cloud.

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Google Cloud JSON key file encoded as a Base64 stringN/AN/A

The name of the integration used in the database. Only required when using Snowflake and Google Cloud Storage.

When using multiple data sources, this environment variable can be decorated with a data source.

Possible ValuesDefault in DevelopmentDefault in Production
A valid string matching the name of the integration in SnowflakeN/AN/A

The host URL for a database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid database host URLN/AN/A

The maximum number of concurrent database connections to pool.

Possible ValuesDefault in DevelopmentDefault in Production
A valid numberSee database-specific pageSee database-specific page

The name of the database to connect to.

Possible ValuesDefault in DevelopmentDefault in Production
A valid database nameN/AN/A

The password used to connect to the database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid database passwordN/AN/A

The port for the database connection.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port numberN/AN/A

The catalog within Presto/Trino to connect to.

Possible ValuesDefault in DevelopmentDefault in Production
A valid catalog name within a Presto/Trino databaseN/AN/A

The timeout value for any queries made to the database by Cube.

Possible ValuesDefault in DevelopmentDefault in Production
A number in seconds or a duration string10m10m

The Snowflake account identifier to use when connecting to the database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Snowflake account IDN/AN/A

The type of authenticator to use with Snowflake. Use SNOWFLAKE with username/password, or SNOWFLAKE_JWT with key pairs.

Possible ValuesDefault in DevelopmentDefault in Production
SNOWFLAKE, SNOWFLAKE_JWTSNOWFLAKESNOWFLAKE

If true, keep the Snowflake connection alive indefinitely.

Possible ValuesDefault in DevelopmentDefault in Production
true, falseN/AN/A

The password for the private RSA key. Only required for encrypted keys.

Possible ValuesDefault in DevelopmentDefault in Production
A valid password for the encrypted private RSA keyN/AN/A

The path to the private RSA key folder.

Possible ValuesDefault in DevelopmentDefault in Production
A valid path to the private RSA keyN/AN/A

The Snowflake region to use when connecting to the database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Snowflake regionN/AN/A

The Snowflake role to use when connecting to the database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Snowflake role in the accountN/AN/A

The Snowflake warehouse to use when connecting to the database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Snowflake warehouse in the accountN/AN/A

If true, enables SSL encryption for database connections from Cube.

Possible ValuesDefault in DevelopmentDefault in Production
true, falseN/AN/A

A database from the list of supported databases.

Possible ValuesDefault in DevelopmentDefault in Production
Any valid database supported by CubeN/AN/A

The URL for a database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid database URLN/AN/A

The username used to connect to the database.

Possible ValuesDefault in DevelopmentDefault in Production
A valid database usernameN/AN/A

If true, enables development mode.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsetruefalse

If true, it enables dropping pre-aggregations that Refresh Worker doesn't touch within CUBEJS_TOUCH_PRE_AGG_TIMEOUT. Pre-aggregations are touched whenever they are rebuilt or a Refresh Worker checks its freshness. The first drop will be initiated when the Refresh Worker is able to check freshness for every scheduledRefresh: true pre-aggregation. If you have multiple Refresh Workers with different schema versions sharing the same Cube Store cluster, then touches from both refresh workers are respected.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsetruetrue

The Firebolt account name.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Firebolt account nameN/AN/A

The Firebolt API endpoint. Used for authentication.

Possible ValuesDefault in DevelopmentDefault in Production
api.dev.firebolt.io, api.staging.firebolt.io, api.app.firebolt.ioN/AN/A

The name of the Firebolt engine to connect to.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Firebolt engine nameN/AN/A

A GitHub Personal Access Token to avoid API rate limiting when downloading Cube Store.

Possible ValuesDefault in DevelopmentDefault in Production
A valid GitHub PATfalsefalse

Enables JSON Web Key (JWK)-based authentication in Cube.

Possible ValuesDefault in DevelopmentDefault in Production
A valid URL to a JSON Web Key SetN/AN/A

Any supported algorithm for decoding JWTs.

Possible ValuesDefault in DevelopmentDefault in Production
HS256, RS256N/AN/A

An audience value which will be used to enforce the aud claim from inbound JWTs.

Possible ValuesDefault in DevelopmentDefault in Production
A valid aud claimN/AN/A

A namespace within the decoded JWT under which any custom claims can be found.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringN/AN/A

An issuer value which will be used to enforce the iss claim from inbound JWTs.

Possible ValuesDefault in DevelopmentDefault in Production
A valid iss claimN/AN/A

The secret key used to sign and verify JWTs. Similar to CUBEJS_API_SECRET.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringN/AN/A

A subject value which will be used to enforce the sub claim from inbound JWTs.

Possible ValuesDefault in DevelopmentDefault in Production
A valid sub claimN/AN/A

The logging level for Cube.

Possible ValuesDefault in DevelopmentDefault in Production
error, info, trace, warnwarnwarn

The maximum number of partitions each pre-aggregation in a cube can use.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number1000010000

The port to listen to Postgres-compatible connections on.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port numberN/AN/A

If true, this instance of Cube will build pre-aggregations, even if it is an API instance.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsetruefalse *

If Cube is configured to act as a refresh worker instance using CUBEJS_REFRESH_WORKER, then CUBEJS_PRE_AGGREGATIONS_BUILDER will be true.

The schema name to use for storing pre-aggregations.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringdev_pre_aggregationsprod_pre_aggregations

The password used to connect to the Redis server.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Redis passwordN/AN/A

The maximum number of connections to keep active in the Redis connection pool for a single appId (tenant). Must be higher than CUBEJS_REDIS_POOL_MIN.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number of connections10001000

The minimum number of connections to keep active in the Redis connection pool for a single appId (tenant). Must be lower than CUBEJS_REDIS_POOL_MAX.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number of connections22

If true, then the connection to the Redis server is protected by TLS authentication.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsefalsefalse

The host URL for a Redis server.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Redis host URLN/AN/A

Use ioredis instead of redis.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsefalsefalse

If true, this instance of Cube will only refresh pre-aggregations.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsefalsefalse

If true, this instance of Cube will only query rollup pre-aggregations.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsefalsefalse

How many pre-aggregations refresh worker will build in parallel. Please note changing this param doesn't change queue concurrency and it should be adjusted accordingly

Possible ValuesDefault in DevelopmentDefault in Production
A valid number of concurrent refresh processesN/AN/A

A comma-separated list of timezones to schedule refreshes for. Used in conjunction with CUBEJS_SCHEDULED_REFRESH_CONCURRENCY.

Possible ValuesDefault in DevelopmentDefault in Production
A valid timezone from the tz databaseN/AN/A

The path where Cube loads schemas from.

Possible ValuesDefault in DevelopmentDefault in Production
A valid path containing Cube schemasschemaschema

Required password to access SQL API.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringN/AN/A

The port to listen to MySQL compatibility connections on.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port numberN/AN/A

A name of specific user who will be allowed to change security context.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringN/AN/A

Required username to access SQL API.

Possible ValuesDefault in DevelopmentDefault in Production
A valid stringN/AN/A

If true, then send telemetry to Cube.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsetruetrue

The number of seconds without a touch before pre-aggregation is considered orphaned and marked for removal. Please see CUBEJS_DROP_PRE_AGG_WITHOUT_TOUCH to learn more.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number8640086400

If true, then use WebSocket for data fetching.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsetruetrue

The Access Key ID for AWS. Required when using AWS S3.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS Access Key IDN/AN/A

The Secret Access Key for AWS. Required when using AWS S3.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS Secret Access KeyN/AN/A

The number of minutes after which Cube Store should refresh AWS credentials. Required when using an AWS instance role.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number in minutes180180

The address/port pair for Cube Store's MySQL-compatible interface.

Possible ValuesDefault in DevelopmentDefault in Production
A valid address/port pair0.0.0.0:33060.0.0.0:3306

A path on the local filesystem to store a local replica of the data. Must be unique on each node and different from CUBESTORE_REMOTE_DIR.

Possible ValuesDefault in DevelopmentDefault in Production
A valid path on the local filesystem with read/write access.cubestore/data.cubestore/data

A Base64-encoded JSON key file for connecting to Google Cloud. Required when using Google Cloud Storage

Possible ValuesDefault in DevelopmentDefault in Production
A valid Google BigQuery JSON key file encoded as a Base64 stringN/AN/A

The path to a JSON key file for connecting to Google Cloud. Required when using Google Cloud Storage.

Possible ValuesDefault in DevelopmentDefault in Production
A valid Google Cloud JSON key fileN/AN/A

The name of a bucket in GCS. Required when using GCS

Possible ValuesDefault in DevelopmentDefault in Production
A valid bucket name in the Google Cloud accountN/AN/A

The path in a GCS bucket to store pre-aggregations. Optional

Possible ValuesDefault in DevelopmentDefault in Production
A valid path prefixN/AN/A

The address/port pair for Cube Store's HTTP interface.

Possible ValuesDefault in DevelopmentDefault in Production
A valid address/port pair0.0.0.0:30300.0.0.0:3030

The port for Cube Store to listen to HTTP connections on. Ignored when CUBESTORE_HTTP_BIND_ADDR is set.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port number30303030

The number of parallel tasks that process non-interactive jobs like data insertion, compaction etc.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number44

The logging level for Cube Store.

Possible ValuesDefault in DevelopmentDefault in Production
error, warn, info, debug, traceerrorerror

The address/port pair for the router node in the cluster.

Possible ValuesDefault in DevelopmentDefault in Production
A valid address/port pairN/AN/A

The port for the router node to listen for connections on. Ignored when CUBESTORE_META_ADDR is set.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port numberN/AN/A

The Access Key ID for minIO. Required when using minIO.

Possible ValuesDefault in DevelopmentDefault in Production
A valid minIO Access Key IDN/AN/A

The name of the bucket that you want to use minIO. Required when using minIO.

Possible ValuesDefault in DevelopmentDefault in Production
A valid bucket nameN/AN/A

The number of minutes after which Cube Store should refresh minIO credentials.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number in minutes180180

The region of a bucket in AWS. Optional when using minIO.

Possible ValuesDefault in DevelopmentDefault in Production
A valid S3 region name, an empty string if not presentN/AN/A

The Secret Access Key for minIO. Required when using minIO.

Possible ValuesDefault in DevelopmentDefault in Production
A valid minIO Secret Access KeyN/AN/A

The minIO server endpoint. Required when using minIO.

Possible ValuesDefault in DevelopmentDefault in Production
A valid minIO endpointN/AN/A
CUBESTORE_MINIO_SERVER_ENDPOINT=http://localhost:9000

If true, prevents uploading serialized pre-aggregations to cloud storage.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsefalsefalse

The port for Cube Store to listen to connections on. Ignored when CUBESTORE_BIND_ADDR is set.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port number33063306

The timeout for SQL queries in seconds.

Possible ValuesDefault in DevelopmentDefault in Production
A number in seconds120120

A path on the local filesystem to store metadata and datasets from all nodes as if it were remote storage. Not required if using GCS/S3. Not recommended for production usage

Possible ValuesDefault in DevelopmentDefault in Production
A valid path on the local filesystem with read/write accessN/AN/A

The name of a bucket in AWS S3. Required when using AWS S3.

Possible ValuesDefault in DevelopmentDefault in Production
A valid bucket name in the AWS accountN/AN/A

| The region of a bucket in AWS S3. Required when using AWS S3.

Possible ValuesDefault in DevelopmentDefault in Production
A valid AWS regionN/AN/A

The path in a AWS S3 bucket to store pre-aggregations. Optional.

Possible ValuesDefault in DevelopmentDefault in Production
A valid path prefixN/AN/A

The number of Cube Store sub-processes that handle SELECT queries.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number44

The full name and port number of the Cube Store server. Must be unique for each instance in cluster mode.

Possible ValuesDefault in DevelopmentDefault in Production
A valid address/port pairlocalhostlocalhost

The maximum number of rows to keep in a single chunk of data right after insertion.

Possible ValuesDefault in DevelopmentDefault in Production
A valid number262144262144

The port for Cube Store workers to listen to connections on. When set, the node will start as a worker in the cluster

Possible ValuesDefault in DevelopmentDefault in Production
A valid port numberN/AN/A

A comma-separated list of address/port pairs for Cube Store workers.

Possible ValuesDefault in DevelopmentDefault in Production
A comma-separated list of address/port pairsN/AN/A
CUBESTORE_WORKERS=worker-1:3123,localhost:3124,123.124.125.128:3123

If true, enables debug logging.

Possible ValuesDefault in DevelopmentDefault in Production
true, falsefalsefalse

The port for a Cube deployment to listen to API connections on.

Possible ValuesDefault in DevelopmentDefault in Production
A valid port number40004000

Did you find this page useful?