Environment Variables

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

Environment variableDescriptionPossible Values
CUBEJS_CACHE_AND_QUEUE_DRIVERThe cache and queue driver to use for the Cube.js deployment. Defaults to redisredis, memory
CUBEJS_DEV_MODEIf true, enables development mode. Defaults to false.true, false
CUBEJS_API_SECRETThe secret key used to sign and verify JWTs. Generated on project scaffoldA valid string
CUBEJS_APPAn application ID used to uniquely identify the Cube.js deployment. Can be different for multitenant setups. Defaults to cubejsA valid string
CUBEJS_SCHEDULED_REFRESH_TIMERIf true, enabled scheduled refreshes. Can also be set to a number representing how many seconds to wait before triggering another refresh. Defaults to falsetrue, false or a valid number of seconds
CUBEJS_SCHEDULED_REFRESH_TIMEZONESA comma-separated list of timezones to schedule refreshes for.A valid timezone from the tz database
CUBEJS_PRE_AGGREGATIONS_SCHEMASchema name to use for storing pre-aggregations. Defaults to dev_pre_aggregations/prod_pre_aggregations for development/production mode.A valid string
CUBEJS_SCHEMA_PATHThe path where Cube.js loads schemas from. Defaults to schemaA valid folder containing Cube.js schemas
CUBEJS_TELEMETRYIf true, then send telemetry to CubeJS. Defaults to truetrue, false
CUBEJS_WEB_SOCKETSIf true, then use WebSocket for data fetching. Defaults to truetrue, false
PORTThe port for a Cube.js deployment to listen to API connections on. Defaults to 4000A valid port number
CUBEJS_LOG_LEVELThe logging level for Cube.js. Defaults to warnerror, info, trace, warn
DEBUG_LOGIf true, enables debug logging. Defaults to false.true, false
REDIS_URLThe host URL for a Redis serverA valid Redis host URL
REDIS_PASSWORDThe password used to connect to the Redis serverA valid Redis password
REDIS_TLSIf true, then the connection to the Redis server is protected by TLS authentication. Defaults to falsetrue, false
CUBEJS_REDIS_POOL_MAXThe maximum number of connections to keep active in the Redis connection pool. Must be higher than CUBEJS_REDIS_POOL_MIN. Defaults to 1000A valid number of connections.
CUBEJS_REDIS_POOL_MINThe minimum number of connections to keep active in the Redis connection pool. Must be lower than CUBEJS_REDIS_POOL_MAX. Defaults to 2A valid number of connections

The following environment variables are used to provide credentials for Cube.js to connect to the databases. You can learn more about connecting to the databases in this guide.

