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 falsetrue, 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 modeA 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 falsetrue, false
CUBEJS_REDIS_URLThe host URL for a Redis serverA valid Redis host URL
CUBEJS_REDIS_PASSWORDThe password used to connect to the Redis serverA valid Redis password
CUBEJS_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 for a single appId (tenant). 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 for a single appId (tenant). Must be lower than CUBEJS_REDIS_POOL_MAX. Defaults to 2A valid number of connections
CUBEJS_REDIS_USE_IOREDISUse ioredis instead of redis. Defaults to falsetrue, false
CUBEJS_JWK_URLA valid URL to a JSON Web Key Sets (JWKS)https://<AUTH0-SUBDOMAIN>.auth0.com/.well-known/jwks.json
CUBEJS_JWT_KEYThe secret key used to sign and verify JWTs. Similar to CUBEJS_API_SECRETA valid string
CUBEJS_JWT_AUDIENCEAn audience value which will be used to enforce the aud claim from inbound JWTshttps://myapp.com
CUBEJS_JWT_ISSUERAn issuer value which will be used to enforce the iss claim from inbound JWTshttps://<AUTH0-SUBDOMAIN>.auth0.com/
CUBEJS_JWT_SUBJECTA subject value which will be used to enforce the sub claim from inbound JWTsperson@example.com
CUBEJS_JWT_ALGSAny supported algorithm for decoding JWTsHS256, RS256
CUBEJS_JWT_CLAIMS_NAMESPACEA namespace within the decoded JWT under which any custom claims can be foundhttps://myapp.com
CUBEJS_CUBESTORE_HOSTThe hostname of the Cube Store deploymentA valid hostname
CUBEJS_CUBESTORE_PORTThe port of the Cube Store deploymentA valid port number
CUBEJS_EXT_DB_TYPEAlternative to Cube Store storage for pre-aggregationsA database type supported by Cube.js
CUBEJS_EXT_DB_HOSTThe host URL for an external pre-aggregations databaseA valid database host URL
CUBEJS_EXT_DB_NAMEThe name of the external pre-aggregations database to connect toA valid database name
CUBEJS_EXT_DB_PASSThe password used to connect to the external pre-aggregations databaseA valid database password
CUBEJS_EXT_DB_PORTThe port for the external pre-aggregations databaseA valid port number
CUBEJS_EXT_DB_USERThe username used to connect to the external pre-aggregations databaseA valid database username

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_POLL_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_BQ_EXPORT_BUCKETBigQueryGCS bucket to use for export pre-aggregation tables to Cube Store. Use it to achieve best Cube Store ingestion performance possible.A valid Google Cloud Storage Bucket ID
CUBEJS_DB_BQ_LOCATIONBigQueryThe Google BigQuery dataset location to connect toA valid Google BigQuery regional location
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_DB_ELASTIC_APIKEY_IDElasticsearchID of the API key from elastic.coA valid Elastic.co API key ID
CUBEJS_DB_ELASTIC_APIKEY_KEYElasticsearchValue of the API key from elastic.coA valid Elastic.co API key value
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 indefinitelytrue, false
CUBEJS_DB_SNOWFLAKE_AUTHENTICATORSnowflakeThe type of authenticator to use with Snowflake. Use SNOWFLAKE with username/password, or SNOWFLAKE_JWT with key pairs. Defaults to SNOWFLAKESNOWFLAKE, SNOWFLAKE_JWT
CUBEJS_DB_SNOWFLAKE_PRIVATE_KEY_PATHSnowflakeThe path to the private RSA key folderA valid path to the private RSA key
CUBEJS_DB_SNOWFLAKE_PRIVATE_KEY_PASSSnowflakeThe password for the private RSA key. Only required for encrypted keysA valid password for the encrypted private RSA key
CUBEJS_DB_DATABRICKS_URLDatabricksThe URL for a JDBC connectionA valid JDBC URL

Environment variableDescriptionPossible Values
CUBEJS_DB_EXPORT_BUCKETThe name of a bucket in cloud storageexports-20210505
CUBEJS_DB_EXPORT_BUCKET_TYPEThe cloud provider where the bucket is hostedgcs, s3
CUBEJS_DB_EXPORT_BUCKET_AWS_KEYThe AWS Access Key ID to use for the export bucketA valid AWS Access Key ID
CUBEJS_DB_EXPORT_BUCKET_AWS_SECRETThe AWS Secret Access Key to use for the export bucketA valid AWS Secret Access Key
CUBEJS_DB_EXPORT_BUCKET_AWS_REGIONThe AWS region of the export bucketA valid AWS region
CUBEJS_DB_EXPORT_GCS_CREDENTIALSA Base64 encoded JSON key file for connecting to Google CloudA valid Google Cloud JSON key file encoded as a Base64 string
CUBEJS_DB_EXPORT_INTEGRATIONThe name of the integration used in the database. Only required when using Snowflake and GCSA valid string matching the name of the integration in Snowflake

