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 5.4.2 release.

WARNING: Rocket.Chat is evolving and MongoDB 4.0 will be deprecated. MongoDB 6 requires a CPU with AVX support.
Unsupported NAS Models (that don’t support MongoDB 6): 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 17. Remember, there is no guarantee that rocketchat will work with older NAS models. After running extensive tests it has resulted that only the 18+ series NAS works with the older MongoDB 4. The NAS models that DO NOT support Rocket.Chat at all due to hardware limitations are the 20+ series like the DS220+DS720+DS920+, DS1520+.
Supported NAS Models (that support MongoDB 6): All NAS models from the 21+22+, 23+ 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. Attention: Make sure you have installed the latest Portainer version.

  • 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

Check Enable HSTS

Destination:
Protocol: HTTP
Hostname: localhost
Port: 3111

Rocket.Chat Synology NAS Set up 3 new

  • STEP 7

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.

Synology Proxy WebSocket

  • STEP 8

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

Rocket.Chat Synology NAS Set up 4

  • STEP 9

Go to Control Panel / Security / Advanced tab/ Check Enable HTTP Compression then click Apply. Follow the instructions in the image below.

Rocket.Chat Synology HTTP Compression

  • STEP 10

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 11

Right click on the rocketdb folder that you have previously created at STEP 10 then click Properties. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 6 2023

  • STEP 12

Go to the Permission tab then click Advanced options. From the drop-down menu choose “Make inherited permissions explicit“. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 7 2023

  • STEP 13

Select Everyone then click the Edit tab. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 8 2023

  • STEP 14

Check all Read and Write Permissions. Click Done. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 9 2023

  • STEP 15

After you click Done on STEP 14, check “Apply to this folder, sub-folders and files“. Click Save. Follow the instructions in the image below.

Rocket.Chat Synology NAS Set up 10 2023

  • STEP 16

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.

1 Synology Portainer Add Stack

  • STEP 17

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.9'
services:
  db:
    image: docker.io/bitnami/mongodb:6.0
    container_name: RocketChat-DB
    hostname: rocketchat-db
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 20s
    environment:
      MONGODB_REPLICA_SET_MODE: primary
      MONGODB_REPLICA_SET_NAME: rs0
      ALLOW_EMPTY_PASSWORD: 1
    volumes:
      - /volume1/docker/rocketdb:/bitnami/mongodb
    restart: always

  rocketchat:
    image: rocketchat/rocket.chat:latest
    container_name: RocketChat
    hostname: rocketchat
    security_opt:
      - no-new-privileges:true
    environment:
      MONGO_URL: mongodb://rocketchat-db:27017/rocketchat?replicaSet=rs0
      MONGO_OPLOG_URL: mongodb://rocketchat-db:27017/local?replicaSet=rs0
      ROOT_URL: https://rocketchat.yourname.synology.me
      PORT: 3000
      DEPLOY_METHOD: docker
    volumes:
      - /volume1/docker/rocketup:/app/uploads
    ports:
      - 3111:3000
    restart: always
    depends_on:
      db:
        condition: service_healthy

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: As I explained at the beginning of this article, if your NAS CPU does not have AVX support, in the code above type in mongodb:4.0 instead of mongodb:6.0 After running extensive tests it has resulted that only the 18+ series NAS works with the older MongoDB 4. The NAS models that DO NOT support Rocket.Chat at all due to hardware limitations are the 20+ series like the DS220+DS720+DS920+, DS1520+.

Rocket.Chat Synology NAS Set up 11 2023 new

  • STEP 18

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 12 2023

  • STEP 19

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

Rocket.Chat Synology NAS Set up 13 2023

  • STEP 20

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

  • STEP 21

Please wait approximately 5 minutes for the installation to be completed or you will get a Synology blank page if you try to connect too soon. 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 22

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

Rocket.Chat Synology NAS Set up 10

  • STEP 23

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 24

Click Confirm. Follow the instructions in the image below

Rocket.Chat Synology NAS Set up 12

  • STEP 25

Enjoy Rocket.Chat on your Synology NAS!

Rocket.Chat Synology NAS Set up 14 2023

Troubleshooting: If you experience connection issues with Rocket.Chat, make sure Rule 5 and Rule 6 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: How to Clean Docker Automatically.
Note: Best Practices When Using Docker and DDNS.
Note: Some Docker Containers Need WebSocket.
Note: Find out the Best NAS Models For Docker.
Note: Activate Gmail SMTP For Docker Containers.

This post was updated on Saturday / January 28th, 2023 at 3:38 AM