Install Rocket chat on fresh Ubuntu 18.04 LTS

Hi guys, I’ve been trying to install Rocket chat on clean server running fresh image of Ubuntu 18.04 LTS following

sudo apt-get update
sudo apt install g++ build-essential git curl python-minimal
curl | sh
git clone
cd Rocket.Chat
meteor npm install
meteor npm start

Last command ended with:

rocketchat@localhost:~/Rocket.Chat$ meteor npm start

> Rocket.Chat@3.1.0-develop start /home/rocketchat/Rocket.Chat
> meteor

[[[[[ ~/Rocket.Chat ]]]]]                                                          

=> Started proxy.                             
=> Meteor 1.10.1 is available. Update this project with 'meteor update'.
=> Started MongoDB.                                                                
Unexpected mongo exit code 14. Restarting.    
					return fn.apply(this, arguments);

Error: spawn ENOMEM
    at ChildProcess.spawn (internal/child_process.js:407:11)
    at Object.spawn (child_process.js:548:9)
    at spawnMongod (/tools/runners/run-mongo.js:75:24)
    at launchOneMongoAndWaitForReadyForInitiate (/tools/runners/run-mongo.js:510:12)
    at launchMongo (/tools/runners/run-mongo.js:740:7)
    at MongoRunner._startOrRestart (/tools/runners/run-mongo.js:847:19)
    at Timeout.<anonymous> (/tools/runners/run-mongo.js:914:14)
    at runWithEnvironment (/tools/utils/fiber-helpers.js:120:21) {
  errno: 'ENOMEM',
  code: 'ENOMEM',
  syscall: 'spawn'
npm ERR! errno 1
npm ERR! Rocket.Chat@3.1.0-develop start: `meteor`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Rocket.Chat@3.1.0-develop start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rocketchat/.npm/_logs/2020-03-30T18_50_53_221Z-debug.log

Thanks for any suggestions

In production I plan to use my own repo link with my customisations and everytime I need to redeploy, I’d just pull the changes, run npm install and npm restart. Does it make sense? I saw different approach described here but that one uses bundle - not the source coide directly.


Do you have 8 GB of memory on the system on which you are building Rocket.Chat? From the third paragraph of the Developer Quick Start:

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.)

I could build it without issue on my system with 8Gb of RAM.

dwayne@localhost:~/Rocket.Chat$ meteor npm start

> Rocket.Chat@3.1.0-develop start /home/dwayne/Rocket.Chat
> meteor

[[[[[ ~/Rocket.Chat ]]]]]

=> Started proxy.
=> Meteor 1.10.1 is available. Update this project with 'meteor update'.
=> Started MongoDB.
Livechat: updating npm dependencies -- uglify-js...
WARNING: npm peer requirements (for juliancwirko:postcss) not installed:
 - postcss@7.0.6 installed, postcss@^6.0.22 needed
 - postcss-load-config@2.0.0 installed, postcss-load-config@^1.2.0 needed

Read more about installing npm peer dependencies:

Browserslist: caniuse-lite is outdated. Please run next command `npm update`
I20200330-23:27:20.376(0)? Setting default file store to GridFS
I20200330-23:27:20.443(0)? LocalStore: store created at
I20200330-23:27:20.444(0)? LocalStore: store created at
I20200330-23:27:20.445(0)? LocalStore: store created at
I20200330-23:27:21.454(0)? Setting default file store to GridFS
I20200330-23:27:29.311(0)? ufs: temp directory created at "/tmp/ufs"
I20200330-23:27:32.114(0)? Loaded the Apps Framework and loaded a total of 0 Apps!
I20200330-23:27:32.592(0)? Updating process.env.MAIL_URL
I20200330-23:27:32.603(0)? Using GridFS for custom sounds storage
I20200330-23:27:32.630(0)? Using GridFS for custom emoji storage
W20200330-23:27:34.277(0)? (STDERR) Browserslist: caniuse-lite is outdated. Please run next command `npm update`
=> Started your app.

=> App running at: http://localhost:3000/
I20200330-23:27:34.994(0)? ➔ System ➔ startup
I20200330-23:27:34.994(0)? ➔ +-----------------------------------------------+
I20200330-23:27:34.995(0)? ➔ |                 SERVER RUNNING                |
I20200330-23:27:34.996(0)? ➔ +-----------------------------------------------+
I20200330-23:27:34.996(0)? ➔ |                                               |
I20200330-23:27:34.997(0)? ➔ |  Rocket.Chat Version: 3.1.0-develop           |
I20200330-23:27:34.997(0)? ➔ |       NodeJS Version: 12.16.1 - x64           |
I20200330-23:27:34.997(0)? ➔ |      MongoDB Version: 4.0.6                   |
I20200330-23:27:34.998(0)? ➔ |       MongoDB Engine: wiredTiger              |
I20200330-23:27:34.998(0)? ➔ |             Platform: linux                   |
I20200330-23:27:34.998(0)? ➔ |         Process Port: 22169                   |
I20200330-23:27:34.998(0)? ➔ |             Site URL: http://localhost:3000/  |
I20200330-23:27:34.999(0)? ➔ |     ReplicaSet OpLog: Enabled                 |
I20200330-23:27:34.999(0)? ➔ |          Commit Hash: b0c2cbb2d8              |
I20200330-23:27:34.999(0)? ➔ |        Commit Branch: develop                 |
I20200330-23:27:34.999(0)? ➔ |                                               |
I20200330-23:27:35.000(0)? ➔ +-----------------------------------------------+

Thanks a lot dwaynem. I don’t have 8GB on the server, sorry I was hoping that was meant more as a recommendation.

So to run it on less memory shall I process with steps here?

But how do I create my custom build, from my own forked repo? Replacing this part of the process:

curl -L -o /tmp/

How do I create such build / tarball from my repo?

Thanks again

If you don’t have 8GB of RAM, you can add or increase the amount of swap space on your system so that RAM + swap space is 8GB.