How to Install Rocket.Chat on Your Synology NAS

How to Install Rocket.Chat on Your Synology NAS

Rocket.Chat is a fully customizable communications platform for organizations with high standards of data protection. It enables real-time conversations between colleagues, with other companies or with your customers, regardless of how they connect with you. In this step by step guide I will show you how to install Rocket.Chat on your Synology NAS using Docker & Portainer.

Note: This guide works perfectly with the latest Rocket.Chat 4.7.2 release.

WARNING: Rocket.Chat is evolving and MongoDB 4.0 will be deprecated. MongoDB 5 requires a CPU with AVX support.
Unsupported NAS Models (that don’t support MongoDB 5): DS218+ DS718+ DS220+ DS720+ DS920+ and older consumer models. You can always run Rocket.Chat with an older mongo version, but there is no guarantee that Rocket.Chat will continue to work with older Mongo versions. To install Rocket.Chat with MongoDB 4 in unsupported NAS models, read the “Warning” note at STEP 10.
Supported NAS Models (that support MongoDB 5): All NAS models from the 21+ and 22+ series.
Note: It’s a possibility that older NAS devices have AVX support. Check your NAS CPU to see if it supports AVX.
What is MongoDB? MongoDB is a database. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

Install Portainer using my step by step guide. If you already have Portainer installed on your Synology NAS, skip this STEP.

  • STEP 3

Make sure you have a synology.me Wildcard Certificate. Follow my guide to get a Wildcard Certificate. If you already have a synology.me Wildcard certificate, skip this STEP.

  • STEP 4

Go to Control Panel / Login Portal / Advanced Tab / click Reverse Proxy. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 1

  • STEP 5

Now click the “Create” button. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 2

  • STEP 6

After you click the Create button, the window below will open. Follow the instructions in the image below.

On the General area, set the Reverse Proxy Name description: type in rocketchat. After that, add the following instructions:

Source:
Protocol: HTTPS
Hostname: rocketchat.yourname.synology.me
Port: 443

Destination:
Protocol: HTTP
Hostname: localhost
Port: 3111

Rocket.Chat Synology NAS Set up 3

  • STEP 6 B

On the Reverse Proxy Rules click the Custom Header tab. Click Create and then, from the drop-down menu, click WebSocket. After you click on WebSocket, two Header Names and two Values will be automatically added. Click Save. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up websocket

  • STEP 7

Go to Control Panel / Network / Connectivity / Check Enable HTTP/2 then click Apply. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 4

  • STEP 8

Go to File Station and open the docker folder. Inside the docker folder, create two new folders and name one rocketdb and the other one rocketup. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

Rocket.Chat Synology NAS Set up 5

  • STEP 9

Log into Portainer using your username and password. On the left sidebar in Portainer, click on Stacks then + Add stack. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 5.2

  • STEP 10

In the Name field type in rocketchat. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

version: '3'

services:
  rocketchat:
    image: rocketchat/rocket.chat:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          node main.js &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"
    restart: always
    volumes:
      - /volume1/docker/rocketup:/app/uploads
    environment:
      - PORT=3000
      - ROOT_URL=https://rocketchat.yourname.synology.me
      - MONGO_URL=mongodb://mongo:27017/rocketchat
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local
      - MAIL_URL=smtp://smtp.email
    depends_on:
      - mongo
    ports:
      - 3111:3000
  mongo:
    image: mongo:5
    restart: always
    volumes:
     - /volume1/docker/rocketdb:/data/db
    command: mongod --oplogSize 128 --replSet rs0
  mongo-init-replica:
    image: mongo:5
    restart: always
    command: >
      bash -c
        "for i in `seq 1 30`; do 
            mongo mongo/rocketchat --eval \"
            rs.initiate({
              _id: 'rs0',
              members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"
    depends_on:
      - mongo

Note: Before you paste the code above in the Web editor area, change the value for ROOT_URL and add your own synology.me wildcard that you have set up at STEP 6. In the code above don’t forget to add https:// before rocketchat.yourname.synology.me
Warning: If your NAS CPU does not have the AVX support, you should use this stack code instead of the one above.

Rocket.Chat Synology NAS Set up 6

  • STEP 11

Scroll down on the page until you see a button named Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

Rocket.Chat Synology NAS Set up 7

  • STEP 12 A

If everything goes right, you will see the following message at the top right of your screen: “Stack successfully deployed“.

Rocket.Chat Synology NAS Set up 8

  • STEP 12 B

On the Portainer left sidebar click Containers then, check the “rocketchat_mongo-init-replica1” container and click the Remove tab. Follow the instructions in the image below.

Rocket Chat Synology NAS Set up 9b new1

  • STEP 12 C

A new pop up window will open click Remove. Follow the instructions in the image below.

Rocket Chat Synology NAS Set up 9c new2

  • STEP 13

Go back to STEP 1 or you will deal with karma 🙂.

  • STEP 14

Now open your browser and type in your HTTPS/SSL certificate like this https://rocketchat.yourname.synology.me In my case it’s https://rocketchat.mariushosting.synology.me If everything goes right, you will see the rocket.chat installation page. Add your own First and last name, your own Username, your own Email and your own Password then click Next. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 9

  • STEP 15

Add your own Organization Info then click Next. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 10

  • STEP 16

Add your own email then check “I agree with Terms and Conditions and Privacy Policy” Click Continue as standalone. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 11

  • STEP 17

Click Confirm. After you click confirm, know that the page will be stuck due to a bug. Just open a new browser then open your https://rocketchat.yourname.synology.me again.

Rocket.Chat Synology NAS Set up 12

  • STEP 18

Add your own Username and Password you have chosen at STEP 14 then click Login. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 13

  • STEP 19

Due to a bug you will be asked for your Organization Info again. Add the Organization Info then click Next. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 13-1

  • STEP 20

Add your own email then check “I agree with Terms and Conditions and Privacy Policy” Click Continue as standalone. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 13-2

  • STEP 21

Click Confirm. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 13-3

  • STEP 22

If everything goes right, you will see the following message at the top right of your screen: “Your workspace is ready to use“.

Rocket.Chat Synology NAS Set up 14

  • STEP 23

Change the Username with one you like then click Use this username. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 15

  • STEP 24

Activate WebSocket.

Enjoy Rocket.Chat on your Synology NAS!

Rocket.Chat Synology NAS Set up 16

Troubleshooting: Make sure Rule 5 is correctly applied on your Synology NAS Firewall configuration.

Note: Find out how to update the Rocket.Chat container with the latest image.
Note: Can I run Docker on my Synology NAS? See the supported models.
Note: How to Free Disk Space on Your NAS if You Run Docker.
Note: How to Schedule Start & Stop For Docker Containers.
Note: How to Activate Email Notifications.
Note: How to Add Access Control Profile on Your NAS.
Note: How to Change Docker Containers Restart Policy.
Note: How to Use Docker Containers With VPN.
Note: Convert Docker Run Into Docker Compose.
Note: How to Clean Docker.
Note: Some Docker Containers Need WebSocket.

This post was updated on Saturday / May 21st, 2022 at 10:43 PM