Environment variableUsed WithDescriptionPossible Values
CUBEJS_AWS_KEYAWS Athena, JDBCThe AWS Access Key ID to use for database connectionsA valid AWS Access Key ID
CUBEJS_AWS_REGIONAWS Athena, JDBCThe AWS region of the Cube.js deploymentA valid AWS region
CUBEJS_AWS_S3_OUTPUT_LOCATIONAWS Athena, JDBCThe S3 path to store query results made by the Cube.js deploymentA valid S3 path
CUBEJS_AWS_SECRETAWS Athena, JDBCThe AWS Secret Access Key to use for database connectionsA valid AWS Secret Access Key
CUBEJS_DB_PULL_TIMEOUTBigQuery, AWS AthenaTimeout for query pollingA number in seconds or a string that specify time (1s, 5m)
CUBEJS_DB_PULL_MAX_INTERVALBigQuery, AWS AthenaMax interval on retries for query pollingA number in seconds or a string that specify time (5s, 1m)
CUBEJS_DB_BQ_CREDENTIALSBigQueryA Base64 encoded JSON key file for connecting to Google BigQueryA valid Google BigQuery JSON key file encoded as a Base64 string
CUBEJS_DB_BQ_KEY_FILEBigQueryThe path to a JSON key file for connecting to Google BigQueryA valid Google BigQuery JSON key file
CUBEJS_DB_BQ_PROJECT_IDBigQueryThe Google BigQuery project ID to connect toA valid Google BigQuery Project ID
CUBEJS_DB_URLDruid, ElasticsearchThe URL for a databaseA valid database URL for Druid/Elasticsearch
CUBEJS_DB_ELASTIC_OPENDISTROElasticsearchIf true, then use the Open Distro for Elasticsearchtrue, false
CUBEJS_DB_ELASTIC_QUERY_FORMATElasticsearchBy 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)json, jdbc
CUBEJS_EXT_DB_HOSTExternalThe host URL for an external pre-aggregations databaseA valid database host URL
CUBEJS_EXT_DB_NAMEExternalThe name of the external pre-aggregations database to connect toA valid database name
CUBEJS_EXT_DB_PASSExternalThe password used to connect to the external pre-aggregations databaseA valid database password
CUBEJS_EXT_DB_PORTExternalThe port for the external pre-aggregations databaseA valid port number
CUBEJS_EXT_DB_TYPEExternalA database type supported by Cube.jsA valid database supported by Cube.js
CUBEJS_EXT_DB_USERExternalThe username used to connect to the external pre-aggregations databaseA valid database username
CUBEJS_DB_SSLGeneralIf true, enables SSL encryption for database connections from Cube.jstrue, false
CUBEJS_DB_SSL_REJECT_UNAUTHORIZEDGeneralIf true, verifies the CA chain with the system's built-in CA chaintrue, false
CUBEJS_DB_SSL_CAGeneralThe contents of a CA bundle in PEM format, or a path to one. For more information, check the options.ca property for TLS Secure Contexts in the Node.js documentationA valid CA bundle or a path to one
CUBEJS_DB_SSL_CERTGeneralThe contents of an SSL certificate in PEM format, or a path to one. For more information, check the options.cert property for TLS Secure Contexts in the Node.js documentationA valid SSL certificate or a path to one
CUBEJS_DB_SSL_KEYGeneralThe contents of a private key in PEM format, or a path to one. For more information, check the options.key property for TLS Secure Contexts in the Node.js documentationA valid SSL private key or a path to one
CUBEJS_DB_SSL_CIPHERSGeneralThe ciphers used by the SSL certificate. For more information, check the options.ciphers property for TLS Secure Contexts in the Node.js documentationAny valid SSL cipher(s)
CUBEJS_DB_SSL_SERVERNAMEGeneralThe server name for the SNI TLS extension. For more information, check the options.servername property for TLS Connections in the Node.js documentationA valid SNI TLS extension
CUBEJS_DB_SSL_PASSPHRASEGeneralThe passphrase used to encrypt the SSL private key. For more information, check the options.passphrase property for TLS Secure Contexts in the Node.js documentationA valid passphrase
CUBEJS_DB_TYPEGeneralA database type supported by Cube.jsA valid database supported by Cube.js
CUBEJS_DB_USERGeneralThe username used to connect to the databaseA valid database username
CUBEJS_DB_HOSTGeneralThe host URL for a databaseA valid database host URL
CUBEJS_DB_MAX_POOLGeneralThe maximum number of connections to keep active in the database connection poolA valid number of connections
CUBEJS_DB_NAMEGeneralThe name of the database to connect toA valid database name
CUBEJS_DB_PASSGeneralThe password used to connect to the databaseA valid database password
CUBEJS_DB_PORTGeneralThe port for the database connectionA valid port number
CUBEJS_DB_SCHEMAGeneralThe schema within the database to connect toA valid schema name within a Presto database
CUBEJS_DB_HIVE_CDH_VERHiveThe version of the CDH instance for Apache HiveA valid CDH version
CUBEJS_DB_HIVE_THRIFT_VERHiveThe version of Thrift Server for Apache HiveA valid Thrift Server version
CUBEJS_DB_HIVE_TYPEHiveThe type of Apache Hive serverCDH, HIVE
CUBEJS_DB_HIVE_VERHiveThe version of Apache HiveA valid Apache Hive version
CUBEJS_JDBC_DRIVERJDBCathena
CUBEJS_JDBC_URLJDBCThe URL for a JDBC connectionA valid JDBC URL
CUBEJS_DB_DOMAINMSSQLA domain name within the database to connect toA valid domain name within a MSSQL database
CUBEJS_DB_SOCKET_PATHMySQLThe path to a Unix socket for a MySQL databaseA valid path to a Unix socket for a MySQL database
CUBEJS_DB_CATALOGPrestoThe catalog within the database to connect toA valid catalog name within a Presto database
CUBEJS_DB_SNOWFLAKE_ACCOUNTSnowflakeThe Snowflake account ID to use when connecting to the databaseA valid Snowflake account ID
CUBEJS_DB_SNOWFLAKE_REGIONSnowflakeThe Snowflake region to use when connecting to the databaseA valid Snowflake region
CUBEJS_DB_SNOWFLAKE_ROLESnowflakeThe Snowflake role to use when connecting to the databaseA valid Snowflake role for the account
CUBEJS_DB_SNOWFLAKE_WAREHOUSESnowflakeThe Snowflake warehouse to use when connecting to the databaseA valid Snowflake warehouse for the account
CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVESnowflakeIf true, (keep the Snowflake connection alive indefinitely)link-snowflake-connection-optionstrue, false