Setting up Rocket.Chat in userspace on Ubuntu 12.04

Not too long ago I needed to set up Rocket.Chat for internal evaluation. At the time its installation process was not especially well documented and required some existing knowledge of its underlying stack in order to figure out how to get it running on some of the less supported systems, so there were a few blocks that needed sorting out. After I put together a set of steps for internal use, someone suggested that it might be useful to post externally, so here are the steps I took to get it running as non-root on a Ubuntu 12.04 VM.

Note: At the time of writing Rocket.Chat was in a fairly early stage; these steps will most likely be replaced by far more straightforward installs as it matures and it has already expanded its set of supported environments considerably.

Node install

Rocket.Chat runs on node and I was a little unsure of which particular version I needed. I also wanted to see if it could run without needing root, so I set up nvm first to allow easy switching of node versions and the ability run it as a user account.

First, download and install nvm:

Relog so that the changes take effect.

As I found out later, the version of Meteor used by Rocket.Chat didn’t support later versions, so using nvm I installed node.js 0.10.42:

MongoDB install

For its persistence Rocket.Chat uses MongoDB. Again, to run in user space we need to download and prepare the environment ourselves. Note that this setup runs MongoDB insecurely and these steps need to be modified for an externally visible system.

To later shut down mongodb:

Finally, Rocket.Chat install

Now, install Rocket.Chat:

Set up its environment variables. These will also need to be added to your .bashrc or similar profile in order to have them next time you login:

Now we should be good to go

Initially I tried to install later versions (v4 and v5) of Node.js before I realised that they weren’t supported. I had some issues that came up, so while the current version of Rocket.Chat doesn’t use these versions it’s worth noting that on Ubuntu 12.04 you need to update gcc and the g++ compilers (v5) (see here for an explanation). This is not necessary for later versions of Ubuntu that should already have them.


This entry was posted in ops, Programming and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *