User Guide
6.4
6.4
  • Rocket.Chat
    • Our Plans
  • Deploy
    • Deploy Rocket.Chat
      • System Requirements
      • Deploy with Docker & Docker Compose
      • Deploy with AWS
      • Deploy with Snaps
      • Updating Rocket.Chat
      • Scaling Rocket.Chat
        • Microservices
        • Running Multiple Instances
        • Automation Tools
          • Ansible
          • OpenShift
          • Vagrant
      • Additional Deployment Methods
        • Deploy with Kubernetes
        • Deploy with Digital Ocean
        • Deploy on Google Compute Engine
        • Deploy with Ubuntu
        • Deploy with CentOS
        • Deploy on Kali
        • Deploy on Debian
        • Deploy on IBM Cloud
        • Deploy on Windows 10
        • Plug-in Deployments
        • Unsupported Methods
          • OpenSUSE Leap 42.2
          • FreeBSD
            • Deploying Rocket.Chat Server Binaries on a FreeBSD system
          • Windows Server
          • Linode
          • Scalingo
          • Cloudron.io
          • Jelastic
          • Aliyun
          • Galaxy
          • Syncloud
          • OpenShift
  • Setup and Configure
    • Environment Configuration
      • Deployment Environment Variables
        • Manage Settings Using Environmental Variables
      • MongoDB Configuration
        • MongoDB URI Authentication
        • MongoDB Backup and Restore
        • Additional MongoDB Driver Options
        • Configure a Replica Set for MongoDB
        • Migrate from Built-In Meteor MongoDB to External Server
        • Migrate from mmap to WiredTiger Storage Engine
        • Supported MongoDB Versions
      • Firewall Configuration
      • Configuring SSL Reverse Proxy
      • Additional Configurations
        • Running in a sub folder with Apache
        • Univention Corporate Server (UCS)
        • Setting Up Client SSL Certificate Authentication for Rocket.Chat
        • Setting up Process Managers and Init Systems
      • Check Node.js Version
    • Installing Client Apps
      • Desktop & Mobile Apps
      • Minimum Requirements for Client Apps
    • Trials
      • Pro Trial
      • Enterprise Trial
    • License Application
    • Accessing Your Workspace
      • Rocket.Chat Setup Wizard
      • Admin Account Creation
      • Basic White-labeling
      • Inviting Users
    • Advanced workspace management
      • Google Translate Integration
      • Database Migration
      • Restoring an Admin User
      • CDN
      • Troubleshooting
      • Client Compatibility Matrix
    • Rocket.Chat Air-gapped Deployment
      • Offline Workspace Registration
      • Offline License
      • Air-gapped workspace Configuration
      • Air-gapped App Installation
    • Roles in Rocket.Chat
  • Use Rocket.Chat
    • User Guides
      • Access your workspace
      • Main Menu
      • User Panel
        • Account
        • Accessibility and appearance
        • Manage Devices
      • Rooms
        • Channels
          • Create a new Channel
          • Edit A Channel
          • Manage Channel Members
          • Search Messages in a Channel
        • Teams
          • Create a new Team
          • Edit a Team
          • Manage Team Members
          • Manage Team Channels
          • Teams Premium Plan
        • Discussions
          • Create a new Discussion
          • Edit A Discussion
          • Search Messages in Discussion
          • Manage Discussion Members
        • Direct Messages
          • Create a new Direct Message
          • Direct Message Actions
        • Threads
          • Create a New Thread
        • Room Roles
      • Messages
        • Message Actions
        • Off-the-record (OTR) Messaging User Guide
      • Notifications
      • Security Bundle
        • Data Loss Prevention User Guide
        • End to End Encryption User Guide
        • Two Factor Authentication User Guide
      • Keyboard Shortcuts
    • Workspace Administration
      • Workspace
      • Subscription
      • Registration
      • Engagement
      • Moderation
      • Federation
      • Rooms
      • Users
        • Guest Users
        • Monthly Active Contacts (MACs)
        • Add users through Identity management and authentication services
      • Invites
      • User Status
      • Permissions
        • Setting's Permission
      • Device Management
      • Email Inboxes
      • Mailer
      • Third-party Login
      • Integrations
        • AppVeyor
        • Azure Alerts
        • BitRocket
        • Dead Simple Screen Sharing
        • EasyRedmine
        • Giphy Integrations
        • GitLab
        • Google Calendar
        • GitHub
        • Graylog
        • Jenkins notifications via Rocket.Chat Marketplace
        • JFrog Xray
        • MicroBadger
        • Microsoft Teams
        • NewRelic
        • Nextcloud and WebDAV integrations
        • Nextcloud Rocket.Chat App
        • Nixstats notification
        • PagerDuty
        • Prometheus
        • Grafana
        • Review Board
        • RunDeck Job Notifications
        • Sentry
        • Simple Telegram Bot
        • TravisCI
        • Uptime Robot
        • Zapier
        • django-rocketchat-auth 1.2
        • Add Jira notifications via webhook
      • Import
        • Import from HipChat
        • Import from Slack
          • SlackBridge
        • Import CSV
      • Reports
      • Sounds
      • Emoji
      • Settings
        • Accounts
          • Custom Fields
        • Analytics
        • Assets
        • Bots
        • CAS
        • Conference Call
        • Custom Emoji Filesystem
        • Custom Sound Filesystem
        • Discussion
        • E2E Encryption
        • Email
          • Edit your Email Content
          • Direct email reply
          • Email configuration
        • Federation
          • Matrix Bridge
            • Matrix Admin Guide
              • Matrix Homeserver Setup
                • Matrix Allow/Block List
              • Matrix Bridge Configuration
            • Matrix User's Guide
              • Create federated rooms
              • Invite external users to your Rocket.Chat server
              • Communicate with a federated user
              • Search and join public channels on the Matrix network
              • Assign roles for users in federated rooms
            • Matrix Bridge FAQs
          • Rocket.Chat Basic Federation
            • Cross-server Federated Channels
        • File Upload
          • Minio
          • Recommendations for File Upload
          • File Upload FAQs
        • General
          • Net Promoter Score (NPS) survey
        • IRC Federation
        • Layout
        • LDAP
        • Logs
        • Message
        • Meta
        • Mobile
        • Omnichannel Admin's Guide
          • Queue Types (Routing Algorithm)
        • OTR
        • Outlook Calendar
        • Premium
        • Push
        • Rate Limiter
        • Retention Policy
        • SAML
        • Page
        • Search
        • Setup Wizard
        • SlackBridge
        • Smarsh
        • SMS
        • Threads
        • Troubleshoot
        • User Data Download
        • Voice Channel
        • Webdav Integration
        • WebRTC
        • OAuth
        • Device Management
    • Authentication
      • Authentication Across Plans
      • LDAP
        • Configure LDAP Connection
        • LDAP User Search
        • LDAP Data Sync Settings
        • LDAP Premium Settings
        • LDAP Setup
      • SAML
        • SAML Configuration
        • Active Directory Federation Services
        • Keycloak
      • OAuth
        • Facebook OAuth Setup
        • Google OAuth Setup
        • GitLab OAuth Setup
        • GitHub OAuth Setup
        • LinkedIn OAuth Setup
        • Nextcloud OAuth Setup
        • WordPress OAuth Setup
        • MS Office 365 Custom OAuth Setup
        • Additional OAuth Methods
      • OpenID Connect
        • Keycloak
        • Okta Identity Cloud Service
      • Iframe-based Single Sign-On
    • User Management
      • Custom Roles
      • Device Manager
        • Device Management Settings
      • Message Auditor
        • Audit Edits, Deletions, and Encrypted Communications
        • Audit Logs
    • Omnichannel
      • Current Chats
      • Omnichannel Reports
      • Analytics
      • Real-time Monitoring
      • Managers
      • Agents
      • Departments
      • Custom Fields
      • Livechat Triggers
      • Livechat Widget Installation
      • Livechat Widget Appearance
      • Webhooks
      • Business Hours
      • Monitors
      • Units
      • Canned Responses
        • Canned Responses Omnichannel Manager's Guide
      • Tags
      • SLA Policies
      • Priorities
    • Rocket.Chat Cloud
      • Create your new cloud account
      • Manage your cloud account
        • Custom domain for your Cloud-hosted workspace
        • Profile
        • Organization Settings
        • Workspaces
        • Invoices
        • Payment Methods
        • Security
        • Support
        • Contact Sales
    • Rocket.Chat Voice Channel
      • Getting Started with Voice Channel
      • Voice Channel Admin Guide
        • Configure without previously having a PBX server
          • SIP Extensions
          • Configure asterisk manager interface and users
        • Configure with an active PBX server
          • Associate agents with extensions in Rocket.Chat
      • Voice Channel Technical Specification
      • Voice Channel Agent Guides
        • How to make myself available to accept calls?
        • How to take a call in Rocket.Chat voice channel?
        • How to initiate an outbound call as an agent?
      • Voice Channel FAQs
    • Rocket.Chat Conference Call
      • Conference Call Admin Guide
        • Pexip app
        • Jitsi app
        • BigBlueButton (BBB) app
        • Google Meet app
      • Conference Call User's Guide
      • Omnichannel Video/Audio Call Configuration
    • Rocket.Chat Federation
    • Rocket.Chat Mobile
      • Rooms on Rocket.Chat Mobile
      • Messages and Threads on Mobile
      • Push Notifications
        • Secured Push Notification
        • Push Notifications User Guide
    • Omnichannel Agent's Guides
      • Omnichannel Conversation
      • Omnichannel Queue
      • Omnichannel Contact Center
        • Omnichannel Contact Manager Assignment
      • Email Inboxes
  • Extend Rocket.Chat Capabilities
    • Rocket.Chat Marketplace
      • Rocket.Chat Public Apps Guides
        • Omnichannel Apps
          • SMS
          • Telegram App
            • Telegram Agent's Guide
          • Rasa App
          • Salesforce CRM Integration
            • Salesforce CRM Agent's Guide
          • HubSpot CRM
            • HubSpot CRM Agent's Guide
          • Dialogflow App
            • Upload File To Ongoing Dialogflow Chats
          • Twitter App
            • Twitter App Agent's Guide
          • Facebook App
            • Facebook App Agent's Guide
          • WhatsApp
            • WhatsApp Agent's Guide
          • WhatsApp Sandbox
            • WhatsApp Sandbox Agent's Guide
          • Instagram Direct
            • Instagram Direct Agent's Guide
          • WhatsApp Cloud App
            • Configure Whatsapp Cloud App
            • Using WhatsApp Cloud App
        • Atlassian Apps
          • Jira Server v2.0
          • Bamboo Integration
          • Bitbucket Server
          • Confluence Server
          • Jira Server
        • Pexip App
        • Jitsi app
        • BigBlueButton (BBB) app
        • Google Meet app
        • Trello
          • Using the Trello App
        • Zoom
          • Using the Zoom App
        • Data Loss Prevention (DLP) App
        • Poll
        • Poll Plus
          • Poll Plus Features
        • Microsoft Teams Bridge
          • Using Microsoft Teams Bridge
        • GitHub App
          • Using GitHub App
        • Google Drive
          • Using the Google Drive App
        • Google Calendar
          • Using the Google Calendar App
        • Zapier App
          • Install Zapier App
          • Using Zapier App
        • ChatGPT App
          • Using the ChatGPT App
        • Mod Assist App
          • Using the Mod Assist App
        • ClamAV Integration
      • App Storage Location
    • Integrations
    • Rocket.Chat API
  • Resources
    • Frequently Asked Questions
      • Accessing your workspace FAQs
      • License FAQs
        • Trial FAQ
        • Downgrade behavior
        • Fair use allowance FAQs
      • My Account FAQs
      • Registration
      • Message Privacy
      • Localization
      • Apps FAQs
      • Update FAQs
      • WhatsApp Cloud API FAQs
      • Cloud FAQs
      • Support FAQs
      • Whatsapp Business App FAQs
      • Identity Management FAQ
      • Deployment FAQ
        • Updating Rocket.Chat FAQ
        • Snaps FAQ
      • Federation FAQs
      • Monthly Active Contacts FAQs
      • Omnichannel FAQs
    • Brand and Visual Guidelines
      • Logo
      • Typography
      • Colors
      • Patterns
      • Iconography
      • Photos
      • Brand Usage Examples
      • Media Kit
    • Developer Documentation
    • Glossary
  • Contribute to Rocket.Chat
    • Contributor Code of Conduct
    • How Can I Help?
    • Annual Contribution Programs
  • APPLICABLE TERMS
    • Customer Terms of Service
    • Additional Terms
      • Terms of Use
      • Acceptable Use Policy
      • Service-Specific Terms
        • Master Service Agreement for Professional Services
        • Cloud Services Terms
          • Marketplace and Apps
  • CUSTOMER CENTER
    • Cloud Services Center
      • Rocket.Chat Cloud Hosting Service Level Agreement (SLA)
    • Security Center
      • Security Policy
      • Compliance Resources
      • Security fixes and updates
        • cve-2022-32211
      • End-to-End Encryption Specifications
    • Support Center
      • Premium Support Plans
        • Support Prerequisites and Version Durability
        • Premium Support Channels
        • Our Support Ticket Classification System and SLAs
        • Rocket.Chat Legacy Support
      • Community Resources
    • Legal Center
      • Privacy Policy
        • Subprocessors
        • Privacy Policy Facebook Messenger
        • Privacy Notice for Air-Gapped Workspaces
      • GDPR
        • Data Processing Agreement
      • LGDP
        • Nomeação do Encarregado pelo Tratamento de Dados Pessoais
      • DMCA Policy
      • Accessibility statement
      • Code of Conduct: Services
      • Law Enforcement
        • Guidelines for Law Enforcement
        • Censorship and Harmful Content
        • Server Lookup
      • Historical Agreements and Policy Archive
