{"id":2067,"date":"2025-11-13T05:58:38","date_gmt":"2024-06-08T02:05:44","guid":{"rendered":""},"modified":"2025-02-02T00:46:18","modified_gmt":"2025-02-01T23:46:18","slug":"how-to-install-and-create-a-chat-server-using-matrix-synapse-and-element-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-install-and-create-a-chat-server-using-matrix-synapse-and-element-on-ubuntu-22-04\/","title":{"rendered":"Linux VPS &#038; VPS Windows Setup Guide | NetCloud24 and Create a Chat Server Using Matrix Synapse and Element on Ubuntu 22.04"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header><\/header>\n<article>\n<p><strong>Matrix Synapse<\/strong> is an open-source federated chat server that allows users to communicate across different platforms. <strong>Element<\/strong> is a popular web-based client for Matrix, providing a rich, user-friendly interface for chat and collaboration. In this guide, we will walk you through how to install Matrix Synapse and Element on <strong>Ubuntu 22.04<\/strong> to set up your own chat server. Hosting this chat server on a  ensures high performance, scalability, and full control over your communication platform using a <strong>VPS server<\/strong>.<\/p>\n<h2>Step 1: Update Your VPS Server<\/h2>\n<p>Before installing Matrix Synapse, ensure that your <a href=\"https:\/\/ie.netcloud24.com\">VPS server<\/a> is up to date. Run the following commands to update your system:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<p>Using a <strong>Windows VPS<\/strong> allows you to take advantage of dedicated resources, ensuring your chat server performs reliably, especially under heavy traffic.<\/p>\n<h2>Step 2: Install Matrix Synapse<\/h2>\n<p>First, add the official Matrix Synapse repository to your server. Run the following commands:<\/p>\n<pre><code>\r\nsudo apt install -y lsb-release wget apt-transport-https\r\nsudo wget -qO \/usr\/share\/keyrings\/matrix-org-archive-keyring.gpg https:\/\/packages.matrix.org\/debian\/matrix-org-archive-keyring.gpg\r\necho \"deb [signed-by=\/usr\/share\/keyrings\/matrix-org-archive-keyring.gpg] https:\/\/packages.matrix.org\/debian\/ $(lsb_release -cs) main\" | sudo tee \/etc\/apt\/sources.list.d\/matrix-org.list\r\nsudo apt update\r\n<\/code><\/pre>\n<p>Now, install Matrix Synapse:<\/p>\n<pre><code>sudo apt install matrix-synapse-py3 -y<\/code><\/pre>\n<p>During the installation, you will be prompted to enter your domain name, which will be used as the server address for your chat instance. If you haven&#8217;t set up a domain yet, you can use your server\u2019s IP address for now.<\/p>\n<h2>Step 3: Configure Matrix Synapse<\/h2>\n<p>After installation, you can configure Matrix Synapse by editing the configuration file located at <code>\/etc\/matrix-synapse\/homeserver.yaml<\/code>:<\/p>\n<pre><code>sudo nano \/etc\/matrix-synapse\/homeserver.yaml<\/code><\/pre>\n<p>Here, you can set up basic configurations such as server name, registration settings, and SSL\/TLS options. Be sure to configure proper authentication and secure your server.<\/p>\n<p>After making your changes, restart the Synapse service:<\/p>\n<pre><code>sudo systemctl restart matrix-synapse<\/code><\/pre>\n<h2>Step 4: Install and Configure Nginx as a Reverse Proxy<\/h2>\n<p>To serve your Matrix Synapse instance securely over HTTPS, install Nginx as a reverse proxy:<\/p>\n<pre><code>sudo apt install nginx -y<\/code><\/pre>\n<p>Next, configure Nginx by creating a new configuration file for Matrix:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/sites-available\/matrix<\/code><\/pre>\n<p>Add the following configuration (replace <code>your-domain.com<\/code> with your actual domain or IP address):<\/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>Enable the site and restart Nginx:<\/p>\n<pre><code>\r\nsudo ln -s \/etc\/nginx\/sites-available\/matrix \/etc\/nginx\/sites-enabled\/\r\nsudo systemctl restart nginx\r\n<\/code><\/pre>\n<h2>Step 5: Install Element<\/h2>\n<p>Element is the web-based client for Matrix. To install Element, run the following commands to add the repository and install the package:<\/p>\n<pre><code>\r\nsudo apt install curl -y\r\ncurl -sL https:\/\/packages.riot.im\/debian\/riot-im-archive-keyring.gpg | sudo apt-key add -\r\necho \"deb https:\/\/packages.riot.im\/debian\/ default main\" | sudo tee \/etc\/apt\/sources.list.d\/element.list\r\nsudo apt update\r\nsudo apt install element-desktop -y\r\n<\/code><\/pre>\n<p>Element will now be available as a desktop application, but you can also run it on a web server. Alternatively, you can access the hosted version of Element at <a href=\"https:\/\/app.element.io\/\">app.element.io<\/a> and connect it to your Synapse instance.<\/p>\n<h2>Step 6: Register Your First User<\/h2>\n<p>Matrix Synapse does not allow public user registration by default. You need to register the first admin user manually. To do this, run the following command:<\/p>\n<pre><code>\r\nsudo register_new_matrix_user -c \/etc\/matrix-synapse\/homeserver.yaml http:\/\/localhost:8008\r\n<\/code><\/pre>\n<p>You will be prompted to enter the desired username, password, and set the user as an admin.<\/p>\n<h2>Step 7: Access Your Matrix Chat Server<\/h2>\n<p>After setting up your Matrix Synapse and Element, open your browser and go to <code>http:\/\/your-domain.com<\/code>. If you configured SSL, use <code>https:\/\/your-domain.com<\/code>. You can log in using the admin user you just created and start inviting users to join your chat server.<\/p>\n<h2>Step 8: Optimize Your VPS Server for Matrix Synapse<\/h2>\n<p>For optimal performance and scalability, hosting your Matrix Synapse server on a  is highly recommended. A <strong>VPS server<\/strong> provides the dedicated CPU, memory, and storage resources necessary to handle multiple chat rooms, users, and real-time messaging. As your user base grows, a VPS ensures that your chat server can scale to meet increasing demands without performance issues.<\/p>\n<h2>Conclusion<\/h2>\n<p>Matrix Synapse combined with Element provides a powerful and flexible platform for real-time communication. By setting up your own chat server on Ubuntu 22.04, you have full control over your communications. Hosting your chat server on a  ensures better performance, scalability, and security for your Matrix Synapse instance.<\/p>\n<p>For more information about VPS hosting and optimizing your Matrix Synapse chat server, visit  today.<\/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 Matrix Synapse is an open-source federated chat server that allows users to communicate across different platforms. Element is a popular web-based client for Matrix, providing a rich,\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-2067","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\/2067","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=2067"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2067\/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=2067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}