FreeBSD

Deploying Rocket.Chat on FreeBSD

Note: This is a community supported installation method. You can discuss about this in the forum threadarrow-up-right.

Prerequisites

Valid for:

  • FreeBSD 10.3-RELEASE

(64bit, meteor's development scripts will not compile under 32bit)

Please use a fresh system without traces of node or npm. Most of my initial problems came from old and/or special versions of node/npm/meteor

Packages

You need to install the following packages either as root or via sudo:

$ sudo pkg install git scons python gcc48 gmake npm bash wget

Also install mongodb if you will be running the database setup on this server as well.

If you get the following output:

The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]:

It's just because the pkg-ng binary package system have not been setup / bootstraped yet. Simply choose yes (y) here. And press enter.

Installing pm2

We need pm2 later to daemonize or Rocket.Chat build.

Now, install pm2:

Add user for Rocket.Chat

This user will be the one used for running Rocket.Chat server.

Be sure to save the password somewhere safe if you will need to login as the Rocket.Chat user in the future.

Switch to the newly created user

(Or what ever username you picked).

Building the dev_bundle

Setting up the environment

Set some environment Variables to make the build work under FreeBSD:

MAKE_CMD=gmake is important, because meteor requires GNU make to build. The fork we will be building lets us set MAKE_CMD so we don't have to do nasty stuff to our BSD make.

Building meteor

We need a fork of meteor which allows us to set MAKE_CMD as mentioned before:

Meteor comes with scripts to build it:

(These commands might take a long time to run depending on your hardware)

After compiling the development bundles above test out the meteor setup

This should give you output:

This should output no errors (Also version numbers might change).

Troubleshooting

That should run without problems. If you run into issues check the following:

  • is the Environment setup right?

  • Are the scripts running in bash?

  • do I have gmake installed?

Running Rocket.Chat

First, we need the meteor binary in our $PATH

Next, we need to download Rocket.Chat:

We need to install bcrypt separately.

After that: Go ahead and start Rocket.Chat!

The first launch of Rocket.Chat might take some time as its installing dependencies. If all goes well you would see output like this:

If you would like to have the Rocket.Chat daemon running while signed out. You could use tmux to keep it running.

Install tmux (optional)

Start a tmux session and run Rocket.Chat

This will run Rocket.Chat inside a tmux session allowing you to disconnect from the terminal and let the daemon running.

  • Press ctrl+b d to exit the tmux session.

  • And use tmux a to access the session again.

To read more about using tmux see this page:

http://man.openbsd.org/OpenBSD-current/man1/tmux.1arrow-up-right

Or look up one of the many tmux guides online.

Troubleshooting tmux

If you run into any troubles with bcrypt, try this: cp -R ~/meteor/packages/non-core/npm-bcrypt ~/Rocket.Chat/packages/*

If you run into problems with fibers check your node and npm version. Then try to build it again.

Notes

  • This guide is tested in a FreeBSD 10.3-RELEASE jail.

  • Ensure you don't expose the mongoDB instance to the internet without setting up security for it!

Thanks

  • Filias Heidt

  • Matt Olander

  • William Grzybowski

  • Cory Smelosky

  • Sing Li

Last updated