Setting up a Rocket.Chat development environment allows you to contribute to the platform’s development. This document will walk you through the essential steps to get your development environment up and running efficiently on Windows and Linux.
Prerequisites
At least 12GB RAM is required for building in a development environment. For deployment and other uses, 2GB RAM suffices
Use a standard user account (not root) for setup. Avoid using sudo to prevent potential file permission issues
The sample Linux distribution for this guide is Ubuntu. However, the steps are similar for other Linux distributions.
Software requirements
Windows 10, version 2004 or above
Install and configure WSL 2 following the Microsoft documentation. The default Linux distribution to be installed is Ubuntu.
Download and install the latest Linux kernel updates
Install nvm to manage your Node.js version
Machine requirements
To set up Rocket.Chat development environment, you'll require a Windows machine that meets the following minimum specifications:
12 GB of RAM (16+ GB highly recommended)
Four or more cores on CPU (at least 3 GHz boosted, 4.2 GHz or higher recommended)
80 GB of available fast SSD storage (PCIe 4.0 NVMe SSD recommended)
All the steps for the Windows development environment must be performed within the Ubuntu WSL 2 shell.
Open Ubuntu shell on your Windows or Linux environment and update the distro by running this command:
sudo apt update && sudo apt dist-upgrade -yInstall the required build tools:
sudo apt install git curl unzip make build-essential python3 g++Fork the Rocket.Chat repository on GitHub.
From your home directory (~), clone the forked repository:
git clone https://github.com/<your-username>/Rocket.Chat.git
All steps below must be executed from the Rocket.Chat root folder. Navigate to root folder:
cd Rocket.Chat
Step 1: Setting up Node.js and Yarn
Navigate to the Rocket.Chat root folder and confirm the Node.js version required by your RocketChat project:
cd Rocket.Chat cat package.json | grep -A4 engines | grep nodeInstall that Node.js version with nvm, replacing
x.x.xwith the version from the previous step:nvm install x.x.xVerify the installed version:
node -vInstall Yarn:
npm install -g yarnAfter installation, you can verify Yarn's version with:
yarn --version
Step 2: Setting up Deno
Confirm the Deno version required by your RocketChat project:
cat .tool-versions | grep denoInstall the required Deno version, replacing
x.x.xwith the version from the previous step:curl -fsSL https://deno.land/install.sh | sh -s vx.x.xFor example:
curl -fsSL https://deno.land/install.sh | sh -s v1.37.1For alternative installation methods, check the official Deno installation documentation.
Reload the shell so the updated PATH is available.
Confirm you have the correct version installed by running:
deno --version
Step 3: Installing Meteor
Rocket.Chat pins its Meteor version in the .meteor/release file.
Navigate to the Rocket.Chat directory and confirm the Meteor version required by your Rocket.Chat project:
cd Rocket.Chat cat apps/meteor/.meteor/releaseInstall Meteor, replacing
x.x.xwith the version from the previous step:curl https://install.meteor.com/\?release\=x.x | shAfter installation, verify the version:
meteor --versionYou should see the installed version displayed in your terminal.
Step 4: Run the Rocket.Chat project
The commands in this step must be run from the Rocket.Chat root folder. Otherwise, MongoDB will not start.
Install all the dependencies:
yarnWhen completed, build and run the server by executing this command:
yarn dsvThe first build can take ten or more minutes. Subsequent dev builds will take lesser time.
During the build, you may notice warnings about peer or transitive dependencies. These are typically safe to ignore unless you are developing the specific features or modules that require them
A successful running server will open up port
3000on your machine where you can access Rocket.Chat using any browser or the Rocket.Chat client app throughhttp://localhost:3000.
Step 5: Edit Rocket.Chat files
The recommended IDE is Visual Studio Code.
To edit Rocket.Chat files,
Launch your IDE and open the cloned repository folder in your IDE
When you make changes to Rocket.Chat the server will automatically rebuild
Sometimes, changes can shut down the server. If that happens, run
yarn dsvagain
References
If you encounter any issues during the setup, refer to the development environment troubleshooting guide for assistance.
Now that your development server is running, you can contribute to the Rocket.Chat server! See participate in Rocket.Chat development to learn more about Rocket.Chat contributions.