Configuring pm2 - wollardj/Mandrill GitHub Wiki

Previous: Install Nginx

Jobs managed by pm2 can be started with a json configuration file. In this example, we're going to create that file in /usr/local/etc/mandrilld.json.


Be sure to change ROOT_URL and PORT to values appropriate for your environment! If you're running a MongoDB instance on another server, or if your MongoDB instance requires authentication, you should change MONGO_URL as well.

One thing you should not change is instances as Mandrill is not currently aware of other instances of itself and will needlessly consume resources.

	"name": "mandrilld",
	"script": "/usr/local/Mandrill/main.js",
	"env": {
		"ROOT_URL": "",
		"PORT": "3001",
		"MONGO_URL": "mongodb://localhost:27017/Mandrill",
		"MANDRILL_MODE": "production"
	"instances": "1",
	"error_file": "/var/log/mandrill/mandrill-err.log",
	"out_file": "/var/log/mandrill/mandrill.log",
	"pid_file": "/var/run/"

The log directory must exist before you start mandrilld for the first time.

sudo mkdir /var/log/mandrill

Next: Configure Nginx Ubuntu | CentOS