Powered by GitBook
On this page
  • System Requirements
  • Important warning about the installation
  • Automated Installation
  • Installation Steps
  • Standalone Manual installation
  • Installation Steps
  • Testing your setup
  • Use your own federation-tester
  • Clustered Manual Installation
  • Reset your environment and Restart your setup
  1. Use Rocket.Chat
  2. Workspace Administration
  3. Settings
  4. Federation
  5. Matrix Bridge
  6. Matrix Admin Guide

Matrix Homeserver Setup

PreviousMatrix Admin GuideNextMatrix Allow/Block List

Last updated 1 year ago

Homeservers are key components that hosts user accounts and other data related to communication. It also facilitates communication between users on different servers by relaying messages through a network of matrix servers until it reaches the destination. Rocket.Chat listens to events happening in the homeserver and sends events relayed to other networks.

You can set up your federated Rocket.Chat workspace using any of the following methods:

  • : Install Synapse and Rocket.Chat using a simple setup script.

  • : Manually install and configure your Homeserver with Rocket.Chat.

We recommend using since this comes with some pre-configurations.

System Requirements

  • 8GB of RAM

  • 2CPU

  • 20GB of Storage

  • Ubuntu 20.04

You are required to have a domain available to host your matrix homeserver.

Important warning about the installation

