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_REFRESH_WORKERIf true, this instance of Cube.js will only refresh pre-aggregations. Defaults to falsetrue, false
CUBEJS_ROLLUP_ONLYIf true, this instance of Cube.js will only query rollup pre-aggregations. Defaults to falsetrue, false
CUBEJS_SCHEDULED_REFRESH_TIMEZONESA comma-separated list of timezones to schedule refreshes for.A valid timezone from the tz database
CUBEJS_SCHEDULED_REFRESH_CONCURRENCYHow many pre-aggregations refresh worker will build in parallel. Please note changing this param doesn't change queue concurrency and it should be adjusted accordinglyA valid number of concurrent refresh processes
CUBEJS_PRE_AGGREGATIONS_SCHEMAThe schema 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_DB_QUERY_TIMEOUTThe timeout value for any queries made to the database by Cube. The value can be a number in seconds or a duration string. Defaults to 10m5000, 1s, 1m, 1h
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_TOPIC_NAMEThe name of the Amazon SNS or Google Cloud Pub/Sub topic (defaults to <process.env.CUBEJS_APP>-process if undefined, and finally cubejs-process)A valid topic name
CUBEJS_GH_API_TOKENA Github Personal Token to avoid Github API rate limit at downloading cubestoreIt can be a personal access token, an OAuth token, an installation access token or a JSON Web Token for GitHub App authentication

To see a complete list of environment variables for your specific database, please use the database connection guide.

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 hostedgcp, 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_BUCKET_REDSHIFT_ARNARN of iam_role with permission to write to the provided bucketA valid ARN to an IAM Role associated to the target Redshift DB
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. Must be unique on each node and different from CUBESTORE_REMOTE_DIR. 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/S3. Not recommended for production usageA 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_AWS_CREDS_REFRESH_EVERY_MINSThe number of minutes after which Cube Store should refresh AWS credentials. Required when using an AWS instance role. Default is 180A valid number in minutes
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-
CUBESTORE_MINIO_ACCESS_KEY_IDThe Access Key ID for minIO. Required when using minIOA valid minIO Access Key ID
CUBESTORE_MINIO_SECRET_ACCESS_KEYThe Secret Access Key for minIO. Required when using minIOA valid minIO Secret Access Key
CUBESTORE_MINIO_BUCKETThe name of the bucket that you want to use minIO. Required when using minIOA valid bucket name in the AWS account
CUBESTORE_MINIO_REGIONThe region of a bucket in S3 that you want to use minIO. Optional when using minIOA valid S3 region name, an empty string if not present
CUBESTORE_MINIO_SERVER_ENDPOINTThe minIO server endpoint. Required when using minIOA valid minIO endpoint e.g. http://localhost:9000
CUBESTORE_MINIO_CREDS_REFRESH_EVERY_MINSThe number of minutes after which Cube Store should refresh minIO credentials. Default is 180A valid number in minutes

Did you find this page useful?