• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Deploy a Let’s Chat Server on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
15
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Step 1: Update the system
  3. Step 2: Install NodeJS
  4. Step 3: Install MongoDB
    1. 3.1 Create the MongoDB 3.4 YUM repo as follows:
    2. 3.2 Install and start the latest stable release of MongoDB Server, which is 3.4.1 at the time this article was written:
  5. Step 4: Install Let’s Chat
  6. Step 5 (optional): Create the settings.yml file
  7. Step 6: Install Forever
  8. Step 7: Install Nginx as a reverse proxy
    1. 7.1 Install Nginx:
    2. 7.2 Modify Nginx’s settings:
    3. 7.3 Start the Nginx service:
    4. 7.4 Modify firewall rules in order to allow web access:
  9. Step 8: Web access
  10. Want to contribute?


Let’s Chat is an open source chat application is designed to provide self-hosted messaging service for small teams.

Let’s Chat is based on NodeJS and MongoDB. In this article, we’ll take a look at how to deploy Let’s Chat on a CentOS 7 sever.

Prerequisites

  • A CentOS 7 server instance with at least 2G RAM. 4G RAM recommended.
  • A sudo user.

Step 1: Update the system

When logging into your system for the first time, it’s necessary to perform a system-wide update as follows:

sudo yum install epel-release -y
sudo yum clean all && sudo yum update -y && sudo shutdown -r now

After the reboot, log in back as the same sudo user.

Step 2: Install NodeJS

Install the latest NodeJS 6.x as follows, which is 6.9.5 at the time of writing:

cd
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
sudo yum install -y nodejs

Step 3: Install MongoDB

Install the latest MongoDB as follows, which is 3.4 at the time this article was written.

3.1 Create the MongoDB 3.4 YUM repo as follows:

cat <<EOF | sudo tee -a /etc/yum.repos.d/mongodb-org-3.4.repo
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
EOF

3.2 Install and start the latest stable release of MongoDB Server, which is 3.4.1 at the time this article was written:

sudo yum install -y mongodb-org
sudo systemctl start mongod.service
sudo systemctl enable mongod.service

Step 4: Install Let’s Chat

sudo yum install git -y
cd /opt
sudo git clone https://github.com/sdelements/lets-chat.git
cd lets-chat
sudo npm install

Note: It’s normal to see several npm WARN ... messages during the installation. Just ignore them.

Step 5 (optional): Create the settings.yml file

If you want to customize Let’s Chat, you can create a file named /opt/lets-chat/settings.yml and then put your custom settings in it:

sudo cp settings.yml.sample settings.yml

For the purpose of this tutorial, we will use the default settings from the sample settings file.

Step 6: Install Forever

You can start Let’s Chat from the /opt/lets-chat directory:

cd /opt/lets-chat
npm start

The output should resemble:

> [email protected] start /opt/lets-chat
> node app.js

██╗     ███████╗████████╗███████╗     ██████╗██╗  ██╗ █████╗ ████████╗
██║     ██╔════╝╚══██╔══╝██╔════╝    ██╔════╝██║  ██║██╔══██╗╚══██╔══╝
██║     █████╗     ██║   ███████╗    ██║     ███████║███████║   ██║
██║     ██╔══╝     ██║   ╚════██║    ██║     ██╔══██║██╔══██║   ██║
███████╗███████╗   ██║   ███████║    ╚██████╗██║  ██║██║  ██║   ██║
╚══════╝╚══════╝   ╚═╝   ╚══════╝     ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝   ╚═╝

Release 0.4.8

In order to keep the Let’s Chat application running, let’s press Ctrl-C first to exit and then install an app named forever which can ensure that will happen:

sudo npm install forever -g

Use the forever application to start Let’s Chat:

cd /opt/lets-chat
forever start app.js

After Let’s Chat gets up and running, you can access it locally via:

http://localhost:5000

You can test your installation with the below command:

curl -I http://localhost:5000

The output should be similar to:

HTTP/1.1 302 Found
X-Frame-Options: SAMEORIGIN
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy:
X-Content-Security-Policy:
X-WebKit-CSP:
X-UA-Compatible: IE=Edge,chrome=1
Location: /login
Vary: Accept, Accept-Encoding
Content-Type: text/plain; charset=utf-8
Content-Length: 28
set-cookie: connect.sid=s%3A0YTFL6Un5G7iMc3zt8i-vlIh2YDQqTZ3.1dVZFG3VWmwd%2FXXXJiuyWSQ4k432MVvxm7xrgJGIej4; Path=/; HttpOnly
Date: Wed, 01 Feb 2017 11:30:03 GMT
Connection: keep-alive

Step 7: Install Nginx as a reverse proxy

In order to enable external web access, you need to setup a reverse proxy, Nginx, for example, to redirect traffic.

7.1 Install Nginx:

sudo yum install nginx -y

7.2 Modify Nginx’s settings:

sudo vi /etc/nginx/nginx.conf

Find the location / {} segment within the http {} segment:

http {

    location / {
    }

}

Insert the below lines into the location / {} segment:

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;
proxy_pass http://127.0.0.1:5000;

The final result should be:

http {

location / {
    proxy_pass http://127.0.0.1:5000;
      proxy_http_version 1.1;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection 'upgrade';
      proxy_cache_bypass $http_upgrade;
}

}

Save and quit:

:wq!

7.3 Start the Nginx service:

sudo systemctl start nginx.service
sudo systemctl enable nginx.service

7.4 Modify firewall rules in order to allow web access:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

Step 8: Web access

Point your web browser to http://203.0.113.1 to access Let’s Chat, and then click the I need an account link to register a username for logging in.

That’s it. Thanks for reading.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Setup Sails.js for Development on CentOS 7

Next Post

How to Install PyroCMS on CentOS 7

Next Post

How to Install PyroCMS on CentOS 7

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet