{"id":6896,"date":"2022-10-20T19:19:26","date_gmt":"2022-10-20T19:19:26","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=6896"},"modified":"2022-10-20T19:19:26","modified_gmt":"2022-10-20T19:19:26","slug":"install-rocket-chat-server","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2022\/10\/20\/install-rocket-chat-server\/","title":{"rendered":"Install Rocket.Chat Server"},"content":{"rendered":"\n<p>Want to have your own Slack like online chat hostedon your own server? Here is the process. First spin up a VM with Debian 11. Enable snaps on Debian and install Rocket.Chat Server<br>Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.<br><\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Snaps are discoverable and installable from the Snap Store, an app store with an audience of millions.<\/p>\n\n\n\n<p>Enable snapd<br>On Debian 9 (Stretch) and newer, snap can be installed directly from the command line:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo apt update\nsudo apt install snapd\nsudo snap install core\n<\/pre><\/div>\n\n\n<p>Install Rocket.Chat Server<br>To install Rocket.Chat Server, simply use the following command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo snap install rocketchat-server\n<\/pre><\/div>\n\n\n<p>Now we have Rocket.Chat, let&#8217;s set up The UFW firewall.<br>First lets install UFW<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo apt-get install ufw\n<\/pre><\/div>\n\n\n<p>Check the Status<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo ufw status verbose\n<\/pre><\/div>\n\n\n<p>By default, UFW is disabled so you should see something like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nStatus: inactive\n<\/pre><\/div>\n\n\n<p>Let\u2019s set your UFW rules back to the defaults so we can be sure that you\u2019ll be able to follow along with this tutorial. To set the defaults used by UFW, use these commands:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo ufw default deny incoming\n<\/pre><\/div>\n\n\n<p>Output:<br>Default incoming policy changed to &#8216;deny&#8217;<br>(be sure to update your rules accordingly)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo ufw default allow outgoing\n<\/pre><\/div>\n\n\n<p>Output:<br>Default outgoing policy changed to &#8216;allow&#8217;<br>(be sure to update your rules accordingly)<\/p>\n\n\n\n<p>Allow SSH Connections<\/p>\n\n\n\n<p>To configure your server to allow incoming SSH connections, you can use this UFW command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo ufw allow ssh\n<\/pre><\/div>\n\n\n<p>Output:<br>Rules updated<br>Rules updated (v6)<br>this command works the same as the one above:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo ufw allow 22\n<\/pre><\/div>\n\n\n<p>Let&#8217;s add the rocket.chat port 3000<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo ufw allow 3000\n<\/pre><\/div>\n\n\n<p>Now that your firewall is configured to allow incoming SSH connections, we can enable it<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo ufw enable\nCommand may disrupt existing ssh connections. Proceed with operation (y|n)? y\nFirewall is active and enabled on system startup\n<\/pre><\/div>\n\n\n<p><strong>Use Nginx as Proxy Server<\/strong><\/p>\n\n\n\n<p>For those who want to access the Rocket Chat server at port 80 or 443, let\u2019s configure the Nginx Proxy server for that if you are not using the Apache already. First of all, install it using the given command.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo apt install nginx -y\n<\/pre><\/div>\n\n\n<p>Create a site configuration file to proxy the Rocket Chat server address:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo nano \/etc\/nginx\/conf.d\/rocketchat.conf\n<\/pre><\/div>\n\n\n<p>Add the following lines: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nserver {\n        listen 80;\n        server_name your-domain or ip-address;\n\n        error_log \/var\/log\/nginx\/rocketchat_error.log;\n\n        location \/ {\n            proxy_pass http:\/\/127.0.0.1:3000\/;\n            proxy_http_version 1.1;\n            proxy_set_header Upgrade $http_upgrade;\n            proxy_set_header Connection \"upgrade\";\n            proxy_set_header Host $http_host;\n            proxy_set_header X-Real-IP $remote_addr;\n            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n            proxy_set_header X-Forwarded-Proto http;\n            proxy_set_header X-Nginx-Proxy true;\n            proxy_redirect off;\n        }\n    }\n<\/pre><\/div>\n\n\n<p>Note: Replace your-domain or ip-address with a domain name if you want to access the Rocket Chat server using a fully qualified domain name. Whereas the users who want to access it using the Server\u2019s public or private IP address use that.<\/p>\n\n\n\n<p>Save the file using Ctlr+O, hit the Enter key, and then exit the file using Ctrl +X.<\/p>\n\n\n\n<p>After that check, if the Nginx configuration is ok.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo nginx -t\n<\/pre><\/div>\n\n\n<p>Output must be:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\n<\/pre><\/div>\n\n\n<p>Now, restart the Nginx server and enable it:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo systemctl restart nginx\nsudo systemctl enable nginx\n<\/pre><\/div>\n\n\n<p>Setup Let\u2019s Encrypt SSL for Rocket Chat<br>If you are using a fully qualified domain name to access the Rocket Server running on Ubuntu 22.04 then setting up an SSL certificate is quite easy and free of cost using Let\u2019s Encrypt.<\/p>\n\n\n\n<p>Let&#8217;s disable the firewall temporarily.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo ufw disable\n<\/pre><\/div>\n\n\n<p>Now, follow the given command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo apt install certbot python3-certbot-nginx -y\n<\/pre><\/div>\n\n\n<p>Run the command to issue an SSL certificate<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo certbot --nginx\n<\/pre><\/div>\n\n\n<p>Once the certificate is issued, restart the Nginx once more:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo systemctl restart nginx\n<\/pre><\/div>\n\n\n<p>Then browse to https:\/\/domain.name and setup Rocket.Chat.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-23_09-42-04.png\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"161\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-23_09-42-04-300x161.png\" alt=\"\" class=\"wp-image-6921\" srcset=\"https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-23_09-42-04-300x161.png 300w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-23_09-42-04-1024x549.png 1024w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-23_09-42-04-768x412.png 768w, https:\/\/www.qbytes.cloud\/wp-content\/uploads\/2022\/10\/2022-10-23_09-42-04.png 1167w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Want to have your own Slack like online chat hostedon your own server? Here is the process. First spin up a VM with Debian 11. Enable snaps on Debian and install Rocket.Chat ServerSnaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and &#8230; <a title=\"Install Rocket.Chat Server\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2022\/10\/20\/install-rocket-chat-server\/\" aria-label=\"Read more about Install Rocket.Chat Server\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[98],"tags":[],"class_list":["post-6896","post","type-post","status-publish","format-standard","hentry","category-rocketchat"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=6896"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/6896\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=6896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=6896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=6896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}