Tutorials  /  Linux Basics

Install Let's Chat on CentOS 7 – Full Setup Guide

Ccentron Redaktion · April 2025 ·5 min read ·Linux Basics, Tutorial

Let's Chat is a free and open source chat platform tailored for self-hosted messaging needs of small teams.

This application is built using NodeJS and MongoDB. This tutorial explains how to install and deploy Let's Chat on a CentOS 7 server environment.

Requirements

  • A CentOS 7 server with a minimum of 2GB RAM (4GB is recommended)
  • Access to a user account with sudo privileges
VM

Matching infrastructure at centron

No hardware needed to follow along: ccloud³ VMs with full root access start at €3.12 per month, billed by the hour and ready in seconds. Rent a cloud server →

Step 1: Perform System Updates

Once logged into your server, start by updating the entire system:

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

After the reboot, reconnect using the same sudo-enabled user account.

Step 2: Install NodeJS

Install NodeJS version 6.x (version 6.9.5 was current at the time of this guide):

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

Step 3: Install MongoDB

Install MongoDB version 3.4 using the steps below.

3.1 Configure MongoDB YUM Repository

Create the repository file for MongoDB 3.4:

Code
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 MongoDB

Install and activate MongoDB server version 3.4.1:

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

Step 4: Install Let's Chat

Proceed to download and install Let's Chat from its GitHub repository:

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

Note: During the npm installation, you might encounter multiple warnings (npm WARN ...). These can be safely disregarded.

Step 5 (Optional): Configure Custom Settings

If you wish to personalize the application, you can duplicate and edit the sample settings file:

Console
sudo cp settings.yml.sample settings.yml

For this tutorial, the sample file is used without further modification.

Step 6: Run Let's Chat with Forever

To start Let's Chat manually, go to the installation directory and run the application:

Console
cd /opt/lets-chat
npm start

You should see output similar to this:

Code
> lets-chat@0.4.8 start /opt/lets-chat
> node app.js

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

Release 0.4.8

To keep Let's Chat running after you close the terminal, press Ctrl-C to stop it for now, then install the forever package globally:

Console
sudo npm install forever -g

Now launch the app using Forever:

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

Once running, Let's Chat will be available locally at:

http://localhost:5000

You can verify that it's working by using:

Console
curl -I http://localhost:5000

The expected output should look like:

YAML
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: Set Up Nginx as a Reverse Proxy

To make Let's Chat accessible from the internet, configure a reverse proxy using Nginx.

7.1 Install Nginx

Console
sudo yum install nginx -y

7.2 Adjust Nginx Configuration

Edit the Nginx configuration file:

Console
sudo vi /etc/nginx/nginx.conf

Inside the http {} block, locate the location / {} section and replace it with the following:

Code
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 close the file with:

:wq!

7.3 Launch Nginx

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

7.4 Update Firewall Rules

Allow web traffic through the firewall with these commands:

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

Step 8: Access via Web Browser

Open your browser and visit http://203.0.113.1 to load the Let's Chat interface. Use the "I need an account" link to register and create a new user account.

Conclusion

By following this step-by-step guide, you've successfully installed and configured Let's Chat on a CentOS 7 server. With NodeJS, MongoDB, and Forever ensuring stability, and Nginx providing a reliable reverse proxy, your self-hosted chat environment is now ready for small team collaboration. You can further enhance security and functionality by customizing the settings.yml file or integrating SSL for encrypted communication. Let's Chat offers a solid, open-source alternative for private team messaging.

Jetzt 200 € Guthaben sichern

Testen Sie Ihr Setup auf ccloud³

Registrieren Sie sich in der ccloud³ und erhalten Sie 200 € Startguthaben für Ihr Projekt – z. B. für eine PostgreSQL-VM mit automatischen Backups.

centron Redaktion Technische Redaktion

Das Redaktionsteam von centron schreibt Anleitungen aus dem Betriebsalltag: getestet auf unserer eigenen Plattform, betrieben im Rechenzentrum in Hallstadt bei Bamberg.

Kategorie Linux Basics
Teilen
Noch offene Fragen?

Our team will help you with your specific setup - in German or English, by people who run the platform themselves.

War dieses Tutorial hilfreich?

Your answer is stored anonymously and helps us improve our tutorials.

Kommentare

No comments yet - be the first to ask a question about this tutorial.

Sign in to comment

Comments are open to centron customers. Sign in to your account to ask a question about this tutorial.

Weiterlesen

Das könnte Sie auch interessieren

Jetzt kostenlos anfangen

Melden Sie sich an und erhalten Sie in den ersten 60 Tagen ein Guthaben von 200 € bei centron.

Dieses Werbeangebot gilt nur für neue Konten. Angebot ausschließlich für Gewerbetreibende.

Jetzt loslegen Sales kontaktieren