How to Install Let’s Chat on Ubuntu Linux
Let’s Chat version 1.5.0 is a free messaging app that lets you run your own private chat server on Ubuntu 22.04 LTS. This open-source tool gives you real-time group rooms and direct messages for small teams without sending your chat data to outside companies.
The server software needs Node.js (a tool that runs server code) and npm (a package manager for installing software tools). It also stores its messages and user accounts in MongoDB, so you will install that too. This guide covers the whole job in order: the prerequisites, the app itself, an Nginx reverse proxy with HTTPS, and a systemd service that keeps the app running.
To install Let’s Chat on Ubuntu, first install Node.js 20.x or 22.x LTS, MongoDB, Python 3 and Git, then run git clone https://github.com/sdelements/lets-chat.git, cd lets-chat and npm install. Copy the example settings file, then start the server with npm start. Keep MongoDB running first, or the server will not come up.
Why use Let’s Chat?
You might want a private, self-hosted space for your team to talk and collaborate without relying on big tech services. With Let’s Chat, your messages, user accounts and uploaded files stay on a machine you control. You decide who gets an account, where the data lives and how it is backed up.
It suits small teams, a home lab or a office network. It is not built for thousands of users, so keep your expectations in line with a small group.
What happens when done?
When you finish, you will have a private messaging server running on your own hardware, accessible via a web browser. Team members open the address, register an account and join rooms. If you complete the Nginx and systemd sections, the server also uses HTTPS and starts again on its own after a reboot.
Prerequisites
Prerequisites for an install Let’s Chat Ubuntu setup include having Node.js version 20.x or 22.x, MongoDB, Python 3.x, and Git ready on your system. You must install these required tools before downloading the chat application, otherwise the setup process will fail during the dependency checks.
- Node.js version 20.x or 22.x (LTS) How to install Node.js on Ubuntu Linux
- MongoDB installed How to install MongoDB on Ubuntu Linux
- Python 3.x installed How to install Python on Ubuntu Linux
- Git installed (sudo apt install git) Node.js 0.11+ MongoDB 2.6+ Python 2.7
A few notes before you move on:
- Use a Node.js LTS release. Odd-numbered or very new versions can break the npm install step.
- MongoDB is not in the default Ubuntu 22.04 package sources. You normally add MongoDB's own package repository first, then install it. Follow the MongoDB link above for the current instructions.
- Python is needed because npm uses it to build some native modules during the install.
- Make sure MongoDB is actually running before you start Let's Chat. If it is not, the app cannot connect to its database and the server will not come up.
- You need a user with sudo rights to install packages and to create the service later.
Download and install Let's Chat
Download and install Let's Chat Ubuntu by pulling the source code from GitHub, installing the required packages with npm, and launching the chat server. You run these terminal commands to fetch the project files, set up your project dependencies, and get the chat application running on your local machine.
To install, run these commands:
- Open a terminal on your Ubuntu server.
- Run the commands in the block below one after another. The first one downloads the project from GitHub, and the next ones install the dependencies with npm.
- Wait for npm to finish. You should be returned to the prompt without errors. If npm stops with a build error, check that Python 3 and your Node.js version match the prerequisites above.
git clone https://github.com/sdelements/lets-chat.git cd lets-chat npm install
Copy the settings file and start the server:
- Run the commands in the block below to create your own settings file from the example file that ships with the project. Keeping a separate copy means your changes are not mixed up with the project's defaults.
- Open the new settings file in a text editor if you need to change anything, such as the database address. The defaults work when MongoDB runs on the same machine.
- Start the server with the last command in the block. The terminal should show the app starting and stay busy while the server runs.
cp settings.yml.sample settings.yml npm start
You can reach the site at http://localhost:5000. Open that address in a browser on the server itself, or use the server's IP address and port 5000 from another computer on the same network. If you cannot connect from another machine, check whether a firewall such as UFW is blocking port 5000.
The first time you open the page, you register an account. Press Ctrl+C in the terminal to stop the server when you are only testing.

General: Setting up Nginx and HTTPS
Setting up Nginx and HTTPS for an install Let's Chat Ubuntu deployment requires installing the Nginx web server, creating a server block configuration file, and using Certbot to secure your connection. This reverse proxy setup lets users access your chat room safely over an encrypted web address.
Certbot needs the domain to resolve to this machine, and ports 80 and 443 must be open to the internet.
- Install Nginx with the command in the block below.
- Once the install finishes, Nginx should be running. Opening your server's IP address in a browser should show the default Nginx welcome page.
sudo nano /etc/nginx/conf.d/letschat.conf
Add your server configuration pointing to port 5000. In the server block, set your domain name as the server name and pass requests to the Let's Chat app on port 5000. Chat uses a live connection, so the proxy settings must also allow connection upgrades. Without that, the page may load but messages will not arrive in real time.
Save the file and enable the site as your Nginx layout requires. Then check the configuration for errors and reload Nginx before moving on.
Once configured, use Certbot to enable HTTPS:
- Run the Certbot commands in the block below.
- Enter your email address and agree to the terms when Certbot asks.
- Choose your domain from the list, and let Certbot update the Nginx configuration for you.
- Confirm success when Certbot reports that the certificate was issued. Your site should now load at https:// with a padlock.
Let's Encrypt certificates last 90 days. The Certbot package on Ubuntu normally sets up automatic renewal, so you should not have to renew by hand.
sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d yourdomain.com
Create a Let's Chat systemd file
Creating a systemd service file for an install Let's Chat Ubuntu deployment lets the chat application run automatically in the background as a background service. You set up a dedicated system user and write a service configuration so the chat server starts up again after a system reboot.
Otherwise the service cannot use port 5000.
Start by creating a dedicated system user. Running the app as its own user, not as root or your own login, limits the damage if the app is ever compromised.
sudo useradd -r -s /bin/false letschat sudo chown -R letschat:letschat /path/to/lets-chat
Create the service file:
- Run the command in the block below. It opens a new file in a text editor with sudo rights, because service files live in a protected system folder.
- Leave the editor open so you can paste in the content from the next step.
sudo nano /etc/systemd/system/letschat.service
Add this content:
The content below tells systemd which user runs the app, where the project folder is, which command starts it and when to restart it. Check that the paths match where you cloned Let's Chat. A wrong path is the most common reason the service fails to start. Save the file and close the editor.
[Unit] Description=Let's Chat Server After=network.target mongod.service [Service] Type=simple User=letschat WorkingDirectory=/path/to/lets-chat ExecStart=/usr/bin/npm start Restart=always [Install] WantedBy=multi-user.target
Reload and start the service:
- Run the commands in the block below. The first makes systemd read your new service file.
- The next commands enable the service at boot and start it now.
- Check the service status. It should show active (running). If it shows failed, read the log lines in the status output. They usually point to a wrong path, a missing file or MongoDB not running.
To undo this later, stop and disable the service, then delete the service file.
sudo systemctl daemon-reload sudo systemctl start letschat sudo systemctl enable letschat
Access Let's Chat portal
Restart Nginx to apply your changes. Visit your domain name in your browser to log in and start chatting. If you see a 502 Bad Gateway error, the app is not running on port 5000, so check the service status first.
To confirm the setup survives a restart, reboot the server once and open the site again. It should come back without you starting anything.

[Unit]
[Service]
[Install]
Have a question about this guide?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!