<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>How To Install Rocket Chat On Ubuntu 20.04 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/how-to-install-rocket-chat-on-ubuntu-20-04/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Mon, 07 Dec 2020 16:20:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How To Install Rocket Chat On Ubuntu 20.04</title>
		<link>https://www.osradar.com/how-to-install-rocket-chat-on-ubuntu-20-04/</link>
					<comments>https://www.osradar.com/how-to-install-rocket-chat-on-ubuntu-20-04/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Wed, 09 Dec 2020 00:51:00 +0000</pubDate>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenSource]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[How To Install Rocket Chat On Ubuntu 20.04]]></category>
		<category><![CDATA[how to tutorials]]></category>
		<category><![CDATA[install rocket chat]]></category>
		<category><![CDATA[rocket chat ubuntu]]></category>
		<category><![CDATA[ubuntu 20.04]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=26159</guid>

					<description><![CDATA[<p>In this tutorial you&#8217;ll learn that how to install Rocket Chat on Ubuntu 20.04. Rocket chat is an open source platform like Slack that can be used for video meetings, group chats &#38; integrations with many other platforms. It is self hosted chat platform so more reliable and easy to use. So, follow the below [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-rocket-chat-on-ubuntu-20-04/">How To Install Rocket Chat On Ubuntu 20.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this tutorial you&#8217;ll learn that how to install Rocket Chat on Ubuntu 20.04. Rocket chat is an open source platform like Slack that can be used for video meetings, group chats &amp; integrations with many other platforms. It is self hosted chat platform so more reliable and easy to use. So, follow the below steps for an easy and optimal installation.</p>



<h3>Step 1: Update Your System</h3>



<p>First of all update your system.</p>



<pre class="wp-block-preformatted">sudo apt update -y</pre>



<h3>Step 2: Install Necessary Packages</h3>



<p>Hit the below commands to install the required package dependencies.</p>



<pre class="wp-block-preformatted">wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu 
focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

sudo apt -y update &amp;&amp; sudo apt install -y curl &amp;&amp; curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -

sudo apt install -y build-essential mongodb-org nodejs graphicsmagick</pre>



<p><strong>Note:</strong>Make sure to install the node version as of base version installed. If you didn&#8217;t do so, it&#8217;ll cause conflicts with the rocket chat.</p>



<p>You can verify the version by typing</p>



<pre class="wp-block-preformatted">sabi@Ubuntu20:~$ <strong>node --version</strong>
v12.20.0</pre>



<p>Then hit the given command to install inherits &amp; n.</p>



<pre class="wp-block-preformatted">sudo npm install -g inherits n</pre>



<p>Run the below command to create symbolic link.</p>



<pre class="wp-block-preformatted">sudo ln -s /usr/bin/node /usr/local/bin/node</pre>



<h3>Step 3: Install Rocket Chat On Ubuntu 20.04</h3>



<p>Run the below command to download the rocket chat package using curl.</p>



<pre class="wp-block-preformatted">curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat.tgz</pre>



<p>Now, extract the downloaded package to the <strong>/tmp</strong> directory.</p>



<pre class="wp-block-preformatted">tar -xvzf /tmp/rocket.chat.tgz -C /tmp</pre>



<p>Now, you can select where to install rocket chat. I&#8217;m going to install it under <strong>/opt</strong> folder.</p>



<pre class="wp-block-preformatted">cd /tmp/bundle/programs/server &amp;&amp; npm install<br>sudo mv /tmp/bundle /opt/Rocket.Chat</pre>



<h3>Step 4: Create Rocket Chat System User</h3>



<p>Fire the below commands to create new user &amp; give owner priviliges to the rocket chat folder.</p>



<pre class="wp-block-preformatted">sudo useradd -M rocketchat &amp;&amp; sudo usermod -L rocketchat<br>sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat</pre>



<h3>Step 5: Create Rocket Chat Service</h3>



<p>After creating the user, create rocket chat service. You can create the service unit file like below:</p>



<pre class="wp-block-preformatted">cat &lt;&lt; EOF |sudo tee /etc/systemd/system/rocketchat.service
[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target
[Service]
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://localhost:3000/ PORT=3000
[Install]
WantedBy=multi-user.target
EOF</pre>



<p>Now, hit the below commands to configure storage engine &amp; MongoDB.</p>



<pre class="wp-block-preformatted">sudo sed -i "s/^# engine:/ engine: mmapv1/" /etc/mongod.conf<br>sudo sed -i "s/^#replication:/replication:\n replSetName: rs01/" /etc/mongod.conf</pre>



<p>Then, start the MongoDB services.</p>



<pre class="wp-block-preformatted">sudo systemctl start mongod</pre>



<p>To start MongoDB on system boot type</p>



<pre class="wp-block-preformatted">sudo systemctl enable mongod</pre>



<p>Verify:</p>



<pre class="wp-block-preformatted">mongo --eval "printjson(rs.initiate())"</pre>



<p>And then start rocket chat service by typing</p>



<pre class="wp-block-preformatted">sudo systemctl start rocketchat</pre>



<p>Make sure the status is in running position.</p>



<pre class="wp-block-preformatted"><strong>systemctl status rocketchat</strong>
● rocketchat.service - The Rocket.Chat server
Loaded: loaded (/lib/systemd/system/rocketchat.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-11-27 10:05:54 UTC; 31s ago
Main PID: 28294 (node)
Tasks: 11 (limit: 19076)
Memory: 559.7M
CGroup: /system.slice/rocketchat.service
└─28294 /usr/local/bin/node /opt/Rocket.Chat/main.js
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | MongoDB Version: 4.0.21 |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | MongoDB Engine: mmapv1 |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | Platform: linux |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | Process Port: 3000 |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | Site URL: http://0.0.0.0:3000/ |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | ReplicaSet OpLog: Enabled |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | Commit Hash: b471caf9c9 |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | Commit Branch: HEAD |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ | |
Nov 30 10:06:20 chat rocketchat[28294]: ➔ +---------------------------------------------------+</pre>



<h3>Step 6: Configuring Nginx On Ubuntu 20.04</h3>



<p>Type the given command to install nginx.</p>



<pre class="wp-block-preformatted">sudo apt install nginx</pre>



<p>Edit the <strong>/etc/nginx/conf.d/rocketchat.conf</strong> file to configure nginx with rocket chat.</p>



<pre class="wp-block-preformatted">sudo nano /etc/nginx/conf.d/rocketchat.conf</pre>



<p>Then make the changes as shown below:</p>



<pre class="wp-block-preformatted">upstream rocket_backend {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name chat.osradar.com;
access_log /var/log/nginx/rocketchat-access.log;
error_log /var/log/nginx/rocketchat-error.log;
<code>location / {
proxy_pass http://rocket_backend/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;</code>

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
     }
}</pre>



<p><strong>Note:</strong> Don&#8217;t forget to replace <strong>chat.osradar.com</strong> with your domain name.</p>



<p>Verify the syntax.</p>



<pre class="wp-block-preformatted">sudo nginx -t</pre>



<pre class="wp-block-preformatted">nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br>nginx: configuration file /etc/nginx/nginx.conf test is successful</pre>



<p>Then restart the nginx services.</p>



<pre class="wp-block-verse">sudo systemctl restart nginx</pre>



<h3>Step 7: Setup Let&#8217;s Encrypt SSL</h3>



<p>As for security reasons, it is recommended to use SSl with rocket chat. So, download the Let&#8217;s Encrypt SSL certificate for free.</p>



<pre class="wp-block-preformatted">sudo apt install certbot python3-certbot-nginx</pre>



<p>Run the below command to get SSL.</p>



<pre class="wp-block-preformatted"><strong>certbot --nginx</strong>
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Which names would you like to activate HTTPS for?

1: chat.osradar.com

Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for chat.osradar.com
Waiting for verification…
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/conf.d/chat.conf
Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.

1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.

Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/chat.conf

Congratulations! You have successfully enabled
https://chat.osradar.com
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=chat.osradar.com

IMPORTANT NOTES:
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/chat.osradar.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/chat.osradar.com/privkey.pem
Your cert will expire on 2021-02-26. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the "certonly" option. To non-interactively renew <em>all</em> of
your certificates, run "certbot renew"
If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le</pre>



<p>After installing SSL certificates, the updated nginx file will be like this:</p>



<pre class="wp-block-preformatted">upstream rocket_backend {
server 127.0.0.1:3000;
}
server {
server_name chat.osradar.com;
access_log /var/log/nginx/rocketchat-access.log;
error_log /var/log/nginx/rocketchat-error.log;

location / {
proxy_pass http://rocket_backend/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;

proxy_redirect off;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/chat.osradar.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/chat.osradar.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = chat.osradar.com) {
return 301 https://$host$request_uri;

} # managed by Certbot

listen 80;
server_name chat.osradar.com;
return 404; # managed by Certbot

}</pre>



<p>Now, again verify the nginx syntax. If everything ok it&#8217;ll show the success message.</p>



<pre class="wp-block-preformatted">sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful</pre>



<p>Finally restart nginx services.</p>



<pre class="wp-block-preformatted">sudo systemctl restart nginx.</pre>



<h3>Step 8: Access Rocket Chat Serve</h3>



<p>Now, you can access your rocket chat server via FQDN with https(SSL). Configure it with the help of setup wizard as seen below:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="902" height="450" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/12/2020-11-30_23h46_36.png" alt="How To Install Rocket Chat On Ubuntu 20.04" class="wp-image-26233" srcset="https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_36.png 902w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_36-300x150.png 300w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_36-768x383.png 768w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_36-696x347.png 696w" sizes="(max-width: 902px) 100vw, 902px" /></figure>



<p>Once, done you can access the site by providing admin credentials created in the above wizard.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="902" height="472" src="//1081754738.rsc.cdn77.org/wp-content/uploads/2020/12/2020-11-30_23h46_49.png" alt="How To Install Rocket Chat On Ubuntu 20.04" class="wp-image-26234" srcset="https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_49.png 902w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_49-300x157.png 300w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_49-768x402.png 768w, https://www.osradar.com/wp-content/uploads/2020/12/2020-11-30_23h46_49-696x364.png 696w" sizes="(max-width: 902px) 100vw, 902px" /></figure>



<p>So, this is how you can install Rocket Chat On Ubuntu 20.04</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-rocket-chat-on-ubuntu-20-04/">How To Install Rocket Chat On Ubuntu 20.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-rocket-chat-on-ubuntu-20-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