You must be aware of this vital setting before proceeding with the installation.

  • Enabling ephemeral events like user typing indicator can affect the performance of your Matrix Homeserver and Rocket.Chat server for federated communication. This can be enabled by adding the following property in your Application Service configuration file:

de.sorunome.msc2409.push_ephemeral: true
  • Add and enable the following properties to make public rooms visible and searchable on other Matrix networks.

allow_public_rooms_without_auth: true
allow_public_rooms_over_federation: true
  • Following the automated installation enables everything by default and can be disabled by editing the generated configuration at data/matrix/synapse.

Automated Installation

The automated install offers a simple option to install a matrix homeserver pre-configured with Rocket.Chat.

Prerequisites

You are required to have the following on your system before installing.

If you don't have them installed, you can conveniently set them up using Docker's official helper script:

curl -L https://get.docker.com | sh
  • To run Docker commands without using sudo, add the current user to the Docker group and then reboot using the following commands:

sudo usermod -aG docker $USER
sudo reboot
  • A domain pointing to your server's IP.

Installation Steps

  • Open your terminal in any directory of your choice.

bash <(curl -L -s https://go.rocket.chat/i/federation-setup)
  • Follow the instructions provided by the script to configure the workspace:

    • Server's hostname: Add your domain name.

    • Create A domain records pointing to your server's IP address as requested.

      • synapse.<your-domain>

      • element.<your-domain>

      • traefik.<your-domain>

    • Enter your email address. This is used to issue an SSL certificate for your domain.

Update your Rocket.Chat version
RELEASE=<desired version>
  • Start the container by running the following command:

docker compose up -d

Installing with the Automated setup automatically sets the values at Administration > Workspace > Settings > Federation > Matrix Bridge.

Rocket.Chat Matrix setup CLI is coming soon!

Testing the Setup

To test and ensure your Matrix setup is successful,

  • Download and execute the test script in the same directory where the setup was initiated.

bash <(curl -L -s https://go.rocket.chat/i/federation-test)
  • You get a notice about the setup status.

Standalone Manual installation

Prerequisites

If you don't have it installed, you can conveniently set it up using Docker's official helper script:

curl -L https://get.docker.com | sh
  • To run Docker commands without using sudo, add the current user to the Docker group and then reboot using the following commands:

sudo usermod -aG docker $USER
sudo reboot
  • Your domain records and SSL certificates. For example, if your domain is ps-rocketchat.com, you can create subdomains under it like matrix2.ps-rocketchat.com.

Name the subdomains based on your preference.

  • All the generated DNS records pointed to your server's IP address (the same IP address).

Installation Steps

To set up a Matrix Homeserver with Synapse manually,

Replace ps-rocketchat.com and matrix2.ps-rocketchat.com with your domain and subdomain respectively while following this guide.

  • Set up the docker network with this command:

docker network create rocketchat
docker run --rm -e SYNAPSE_SERVER_NAME=ps-rocketchat.com -e SYNAPSE_REPORT_STATS=yes -v $PWD/data:/data matrixdotorg/synapse generate

The homeserver.yaml configuration file is stored in the "data" directory of your current working directory. To start the Synapse Docker, use this command:

docker run --name synapse --network rocketchat -v $PWD/data:/data:rw -d matrixdotorg/synapse
  • Next, set up MongoDB with this command:

docker run --network rocketchat -d     --name "mongodb"     -e ALLOW_EMPTY_PASSWORD=yes -e MONGODB_REPLICA_SET_MODE=primary     -e MONGODB_REPLICA_SET_NAME=rs0 -e MONGODB_PORT_NUMBER=27017     -e MONGODB_INITIAL_PRIMARY_HOST="mongodb" -e MONGODB_INITIAL_PRIMARY_PORT_NUMBER=27017     -e MONGODB_ADVERTISED_HOSTNAME="mongodb" bitnami/mongodb:5.0
  • To start Rocket.Chat , execute this command:

docker run --network rocketchat -d 	--name "rocketchat" 	-e ROOT_URL=https://ps-rocketchat.com -e PORT=3000 	-e MONGO_URL=mongodb://mongodb:27017/rocketchat?replicaSet=rs0 -e MONGO_OPLOG_URL=mongodb://mongodb:27017/local?replicaSet=rs0 	registry.rocket.chat/rocketchat/rocket.chat

Set up Reverse Proxy

Before accessing your Rocket.Chat workspace, set up the reverse proxy following the next steps:

  • Create an nginx.conf file containing forwarding rules for each domain. Create the file in the same folder where you intend to start your docker instance and paste the following contents:

worker_processes 1;
events { worker_connections 1024; }
http {
    server {
	listen 443 ssl;
	server_name ps-rocketchat.com;
	ssl_certificate /cert/certificate.crt;
                  ssl_certificate_key /cert/private.key;
	add_header X-Frame-Options DENY;
	add_header X-Content-Type-Options nosniff;
	add_header X-XSS-Protection "1; mode=block";
        location /.well-known/matrix/server {
            default_type application/json;
            add_header Access-Control-Allow-Origin *;
	    return 200 '{"m.server": "matrix2.ps-rocketchat.com:443"}';
	}
        location /.well-known/matrix/client {
            default_type application/json;
            add_header Access-Control-Allow-Origin *;
            return 200 '{"m.homeserver": {"base_url": "https://matrix2.ps-rocketchat.com"}}';
        }
        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_pass http://rocketchat:3000;
        }
   }
   server {
    listen 80;
    server_name ps-rocketchat.com;
    return 302 https://$server_name$request_uri;
   }
    
   server {
    listen 443 ssl;
    server_name matrix2.ps-rocketchat.com;
    ssl_certificate /cert/certificate.crt;
    ssl_certificate_key /cert/private.key;
	add_header X-Frame-Options DENY;
	add_header X-Content-Type-Options nosniff;
	add_header X-XSS-Protection "1; mode=block";
    location / {
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://synapse:8008;
    }
  }
}
  • Start the reverse proxy mapping the nginx.conf and the certificate and private key for SSL by running this command:

Ensure to specify the paths to certificates if you are using relative paths. In this example, the reference location for certificates is the home folder.

Additionally, it's recommended to use the complete directory path for your nginx file, for example — /home/ubuntu/test/nginx.conf:/etc/nginx/nginx.conf:ro

docker run --name nginx --network rocketchat -p 443:443 -p 80:80 -v ./nginx.conf:/etc/nginx/nginx.conf:ro -v ./cert2/fullchain.pem:/cert/certificate.crt:ro -v ./cert2/privkey.pem:/cert/private.key:ro -d nginx

Configure Rocket.Chat Matrix Bridge

See Matrix Bridge Configuration to learn more about the configurations and their definitions.

Now that your workspace is set up, navigate to Administration > Workspace > Settings > Federation > Matrix Bridge and follow these steps:

  • Enable Matrix Bridge.

  • Update the following fields with these values:

    • Homeserver URL: http://synapse:8008

    • Homeserver Domain: <your domain>

    • Bridge URL: http://rocketchat:3300

Be cautious not to include "https://" before your homeserver domain.

  • Save your changes and copy the contents of your registration file.

Creating and modifying files in the data directory may require administrative(sudo) rights.

  • Add the following content at the end of the homeserver.yaml file in that same data directory and save:

app_service_config_files:
  - /data/registration.yaml
  • Now restart the rocketchat and synapse containers with these commands:

docker restart synapse
docker restart rocketchat

To run multiple Rocket.Chat instances, see Clustered Manual Installation.

Testing your setup

  • Create a user using matrix.org as a homeserver (assuming the default whitelisted matrix.org is still set on your matrix homeserver)

Now that your federated is successful on your workspace, see the Matrix User's Guide to learn more about how to use federation.

Use your own federation-tester

You can decide to use your own federation tester if you're in an air-gapped environment or if you use non-standard certificates.

git clone https://github.com/matrix-org/matrix-federation-tester.git
cd matrix-federation-tester 
go build
BIND_ADDRESS=:8080 ./matrix-federation-tester
  • Now, execute this command:

curl 'http://localhost:8080/api/report?server_name=ps-rocketchat.com'

Clustered Manual Installation

To distribute the work on Rocket.Chat, you run two identical Rocket.Chat applications ( can be named rocketchat1 and rocketchat2) that both connect to the same MongoDB. To make this setup accessible externally, you use an NGINX load balancer. This load balancer acts as a single entry point, and internally it distributes the workload between the two Rocket.Chat instances.

Before you proceed, ensure you have completed the Standalone Manual installation.

  • Start the second Rocket.Chat with this command:

docker run --network rocketchat -d 	--name "rocketchat2" 	-e ROOT_URL=https://ps-rocketchat.com -e PORT=3000 	-e MONGO_URL=mongodb://mongodb:27017/rocketchat?replicaSet=rs0 -e MONGO_OPLOG_URL=mongodb://mongodb:27017/local?replicaSet=rs0 	registry.rocket.chat/rocketchat/rocket.chat
  • Update the nginx.conf file with these contents

worker_processes 1;

events { worker_connections 1024; }

http {

    upstream web-rocketchat {
        ip_hash;
        server rocketchat:3000;
        server rocketchat2:3000;
    }

    upstream matrix-rocketchat {
        server rocketchat:3300;
        server rocketchat2:3300;
    }

    server {
       listen 3300;

       server_name nginx;

       location / {
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_pass http://matrix-rocketchat;
        }
    }
    
    server {docker
    	listen 443 ssl;

    	server_name ps-rocketchat.com;

    	ssl_certificate /cert/certificate.crt;
        ssl_certificate_key /cert/private.key;

    	add_header X-Frame-Options DENY;
    	add_header X-Content-Type-Options nosniff;
    	add_header X-XSS-Protection "1; mode=block";

        location /.well-known/matrix/server {
            default_type application/json;
            add_header Access-Control-Allow-Origin *;
	       return 200 '{"m.server": "matrix2.ps-rocketchat.com:443"}';
	   }

        location /.well-known/matrix/client {
            default_type application/json;
            add_header Access-Control-Allow-Origin *;
            return 200 '{"m.homeserver": {"base_url": "https://matrix2.ps-rocketchat.com"}}';
        }

        location / {
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_pass http://web-rocketchat;
        }
   }

   server {
    listen 80;

    server_name ps-rocketchat.com;

    return 302 https://$server_name$request_uri;
   }
    
   server {
    listen 443 ssl;
    server_name matrix2.ps-rocketchat.com;
    ssl_certificate /cert/certificate.crt;
    ssl_certificate_key /cert/private.key;

	add_header X-Frame-Options DENY;
	add_header X-Content-Type-Options nosniff;
	add_header X-XSS-Protection "1; mode=block";

    location / {
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://synapse:8008;
    }
  }

}
  • Restart nginx with this command:

docker restart nginx
  • Navigate to Administration > Workspace > Settings > Federation > Matrix Bridge and update these configurations:

    • Homeserver Domain: <your domain>

  • Save your changes and copy the contents of your registration file.

  • Paste the contents in the data/registration.yaml file .

  • Now restart the rocketchat and synapse containers with these commands:

docker restart synapse
docker restart rocketchat
docker restart rocketchat2           

Reset your environment and Restart your setup

Execute the following commands to clean up your files, reset your environment, and restart your setup:

docker stop rocketchat
docker stop synapse
docker stop mongodb
docker remove rocketchat
docker remove synapse
docker remove mongodb
sudo rm -fr data

See Federation FAQs for more troubleshooting tips.

and (> 2.3.3)

Download and execute the by running the following command. This creates a docker-compose and a .env file that can be edited as needed

If you want to install a specific version Rocket.Chat, navigate to the .env file, and modify the RELEASE variable to point to the of that version.

To set up a server, run this command to set up the Synapse environment:

Obtain SSL certificates for your domain records, if you don't have any. You can use .

Visit your domain URL in a web browser to access your Rocket.Chat workspace. Complete the and your workspace will be set up and ready to use.

Before you proceed, subscribe to any of our or on your workspace to unlock all the available federation features.

the support for on the matrix home server by creating a registration.yaml file in the data directory that was created for synapse earlier and paste the contents of the registration file.

Now, you can proceed to .

For testing the Matrix setup, you can use the if your certificates are from a “standard” CA recognized by Linux distros, etc.

For more real-time testing, visit and complete these steps:

from your Rocket.Chat workspace with the user you just created using their matrixId (@username:matrix.org).

Check to confirm that you received the DM from your Rocket.Chat user. You can choose to respond to the message from and confirm that you can receive the response in your Rocket.Chat workspace.

Download the locally and run the test yourself from (supposing you have the CA in your keychain) using these commands:

Homeserver URL:

Bridge URL:

Now you can proceed to again.

If you had a , you also need to stop/remove the rocketchat2 docker instance.

Automated Installation
Manual Installation
automatic installation
Docker
Docker compose
script
docker image tag
Docker
Synapse
Lets Encrypt
premium plans
apply trial
Configure
Application Service
test your workspace setup
Matrix Federation Tester
Element
Start a direct message
Element
Element
GitHub project
http://synapse:8008
http://nginx:3300
test your workspace
cluster set
Rocket.Chat Setup Wizard
App Service Registration File content
Matrix Bridge configurations
Registration File