{"id":2705,"date":"2024-02-21T07:30:24","date_gmt":"2025-06-24T14:03:08","guid":{"rendered":""},"modified":"2025-02-02T00:46:19","modified_gmt":"2025-02-01T23:46:19","slug":"how-to-install-and-create-a-chat-server-using-matrix-synapse-and-element-on-rocky-linux-9","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-and-create-a-chat-server-using-matrix-synapse-and-element-on-rocky-linux-9\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 and Create a Chat Server using Matrix Synapse and Element on Rocky Linux 9"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<article>\n<p>Matrix Synapse is an open-source chat server that allows you to host decentralized, real-time communication. Element is the most popular web-based client for Matrix, providing a modern interface for users to chat and collaborate. In this guide, we\u2019ll walk you through the steps to install and create your own chat server using Matrix Synapse and Element on <strong>Rocky Linux 9<\/strong>. If you want a high-performance, scalable environment, consider deploying this setup on a  server to optimize your chat server&#8217;s performance and reliability.<\/p>\n<h2>Step 1: Prepare Your VPS Server<\/h2>\n<p>Before starting, ensure that your <a href=\"https:\/\/ie.netcloud24.com\">VPS server<\/a> is up to date. Rocky Linux is known for its stability, and with a <strong>VPS server<\/strong>, you can ensure that your Matrix chat server runs smoothly. Start by updating your system:<\/p>\n<pre><code>sudo dnf update -y<\/code><\/pre>\n<p>If you\u2019re hosting on a , this ensures you get the best performance and security features for your chat server deployment.<\/p>\n<h2>Step 2: Install Matrix Synapse<\/h2>\n<p>Matrix Synapse is the backend server for Matrix, enabling decentralized communication. First, add the Matrix Synapse repository:<\/p>\n<pre><code>\r\nsudo dnf install https:\/\/packages.matrix.org\/rpm\/el\/9\/matrix-org-repo-1.0.0-1.el9.noarch.rpm\r\n<\/code><\/pre>\n<p>Next, install Matrix Synapse:<\/p>\n<pre><code>sudo dnf install matrix-synapse -y<\/code><\/pre>\n<p>During the installation, you will be prompted to enter your domain name. This should be the domain where your chat server will be hosted. If you&#8217;re using a <strong>VPS server<\/strong> from , ensure that your domain is correctly configured to point to your VPS server&#8217;s IP address.<\/p>\n<h2>Step 3: Configure Matrix Synapse<\/h2>\n<p>After installation, you\u2019ll need to edit the Synapse configuration file to finalize the setup. Open the configuration file:<\/p>\n<pre><code>sudo nano \/etc\/matrix-synapse\/homeserver.yaml<\/code><\/pre>\n<p>Ensure the following settings are properly configured:<\/p>\n<ul>\n<li>Set the correct server name (your domain).<\/li>\n<li>Enable registration if you want public sign-ups.<\/li>\n<li>Configure your TLS settings or set up a reverse proxy for HTTPS.<\/li>\n<\/ul>\n<p>Once you\u2019ve configured Synapse, start and enable the service:<\/p>\n<pre><code>\r\nsudo systemctl enable matrix-synapse --now\r\n<\/code><\/pre>\n<h2>Step 4: Install and Configure Nginx<\/h2>\n<p>To secure your chat server with HTTPS, you\u2019ll need to set up a reverse proxy using Nginx. First, install Nginx:<\/p>\n<pre><code>sudo dnf install nginx -y<\/code><\/pre>\n<p>Create a new configuration file for your Matrix Synapse setup:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/conf.d\/matrix.conf<\/code><\/pre>\n<p>Add the following configuration to proxy requests to your Matrix Synapse server:<\/p>\n<pre><code>\r\nserver {\r\n    listen 80;\r\n    server_name your-domain.com;\r\n    \r\n    location \/ {\r\n        proxy_pass http:\/\/localhost:8008;\r\n        proxy_set_header Host $host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header X-Forwarded-Proto $scheme;\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Replace <code>your-domain.com<\/code> with your actual domain name. Then, restart Nginx to apply the changes:<\/p>\n<pre><code>sudo systemctl restart nginx<\/code><\/pre>\n<p>If you\u2019re using a , this setup ensures your Matrix chat server is accessible with enhanced performance, security, and scalability.<\/p>\n<h2>Step 5: Install Element Web Client<\/h2>\n<p>Element is the recommended web client for Matrix. It provides a modern and user-friendly interface for users to interact with your chat server. To install Element, first download the latest Element release:<\/p>\n<pre><code>wget https:\/\/github.com\/vector-im\/element-web\/releases\/download\/v1.11.5\/element-v1.11.5.tar.gz<\/code><\/pre>\n<p>Extract the downloaded archive and move it to your web server directory:<\/p>\n<pre><code>\r\ntar -xvzf element-v1.11.5.tar.gz\r\nsudo mv element-v1.11.5 \/var\/www\/element\r\n<\/code><\/pre>\n<p>Create a new Nginx configuration for Element:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/conf.d\/element.conf<\/code><\/pre>\n<p>Add the following configuration:<\/p>\n<pre><code>\r\nserver {\r\n    listen 80;\r\n    server_name chat.your-domain.com;\r\n    \r\n    root \/var\/www\/element;\r\n    index index.html;\r\n\r\n    location \/ {\r\n        try_files $uri $uri\/ =404;\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Make sure to replace <code>chat.your-domain.com<\/code> with your actual domain name. Restart Nginx to apply the configuration:<\/p>\n<pre><code>sudo systemctl restart nginx<\/code><\/pre>\n<h2>Step 6: Access Your Chat Server<\/h2>\n<p>Your Matrix Synapse and Element installation is now complete. You can access the chat server at <code>http:\/\/chat.your-domain.com<\/code> and log in using the credentials created during the Matrix Synapse setup. Hosting your chat server on a  gives you better performance, security, and scalability for real-time communication, especially when managing multiple users.<\/p>\n<h2>Conclusion<\/h2>\n<p>Setting up a chat server using Matrix Synapse and Element on Rocky Linux 9 is a powerful solution for decentralized communication. By hosting it on a reliable <strong>VPS server<\/strong> from , you ensure that your chat server can handle the demands of real-time messaging with excellent uptime and performance.<\/p>\n<p>For more information on VPS hosting and how to optimize your chat server setup, visit .<\/p>\n<\/article>\n<footer>\n<p>\u00a9 2024 Windows VPS &#8211; All Rights Reserved<\/p>\n<\/footer>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Matrix Synapse is an open-source chat server that allows you to host decentralized, real-time communication. Element is the most popular web-based client for Matrix, providing a\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2705","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2705","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2705"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2705\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}