Environment variableDescriptionPossible Values
CUBESTORE_BIND_ADDRThe address/port pair for Cube Store's MySQL-compatible interface. Defaults to 0.0.0.0:3306A valid address/port pair
CUBESTORE_DATA_DIRA path on the local filesystem to store a local replica of the data. Defaults to .cubestore/dataA valid path on the local filesystem with read/write access
CUBESTORE_HTTP_BIND_ADDRThe address/port pair for Cube Store's HTTP interface. Defaults to 0.0.0.0:3030A valid address/port pair
CUBESTORE_HTTP_PORTThe port for Cube Store to listen to HTTP connections on. Ignored when CUBESTORE_HTTP_BIND_ADDR is set. Defaults to 3030A valid port number
CUBESTORE_JOB_RUNNERSThe number of parallel tasks that process non-interactive jobs like data insertion, compaction etc. Defaults to 4A valid number
CUBESTORE_LOG_LEVELThe logging level for Cube Store. Defaults to errorerror, warn, info, debug, trace
CUBESTORE_META_ADDRThe address/port pair for the router node in the clusterA valid address/port pair
CUBESTORE_META_PORTThe port for the router node to listen for connections on. Ignored when CUBESTORE_META_ADDR is set.A valid port number
CUBESTORE_NO_UPLOADIf true, prevents uploading serialized pre-aggregations to cloud storagetrue, false
CUBESTORE_PORTThe port for Cube Store to listen to connections on. Ignored when CUBESTORE_BIND_ADDR is set. Defaults to 3306A valid port number
CUBESTORE_QUERY_TIMEOUTThe timeout for SQL queries in seconds. Defaults to 120A number in seconds
CUBESTORE_REMOTE_DIRA path on the local filesystem to store metadata and datasets from all nodes as if it were remote storage. Not required if using GCS/S3A valid path on the local filesystem with read/write access
CUBESTORE_SELECT_WORKERSThe number of Cube Store sub-processes that handle SELECT queries. Defaults to 4A valid number
CUBESTORE_SERVER_NAMEThe full name and port number of the Cube Store server. Must be unique for each instance in cluster mode. Defaults to localhostA valid address/port pair
CUBESTORE_WAL_SPLIT_THRESHOLDThe maximum number of rows to keep in a single chunk of data right after insertion. Defaults to 262144A valid number
CUBESTORE_WORKER_PORTThe port for Cube Store workers to listen to connections on. When set, the node will start as a worker in the clusterA valid port number
CUBESTORE_WORKERSA comma-separated list of address/port pairs; for example worker-1:3123,localhost:3124,123.124.125.128:3123A comma-separated list of address/port pairs

Environment variableDescriptionPossible Values
CUBESTORE_AWS_ACCESS_KEY_IDThe Access Key ID for AWS. Required when using AWS S3A valid AWS Access Key ID
CUBESTORE_AWS_SECRET_ACCESS_KEYThe Secret Access Key for AWS. Required when using AWS S3A valid AWS Secret Access Key
CUBESTORE_S3_BUCKETThe name of a bucket in AWS S3. Required when using AWS S3A valid bucket name in the AWS account
CUBESTORE_S3_REGIONThe region of a bucket in AWS S3. Required when using AWS S3A valid AWS region
CUBESTORE_S3_SUB_PATHThe path in a AWS S3 bucket to store pre-aggregations. Optional-
CUBESTORE_GCP_CREDENTIALSA Base64 encoded JSON key file for connecting to Google Cloud. Required when using Google Cloud StorageA valid Google BigQuery JSON key file encoded as a Base64 string
CUBESTORE_GCP_KEY_FILEThe path to a JSON key file for connecting to Google Cloud. Required when using Google Cloud StorageA valid Google Cloud JSON key file
CUBESTORE_GCS_BUCKETThe name of a bucket in GCS. Required when using GCSA valid bucket name in the Google Cloud account
CUBESTORE_GCS_SUB_PATHThe path in a GCS bucket to store pre-aggregations. Optional-