Manage Settings Using Environmental Variables

Prev Next

Rocket.Chat allows you to manage workspace settings using environment variables, offering an efficient alternative to modifying settings directly through the admin UI or database. This guide will provide a comprehensive overview of how you can  manage settings using environmental variables and the data types for each kind of setting.

To manage a setting using an environment variable, you need its setting ID. You can find the ID by hovering over the setting label in your workspace’s administration panel.

Configuring settings with environment variables

With environment variables in Rocket.Chat, you can:

Set the initial value for a setting

To define the value of a setting for the first time when starting the server, add the environment variable SETTING_ID=VALUE .

For example:

FileUpload_Storage_Type=hiGoogleCloudStorage

This only applies if the setting hasn't been previously configured in the UI or database. If the setting already has a value, use overwrite setting.

Overwrite the setting value

You can overwrite the value of any setting by using an environment variable prefixed with OVERWRITE_SETTING_<Setting Id>.

For example:

OVERWRITE_SETTING_FileUpload_Storage_Type=GoogleCloudStorage

Settings capable of this action can be seen when hovered in the Administration > Workspace > Settings section.

Block settings

To lock a setting and prevent it from being changed via the UI or API, use the SETTINGS_BLOCKED variable with a comma-separated list of setting IDs you want to block. For example:

SETTINGS_BLOCKED=FileUpload_Storage_Type,FileUpload_GoogleStorage_AccessId,FileUpload_GoogleStorage_Secret

To unblock any setting, remove it from the list and restart your Rocket.chat server.

Hide settings

To hide sensitive settings from appearing in the workspace UI, use the SETTINGS_HIDDEN variable with a comma-separated list of setting IDs you want to hide: For example:

SETTINGS_HIDDEN=FileUpload_GoogleStorage_AccessId,FileUpload_GoogleStorage_Secret

Use this command with extreme caution and avoid hiding any settings that the Rocket.Chat client depends on, for example FileUpload_Storage_Type.

Setting metadata and data types

To use environment variables effectively, it helps to understand the structure of each setting. Each setting includes metadata like its ID, type, default value, and visibility. When setting values via environment variables, you must use the correct data type—e.g., string, boolean, number, etc.

Basic settings

Name

Data Type

_id

SettingId = string

type

  • boolean

  • timezone

  • string

  • relativeUrl

  • password

  • int

  • select

  • multiSelect

  • language

  • color

  • font

  • code

  • action

  • asset

  • roomPick

  • group

  • date

public

boolean

env

boolean

group (Optional)

GroupId = SettingId

section (Optional)

SectionName = string

tab (Optional)

TabId = SettingId

i18nLabel

string

value

SettingValue can be one of the following types:

  • string

  • boolean

  • number

  • SettingValueMultiSelect

  • Date

  • AssetValue

  • undefined

packageValue

SettingValue can be one of the following types:

  • string

  • boolean

  • number

  • SettingValueMultiSelect

  • Date

  • AssetValue

  • undefined

blocked

boolean

enableQuery (Optional)

string

displayQuery (Optional)

string

sorter

number

properties (Optional)

unknown

enterprise (Optional)

boolean

requiredOnWizard (Optional)

boolean

hidden (Optional)

boolean

modules (Optional)

Array

invalidValue (Optional)

SettingValue can be one of the following values:

  • string

  • boolean

  • number

  • SettingValueMultiSelect

  • Date

  • AssetValue

  • undefined

valueSource (Optional)

string

secret (Optional)

boolean

i18nDescription (Optional)

string

autocomplete (Optional)

boolean

processEnvValue (Optional)

SettingValue can be one of the following values:

  • string

  • boolean

  • number

  • SettingValueMultiSelect

  • Date

  • AssetValue

  • undefined

meteorSettingsValue (Optional)

SettingValue can be one of the following values:

  • string

  • boolean

  • number

  • SettingValueMultiSelect

  • Date

  • AssetValue

  • undefined

ts

Date

createdAt

Date

_updatedAt (Optional)

Date

multiline (Optional)

boolean

values (Optional)

Array

placeholder (Optional)

string

wizard (Optional)

  • step: number

  • order: number

persistent (Optional)

boolean

readonly (Optional)

boolean

alert (Optional)

string

private (Optional)

boolean

Group settings

Name

Data Type

_id

string

hidden

boolean

blocked

boolean

ts

Date

sorter

number

i18nLabel

string

displayQuery

string

i18nDescription

string

value

undefined

type

group

alert

string

Enterprise settings

Name

Data Type

enterprise

true

invalidValue

SettingValue can be one of the following values:

  • string

  • boolean

  • number

  • SettingValueMultiSelect

  • Date

  • AssetValue

  • undefined

Color settings

Name

Data Type

type

color

editor

SettingEditor

packageEditor (Optional)

SettingEditor

Action settings

Name

Data Type

type

action

value

string

actionText (Optional)

string

Code settings

Name

Data Type

type

action

value

string

actionText (Optional)

string

Asset settings

Name

Data Type

type

asset

value

AssetValue

fileConstraints

IRocketChatAssetConstraint

asset

string

SelectOption settings

Name

Data Type

key

The type can be:

  • string

  • number

i18nLabel

string

Editor settings

Name

Data Type

COLOR

color

EXPRESSION

expression

Date settings

Name

Data Type

type

Date

value

Date

Statistics settings

Name

Data Type

account2fa (Optional)

boolean

cannedResponsesEnabled (Optional)

boolean

e2e (Optional)

boolean

e2eDefaultDirectRoom (Optional)

boolean

e2eDefaultPrivateRoom (Optional)

boolean

smtpHost (Optional)

string

smtpPort (Optional)

string

fromEmail (Optional)

string

fileUploadEnable (Optional)

boolean

frameworkDevMode (Optional)

boolean

frameworkEnable (Optional)

boolean

surveyEnabled (Optional)

boolean

updateChecker (Optional)

boolean

liveStream (Optional)

boolean

broadcasting (Optional)

boolean

allowEditing (Optional)

boolean

allowDeleting (Optional)

boolean

allowUnrecognizedSlashCommand (Optional)

boolean

allowBadWordsFilter (Optional)

boolean

readReceiptEnabled (Optional)

boolean

readReceiptStoreUsers (Optional)

boolean

otrEnable (Optional)

boolean

pushEnable (Optional)

boolean

globalSearchEnabled (Optional)

boolean

threadsEnabled (Optional)

boolean

bigBlueButton (Optional)

boolean

jitsiEnabled (Optional)

boolean

webRTCEnableChannel (Optional)

boolean

webRTCEnablePrivate (Optional)

boolean

webRTCEnableDirect (Optional)

boolean