Environment Configuration
    • Dark
    • PDF

    Environment Configuration

    • Dark
    • PDF

    Article summary

    This guide provides detailed instructions for configuring the environment necessary to run Rocket.Chat. Proper environment configuration ensures optimal performance, security, and functionality of Rocket.Chat.

    As of December 15, 2023, Rocket.Chat has ceased support for connections from cloud services and official mobile/desktop apps to workspaces running legacy versions outside our support window. Users on unsupported legacy servers are advised to upgrade to the latest Rocket.Chat version to ensure continued access to cloud, mobile, and desktop applications. Each Rocket.Chat version is supported for six months post-release.


    Before proceeding with the environment configuration, ensure the following prerequisites are met:

    Configuration steps

    1. Setting environment variables

    Environment variables can be used to influence the workspace deployment or the workspace settings. Configuring the environment variables depends on the method of deployment. Generally, you can follow these steps:

    • Set deployment environment variables: In the .env or the compose.yml file (for Docker deployment), set values for the mandatory variables such as ROOT_URL, PORT, and MONGO_URL. You can also set values for the optional variables according to your requirements.

      • Modify deployment environment variables: Modify the variables you need and deploy the workspace again for the changes to take effect.

      • See environment variables for detailed information.

    • Settings environment variables: Configure the environment variables to manage the workspace settings.

    2. Database configuration

    Rocket.Chat uses MongoDB. Configure the database connection:

    • MongoDB connection string URI: Connect Rocket.Chat and the MongoDB instance using a connection string URI. The authentication is done with a username and password.

    • Backup and restore: Perform a backup of your workspace data.

    • Replication: Configure a MongoDB replica set to improve the data availability.

    3. Integrating external services

    Integrate external services like email, authentication, and file storage:

    • Email: Use the mailer tool to send emails to users in your workspace. For Omnichannel, use email inboxes to create and manage the email accounts for the channels.

    • Authentication: Set up user authentication and authorization using any of the available methods.

    • File upload and storage: Configure storage options for file uploads and storage (e.g., local file system, AWS S3, Google Cloud Storage, etc.).

    4. Security settings

    Enhance the security of your Rocket.Chat server:

    5. High-scale deployment and automation

    Add additional resources as your users grow to maintain optimal system performance:

    • Microservices deployment: Get more flexibility and fault tolerance by deploying Rocket.Chat as separate components to manage large user volumes and adapt to dynamic business requirements.

    • Run multiple instances: Utilize your existing hardware to run multiple instances of the Rocket.Chat app on your current host.

    • Automation tools: Streamline the deployment process by using Ansible, OpenShift, Kubernetes with Helm, or Vagrant.

    6. Data migration

    Migrate your existing data from another service using the import integration:

    7. Data monitoring

    Gather and visualize your workspace metrics with the Prometheus and Grafana integrations. Configuring the monitoring setup provides information such as workspace data, subscriptions, REST API details, and more.


    Address common issues during environment configuration:

    Proper environment configuration is crucial for a stable and efficient Rocket.Chat deployment. By following these steps, you can ensure that your Rocket.Chat server is well-configured, secure, and ready for use.

    Was this article helpful?


    Eddy AI, facilitating knowledge discovery through conversational intelligence