---
title: "Complete Guide: How to Install RocketChat on Ubuntu 22.04 with Nginx - CloudBlast"
description: "Complete Guide: How to Install RocketChat on Ubuntu 22.04 with Nginx"
url: "https://cloudblast.io/article/Complete-Guide:-How-to-Install-RocketChat-on-Ubuntu-22.04-with-Nginx"
language: "en-US"
---

BLOG

# Complete Guide: How to Install RocketChat on Ubuntu 22.04 with Nginx

5€ FREE BALANCE when you register

Register to cloudblast and get 5€ cloud credit to deploy your VPS's

[Claim Free 5€](https://console.cloudblast.io/auth/login?ref=2)

-   [Back](https://cloudblast.io/)
-   [All Articles](https://cloudblast.io/blog)

2024-08-26

### Complete Guide: How to Install RocketChat on Ubuntu 22.04 with Nginx

tutorials

Are you looking for a powerful, open-source communication platform for your team or organization? Look no further! This comprehensive guide will walk you through the process of installing RocketChat on Ubuntu 22.04, using Nginx as a reverse proxy. Whether you're an IT professional or a tech enthusiast, this step-by-step tutorial will help you set up your own RocketChat server in no time.

**Why Choose RocketChat?**

1\. Open-Source: Fully customizable to fit your needs
2\. Real-Time Communication: Instant messaging and collaboration
3\. Flexibility: Host on your own servers for complete control
4\. High Security: Strong data protection standards
5\. Scalability: Grows with your organization

**Prerequisites**

Before we begin, make sure you have:

\- A VPS running Ubuntu 22.04
\- Root access or a user with sudo privileges
\- A domain name pointed to your server's IP address

**Step-by-Step Installation Guide**

**Step 1: Update Your System**

First, let's ensure your Ubuntu system is up-to-date:

>
> sudo apt-get update -y && sudo apt-get upgrade -y
>  

**Step 2: Install Nginx**

Install the Nginx web server:

>
> sudo apt install nginx -y
> sudo systemctl start nginx && sudo systemctl enable nginx
>  

Verify Nginx is running:

>
> systemctl status nginx
>  

**Step 3: Install MongoDB**

Add the MongoDB repository and GPG key:

>
> wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc |  gpg --dearmor | sudo tee /usr/share/keyrings/mongodb.gpg > /dev/null
> echo "deb \[ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb.gpg \] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
>  

Install MongoDB:

>
> sudo apt update
> sudo apt install mongodb-org
> sudo systemctl start mongod && sudo systemctl enable mongod
>  

Verify MongoDB is running:

>
> sudo systemctl status mongod
>  

**Step 4: Install RocketChat**

Download and extract RocketChat:

>
> curl -L https://releases.rocket.chat/latest/download -o /opt/rocket.chat.tgz
> tar -xzf /opt/rocket.chat.tgz -C /opt
> mv /opt/bundle/ /opt/RocketChat
> cd /opt/RocketChat/programs/server
> npm install
>  

**Step 5: Create the RocketChat Service**

Create a system user for RocketChat:

>
> sudo useradd -M rocketchat && sudo usermod -L rocketchat
> sudo chown -R rocketchat:rocketchat /opt/RocketChat
>  

Configure MongoDB storage:

>
> sudo sed -i "s/^#  engine:/  engine: wiredTiger/"  /etc/mongod.conf
> sudo sed -i "s/^#replication:/replication:\\n  replSetName: rs01/" /etc/mongod.conf
>  

Create and configure the RocketChat service file:

>
> sudo nano /lib/systemd/system/rocketchat.service
>  

Add the following content:

> ini
> \[Unit\]
> Description=The Rocket.Chat server
> After=network.target remote-fs.target nss-lookup.target nginx.service mongod.service
> \[Service\]
> ExecStart=/usr/bin/node /opt/RocketChat/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
>  

Start and enable the RocketChat service:

>
> sudo systemctl daemon-reload
> sudo systemctl start rocketchat
> sudo systemctl enable rocketchat
>  

**Step 6: Configure Nginx as a Reverse Proxy**

Create an Nginx configuration file for RocketChat:

>
> sudo nano /etc/nginx/sites-enabled/rocketchat.conf
>  

Add the following content (replace YourDomainNameHere with your actual domain):

>
> server {
>   listen 80;
>   server\_name YourDomainNameHere;
>   access\_log /var/log/nginx/rocket\_access.log;
>   error\_log /var/log/nginx/rocket\_error.log;
>
>   location / {
>     proxy\_pass http://127.0.0.1:3000/;
>     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;
>   }
> }
>  

Check Nginx configuration and restart:

>
> nginx -t
> sudo systemctl restart nginx
>  

**Congratulations!**

You've successfully installed RocketChat on your Ubuntu 22.04 server with Nginx as a reverse proxy. Access your new RocketChat instance at \`http://YourDomainName\` and follow the on-screen instructions to set up your organization.

**Pro Tips for RocketChat Success**

1\. Security First: Implement SSL/TLS encryption for secure communications.
2\. Regular Backups: Set up automated backups of your RocketChat data and configurations.
3\. Stay Updated: Keep your RocketChat installation, Ubuntu system, and all components up-to-date.
4\. Monitoring: Implement server monitoring to ensure smooth operation and quick problem resolution.

By following this guide, you've taken a significant step towards enhancing your team's communication and collaboration capabilities. RocketChat's powerful features, combined with the stability of Ubuntu 22.04 and the performance of Nginx, create an unbeatable combination for modern organizations.

Remember, the world of open-source communication platforms is ever-evolving. Stay engaged with the RocketChat community, explore new features, and customize your instance to make the most of this powerful tool.

Happy chatting with RocketChat on Ubuntu 22.04!

Share

## Continue Reading

[2026-07-25 How to Install and Set Up Mailcow on Ubuntu and Debian VPS tutorials](https://cloudblast.io/article/how-to-install-and-setup-mailcow-on-ubuntu-and-debian-vps)

[2026-07-25 How to Install Chatwoot on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-chatwoot-on-ubuntu-and-debian-server)

[2026-07-25 How to Install Mattermost on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-mattermost-on-ubuntu-and-debian-server)

[2026-07-25 How to Install RustDesk on the Latest Ubuntu and Debian Server tutorials](https://cloudblast.io/article/how-to-install-rustdesk-on-ubuntu-and-debian-server)
