(Rocket.Chat Tutorial) Can't get forever-service working

June 7, 2017 2.5k views
DigitalOcean Articles Ubuntu

I've been following this tutorial for getting Rocket.Chat running and the only problem I have is getting rocket.chat as a service.


This is the command I entered into the terminal. I made sure I was in the /Rocket.Chat directory.

sudo forever-service install -s main.js -e "ROOT_URL=https://xxx/ MONGO_URL=mongodb://localhost:27017/rocketchat PORT=3000" rocketchat

(I x'd out the domain name because I don't want it public.)

After I run that command I get this:

forever-service version 0.5.9

Platform - Ubuntu 14.04.5 LTS
runuserpath not found
 Adding system startup for /etc/init.d/rocketchat ...
   /etc/rc0.d/K20rocketchat -> ../init.d/rocketchat
   /etc/rc1.d/K20rocketchat -> ../init.d/rocketchat
   /etc/rc6.d/K20rocketchat -> ../init.d/rocketchat
   /etc/rc2.d/S20rocketchat -> ../init.d/rocketchat
   /etc/rc3.d/S20rocketchat -> ../init.d/rocketchat
   /etc/rc4.d/S20rocketchat -> ../init.d/rocketchat
   /etc/rc5.d/S20rocketchat -> ../init.d/rocketchat
rocketchat provisioned successfully

Commands to interact with service rocketchat
Start   - "sudo service rocketchat start"
Stop    - "sudo service rocketchat stop"
Status  - "sudo service rocketchat status"
Restart - "sudo service rocketchat restart"

After that I ran this command:

sudo service rocketchat start

And this is the output I get:

Starting rocketchat

When I go to my Rocket Chat url, it isn't running at all. If I stop the service and run "node main.js" in /Rocket.Chat the service will run normally.

Does anyone know what the problem is? Thank you!

1 Answer
by Brennen Bearnes
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.
  • @matthew6d @hansen

    I'd recommend PM2 as well.

    That said, on Ubuntu, there's a service called snap that actually simplifies the installation. If you disable everything else, you can simply run:

    snap install rocketchat-server

    And it'll install Rocket.Chat for you and maintain it. Normally, I disable that service, though when it comes to Rocket.Chat, snap is actually pretty handy.



    • So I would have to uninstall rocket chat all together and reinstall it with snap?

      • @matthew6d

        I would, just in case is listens on the same port that you're trying to run your instance on. At the very least, stop your instance and test with snap. If it works for you, then remove your other instance :-).

Have another answer? Share your knowledge.