You can run Rocket.Chat for development on a Linux machine or VM. The following instruction has been tested on a new Ubuntu 18.04 LTS installation. Try to find and use a NEW Ubuntu server installation with no other un-necessary software installed, not a "Desktop" or "Client" installation.
DO NOT use a system where you already have nodeJS installed to avoid problems.
During the build, memory usage will be nearly 8G, this is the minimum level of RAM recommended for development workstations. (If you are not doing any development, and just deploying a Rocket.Chat server - the RAM required can be as low as 1G.)
IMPORTANT: Note that there is no need to install mongo, nodejs, or npm on the base operating system. If you have any of these already installed; start over, or use another CLEAN system.
Development should be performed under a regular user account (not root) on Linux. There should be no need to run sudo at all. Running sudo, even once, during the installation -- may mess up file permissions in irreversible manner.
You may notice build WARNINGs related to peer dependencies or other transitive dependencies. They are typically safe to ignore unless you are coding the feature or modules that require them.
-
Install tools required
sudo apt install g++ build-essential git curl python2-minimal
``(If you are using other OS (like Ubuntu 20.04 etc) you may run into an error "python-minimal has no installation candidate") To resolve this check out this thread on Stackoverflow. -
Install meteor
curl https://install.meteor.com/ | sh -
Get rocket.chat code
git clone https://github.com/RocketChat/Rocket.Chat.git(you may want to fork the code on Github first, and then clone your fork)
-
Change current working directory to the cloned repo location
-
Run
meteor --version, this will download the necessary meteor version for Rocket.Chat, as configured in.meteor/releasefile. -
Install modules
yarn -
Start building (the first build can take 10 or more minutes, and you may see various warnings or minor errors -- please be patient; subsequent dev builds after the first will be 5 minutes or less)
yarn build yarn dev # it will build the sub projects and then run meteor project
The code is spread through the folders, packages/ and apps/meteor, the latter contains the vast majority of the project's code.
When the server is ready, you will see a box with "Server Running" title:
This means that a Rocket.Chat server is running from your computer. To access the server, navigate to
http://localhost:3000
Other references:
Editing files is relatively simple. After you run git clone, the files from the repository are saved on your computer. You can go to the cloned repository folder and edit or add files to Rocket.Chat. When you make changes to Rocket.Chat the server will automatically rebuild.
Sometimes changes can shut down the server, if that happens just run meteor or meteor npm start again.
The Rocket.Chat code base is very large. You may need to increase this system parameter on your operating system for the files-change watcher to operate efficiently.
.png)