Deployment Environment Variables

Environment variables define key settings that influence or control how your workspace is deployed and configured. This topic covers the mandatory and optional deployment environment variables available to help you successfully deploy your workspace according to your needs.

Each recommended deployment method discusses how to set up these environment variables in its respective documentation. Using the most common deployment method, deploy with Docker & Docker Compose, these variables can be set within the environment section under the rocketchat service in your compose.yml file. Refer to the Kubernetes, Docker, and Snap documentation for specific setup instructions.

Mandatory environment variables

Most mandatory environment variables are included by default in your deployment, so verify this before making further changes.

Name

Description

Comment

RELEASE

Set the variable to your preferred Rocket.Chat release version. For example: 7.4.0

See our releases page and available docker images. Keeping the default release as latest is not recommended.

ROOT_URL

The URL where your Rocket.Chat instance will be hosted on. In other words the URL you will enter on your browser to access Rocket.Chat.

Format is [protocol]://[domain or ip][: optional port]/[optional path]

PORT

Port your Rocket.Chat instance will bind to.

If served under a FQDN (which is recommended) this doesn't matter much, as long as the configured one is not in reserved range and doesn't collide with any other services.

MONGO_URL

MongoDB connection string.

Read MongoDB's official documentation to understand this better. Usage also depends on your deployment method of choice.

MONGO_OPLOG_URL

MongoDB connection string to the local database.

Similar to the above, except this points directly to the local database. E.g. mongodb://localhost:27017/local

Optional environment variables

Name

Description

Comment

BIND_IP

Which IP the node (or main Rocket.Chat) process will bind to.

If intended to be accessed under a domain, which is recommended, users should set this to the loopback address (i.e. 127.0.0.1) or any private IP in the host that's accessible via a reverse proxy or load balancer. This will ensure the instance isn't accessible via any IP that isn't intended.

ADMIN_USERNAME

Admin user's username.

Admin user can be created automatically on deployment. Set this to your admin user's desired username. Mandatory if any of the other ADMIN_* variables are passed for a successful account creation.

ADMIN_NAME

Admin user's name.

Mandatory if any of the other ADMIN_* variables are passed for a successful account creation.

ADMIN_PASS

Admin user's password (in plaintext).

Mandatory if any of the other ADMIN_* variables are passed for a successful account creation.

ADMIN_EMAIL

Admin user's email address.

Mandatory if any of the other ADMIN_* variables are passed for a successful account creation.

HTTP_FORWARDED_COUNT

The number of proxies in front of Rocket.Chat.

If not configured, it defaults to 1 as Rocket.Chat assumes there’s always a proxy in front of it. This variable should be properly configured to avoid security and performance issues regarding rate limiting and other controls.

INSTANCE_IP

The Rocket.Chat IP address accessible by other Rocket.Chat servers when scaling multiple instances.

It enables instances to communicate directly with each other. This direct communication is essential for transmitting ephemeral events, such as user typing indicators, between instances.

ALLOW_UNSAFE_QUERY_AND_FIELDS_API_PARAMS

Enable the query and fields API parameters in your workspace.

The query and fields parameter has been deprecated in 5.0.0 and disabled from 7.0.0. However, they can be enabled in the workspace by setting the ALLOW_UNSAFE_QUERY_AND_FIELDS_API_PARAMS: true variable. Enabling these parameters may expose your workspace to security risks, and Rocket.Chat is not responsible for any resulting vulnerabilities. These parameters are scheduled for removal in version 8.0.0, after which enabling them will no longer be an option.

APPS_ENGINE_RUNTIME_TIMEOUT

Modify the amount of time (in milliseconds) it takes for an app to respond to a call. By default, the timeout is 30 seconds.

You can use this variable to set longer timeouts if you have apps with larger operations.

After configuring the mandatory and optional deployment environment variables, see how to manage your workspace settings with environment variables in the next topic.