{"id":12865,"date":"2019-03-29T00:16:46","date_gmt":"2019-03-29T00:16:46","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12865"},"modified":"2019-03-29T00:16:46","modified_gmt":"2019-03-29T00:16:46","slug":"how-to-install-lets-chat-on-centos-and-debian-based-systems","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/how-to-install-lets-chat-on-centos-and-debian-based-systems\/","title":{"rendered":"How to Install Let\u2019s Chat on CentOS and Debian Based Systems"},"content":{"rendered":"<p><strong>Let\u2019s Chat<\/strong>\u00a0is a free and open source, self-hosted chat application designed for relatively small teams. It is feature-rich; built using\u00a0<strong>Node.js<\/strong>\u00a0and employs\u00a0<strong>MongoDB<\/strong>\u00a0to store the application data.<\/p>\n<h4>Let\u2019s Chat Features:<\/h4>\n<ul>\n<li>Supports persistent messages<\/li>\n<li>Supports multiple rooms<\/li>\n<li>Supports local\/Kerberos\/LDAP authentication<\/li>\n<li>Comes with a REST-like API<\/li>\n<li>Supports private and password-protected rooms<\/li>\n<li>Offers support for new message alerts \/ notifications<\/li>\n<li>Also supports mentions (hey @tecmint\/@all)<\/li>\n<li>Provides support for image embeds \/ Giphy search<\/li>\n<li>Allows for code pasting<\/li>\n<li>Supports for file uploads (locally or from Amazon S3 or Azure)<\/li>\n<li>Also supports XMPP Multi-user chat (MUC) and 1-to-1 chat between XMPP users and many more.<\/li>\n<\/ul>\n<p>Importantly, it is intended to be easily deployable on any system that meets all following requirements.<\/p>\n<h4>Requirements<\/h4>\n<ul>\n<li>Node.js (0.11+)<\/li>\n<li>MongoDB (2.6+)<\/li>\n<li>Python (2.7.x)<\/li>\n<\/ul>\n<p>In this article, we will explain how to install and use a Let\u2019s Chat messaging application for small teams on CentOS and Debian based systems.<\/p>\n<h3>Step 1: Update the System<\/h3>\n<p><strong>1.<\/strong>\u00a0First make sure to perform a system-wide update by installing necessary packages as follows.<\/p>\n<pre><strong>-------------- On CentOS\/RHEL\/Fedora --------------<\/strong> \r\n$ sudo yum update &amp;&amp; sudo yum upgrade\r\n\r\n<strong>-------------- On Debian\/Ubuntu --------------<\/strong> \r\n$ sudo apt-get update &amp;&amp; sudo apt-get -y upgrade\r\n$ sudo apt-get install software-properties-common git build-essential<\/pre>\n<p><strong>2.<\/strong>\u00a0After finishing system update, reboot the server (Optional).<\/p>\n<pre>$ sudo reboot\r\n<\/pre>\n<h3>Step 2: Installing Node.js<\/h3>\n<p><strong>3.<\/strong>\u00a0Install most recent version of NodeJS (i.e version\u00a0<strong>7.x<\/strong>\u00a0at the time of writing) using the nodesource repository as shown.<\/p>\n<pre><strong>-------------- On CentOS\/RHEL\/Fedora --------------<\/strong>\r\n$ curl -sL https:\/\/rpm.nodesource.com\/setup_7.x | sudo -E bash - \r\n$ sudo yum install nodejs\r\n\r\n<strong>-------------- On Debian\/Ubuntu --------------<\/strong> \r\n$ curl -sL https:\/\/deb.nodesource.com\/setup_7.x | sudo -E bash -\r\n$ sudo apt install nodejs \r\n<\/pre>\n<h3>Step 3: Installing MongoDB Server<\/h3>\n<p><strong>4.<\/strong>\u00a0Next you need to install MongoDB community version, however, it is not available in the YUM repository. Therefore you have to enable the MongoDB repository as explained below.<\/p>\n<h4>On CentOS\/RHEL\/Fedora<\/h4>\n<pre>$ cat &lt;&lt;EOF | sudo tee -a \/etc\/yum.repos.d\/mongodb-org-3.4.repo\r\n[mongodb-org-3.4]\r\nname=MongoDB Repository\r\nbaseurl=https:\/\/repo.mongodb.org\/yum\/redhat\/7\/mongodb-org\/3.4\/x86_64\/\r\ngpgcheck=1\r\nenabled=1\r\ngpgkey=https:\/\/www.mongodb.org\/static\/pgp\/server-3.4.asc\r\nEOF\r\n<\/pre>\n<p>Now install and start the latest version of MongoDB Server (i.e 3.4).<\/p>\n<pre>$ sudo yum install mongodb-org\r\n$ sudo systemctl start mongod.service\r\n$ sudo systemctl enable mongod.service\r\n<\/pre>\n<h4>On Debian\/Ubuntu<\/h4>\n<pre>$ sudo apt-key adv --keyserver hkp:\/\/keyserver.ubuntu.com:80 --recv EA312927\r\n$ echo 'deb http:\/\/repo.mongodb.org\/apt\/ubuntu xenial\/mongodb-org\/3.2 multiverse' | sudo tee \/etc\/apt\/sources.list.d\/mongodb-org-3.2.list\r\n$ sudo apt-get update\r\n$ sudo apt-get install -y mongodb-org\r\n$ sudo systemctl start mongod.service\r\n$ sudo systemctl enable mongod.service\r\n<\/pre>\n<h3>Step 4: Install Let\u2019s Chat Server<\/h3>\n<p><strong>5.<\/strong>\u00a0First install\u00a0<strong>git<\/strong>\u00a0to clone the Let\u2019s Chat repository and install dependencies as shown.<\/p>\n<pre>$ sudo yum install git\t\t##RHEL\/CentOS\r\n$ sudo apt install git\t\t##Debian\/Ubuntu\r\n\r\n$ cd \/srv\r\n$ sudo git clone https:\/\/github.com\/sdelements\/lets-chat.git \r\n$ cd lets-chat\r\n$ sudo npm install\r\n<\/pre>\n<div id=\"attachment_26293\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Install-LetsChat-using-NPM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26293\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Install-LetsChat-using-NPM.png\" sizes=\"auto, (max-width: 853px) 100vw, 853px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Install-LetsChat-using-NPM.png 853w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Install-LetsChat-using-NPM-768x477.png 768w\" alt=\"Install Let Chat using NPM\" width=\"853\" height=\"530\" aria-describedby=\"caption-attachment-26293\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26293\" class=\"wp-caption-text\">Install Let Chat using NPM<\/p>\n<\/div>\n<p><strong>Note<\/strong>: The npm WARN signals from the output above are normal during the installation. Just ignore them.<\/p>\n<p><strong>6.<\/strong>\u00a0After finishing installation, create the application configuration file (<strong>\/srv\/lets-chat\/settings.yml<\/strong>) from the sample file and define your custom settings in it:<\/p>\n<pre>$ sudo cp settings.yml.sample settings.yml\r\n<\/pre>\n<p>We will use default settings provided from the sample settings file.<\/p>\n<p><strong>7.<\/strong>\u00a0Finally start the Let\u2019s Chat server.<\/p>\n<pre>$ npm start \r\n<\/pre>\n<p>To keep the Let\u2019s Chat daemon running, let\u2019s press\u00a0<code>Ctrl-C<\/code>\u00a0to exit and then create a Systemd unit file to enable it at system boot.<\/p>\n<h3>Step 5: Create Let\u2019s Chat Startup File<\/h3>\n<p><strong>8.<\/strong>\u00a0Create a systemd unit file for Let\u2019s Chat.<\/p>\n<pre>$ sudo vi \/etc\/systemd\/system\/letschat.service\r\n<\/pre>\n<p>Copy and paste the unit configuration below in the file.<\/p>\n<pre>[Unit]\r\nDescription=Let's Chat Server\r\nWants=mongodb.service\r\nAfter=network.target mongodb.service\r\n\r\n[Service]\r\nType=simple\r\nWorkingDirectory=\/srv\/lets-chat\r\nExecStart=\/usr\/bin\/npm start\r\nUser=root\r\nGroup=root\r\nRestart=always\r\nRestartSec=9\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n<p><strong>9.<\/strong>\u00a0Now start the service for the mean time and enable it to automatically start on system boot.<\/p>\n<pre>$ sudo systemctl start letschat\r\n$ sudo systemctl enable letschat\r\n$ sudo systemctl status letschat\r\n<\/pre>\n<div id=\"attachment_26294\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Start-LetsChat-Server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26294\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Start-LetsChat-Server.png\" sizes=\"auto, (max-width: 1138px) 100vw, 1138px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Start-LetsChat-Server.png 1138w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Start-LetsChat-Server-768x322.png 768w\" alt=\"Start LetsChat Server\" width=\"1138\" height=\"477\" aria-describedby=\"caption-attachment-26294\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26294\" class=\"wp-caption-text\">Start LetsChat Server<\/p>\n<\/div>\n<h3>Step 6: Access Let\u2019s Chat Web Interface<\/h3>\n<p><strong>10.<\/strong>\u00a0Once everything in place, you can access the Let\u2019s Chat web interface at the following URL.<\/p>\n<pre>https:\/\/SERVER_IP:5000\r\nOR\r\nhttps:\/\/localhost:5000\r\n<\/pre>\n<div id=\"attachment_26295\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Lets-Chat-Login.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26295\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Lets-Chat-Login.png\" sizes=\"auto, (max-width: 1125px) 100vw, 1125px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Lets-Chat-Login.png 1125w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Lets-Chat-Login-768x537.png 768w\" alt=\"Lets Chat Login\" width=\"1125\" height=\"786\" aria-describedby=\"caption-attachment-26295\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26295\" class=\"wp-caption-text\">Lets Chat Login<\/p>\n<\/div>\n<p><strong>11.<\/strong>\u00a0Click on \u201c<strong>I need an account<\/strong>\u201d to create one and fill in the required information and click \u201c<strong>Register<\/strong>\u201d.<\/p>\n<div id=\"attachment_26296\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Lets-Chat-Account.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-26296\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Lets-Chat-Account.png\" sizes=\"auto, (max-width: 1125px) 100vw, 1125px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Lets-Chat-Account.png 1125w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/07\/Create-Lets-Chat-Account-768x537.png 768w\" alt=\"Create Lets Chat Account\" width=\"1125\" height=\"786\" aria-describedby=\"caption-attachment-26296\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-26296\" class=\"wp-caption-text\">Create Lets Chat Account<\/p>\n<\/div>\n<p>You may also like following related articles:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/linux-commandline-chat-server-and-remove-unwanted-packages\/\" target=\"_blank\" rel=\"noopener\">Useful Commands to Create Commandline Chat Server in Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/create-your-own-instant-messagingchat-server-using-openfire-in-linux\/\" target=\"_blank\" rel=\"noopener\">Create Your Own Instant Messaging\/Chat Server Using \u201cOpenfire\u201d in Linux<\/a><\/li>\n<\/ol>\n<p>Let\u2019s Chat Github repository:\u00a0<a href=\"https:\/\/github.com\/sdelements\/lets-chat\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/sdelements\/lets-chat<\/a><\/p>\n<p>Enjoy! You now have Let\u2019s Chat application installed on your system. To share any thoughts with us, use the feedback form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/install-lets-chat-on-centos-ubuntu-debian\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let\u2019s Chat\u00a0is a free and open source, self-hosted chat application designed for relatively small teams. It is feature-rich; built using\u00a0Node.js\u00a0and employs\u00a0MongoDB\u00a0to store the application data. Let\u2019s Chat Features: Supports persistent messages Supports multiple rooms Supports local\/Kerberos\/LDAP authentication Comes with a REST-like API Supports private and password-protected rooms Offers support for new message alerts \/ notifications &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/how-to-install-lets-chat-on-centos-and-debian-based-systems\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Install Let\u2019s Chat on CentOS and Debian Based Systems&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12865","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12865"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12865\/revisions"}],"predecessor-version":[{"id":12866,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12865\/revisions\/12866"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}