<\/span><\/h2>\n\n\n\nTo install the Nginx web server, execute the following command:<\/p>\n\n\n\n
sudo apt install nginx -y<\/pre>\n\n\n\nOnce the installation is complete, start and enable the Nginx service:<\/p>\n\n\n\n
sudo systemctl start nginx && sudo systemctl enable nginx<\/pre>\n\n\n\nTo check the status of the Nginx service, you can execute the following command:<\/p>\n\n\n\n
systemctl status nginx<\/pre>\n\n\n\nYou should receive the following output:<\/p>\n\n\n\n
root@host:~# systemctl status nginx\n\u25cf nginx.service - A high performance web server and a reverse proxy server\n Loaded: loaded (\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: enabled)\n Active: active (running) since Tue 2023-10-10 03:47:12 CDT; 7s ago\n Docs: man:nginx(8)\n Main PID: 2401 (nginx)\n Tasks: 4 (limit: 4558)\n Memory: 4.0M\n CPU: 84ms\n CGroup: \/system.slice\/nginx.service\n \u251c\u25002401 \"nginx: master process \/usr\/sbin\/nginx -g daemon on; master_process on;\"\n \u251c\u25002402 \"nginx: worker process\"\n \u251c\u25002403 \"nginx: worker process\"\n \u2514\u25002404 \"nginx: worker process\"\n\nOct 10 03:47:12 host.test.vps systemd[1]: Starting A high performance web server and a reverse proxy server...\nOct 10 03:47:12 host.test.vps systemd[1]: Started A high performance web server and a reverse proxy server.<\/pre>\n\n\n\n<\/span>Step 3. Install MongoDB<\/span><\/h2>\n\n\n\nRocketChat needs a database service in order to function and store the information. We need to install the MongoDB database service. First, we will add the MongoDB repository and GPG key:<\/p>\n\n\n\n
wget -qO - https:\/\/www.mongodb.org\/static\/pgp\/server-6.0.asc | gpg --dearmor | sudo tee \/usr\/share\/keyrings\/mongodb.gpg > \/dev\/null\n\necho \"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<\/pre>\n\n\n\nOnce done, update the system and install MongoDB:<\/p>\n\n\n\n
sudo apt update\n\nsudo apt install mongodb-org<\/pre>\n\n\n\nOnce installed, start and enable the service:<\/p>\n\n\n\n
sudo systemctl start mongod && sudo systemctl enable mongod<\/pre>\n\n\n\nTo check the status of the MongoDB service, you can run the following command:<\/p>\n\n\n\n
sudo systemctl status mongod<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
root@host:~# sudo systemctl status mongod\n\u25cf mongod.service - MongoDB Database Server\n Loaded: loaded (\/lib\/systemd\/system\/mongod.service; enabled; vendor preset: enabled)\n Active: active (running) since Sun 2022-10-11 07:36:21 UTC; 2s ago\n Docs: https:\/\/docs.mongodb.org\/manual\n Main PID: 81644 (mongod)\n Memory: 57.1M\n CGroup: \/system.slice\/mongod.service\n \u2514\u250081644 \/usr\/bin\/mongod --config \/etc\/mongod.conf<\/pre>\n\n\n\n<\/span>Step 4. Install RocketChat on Ubuntu 22.04<\/span><\/h2>\n\n\n\nDownload and extract the latest RocketChat version:<\/p>\n\n\n\n
curl -L https:\/\/releases.rocket.chat\/latest\/download -o \/opt\/rocket.chat.tgz\n\ntar -xzf \/opt\/rocket.chat.tgz -C \/opt<\/pre>\n\n\n\nThen go to the directory where RocketChat is extracted and execute the following commands to install:<\/p>\n\n\n\n
mv \/opt\/bundle\/ \/opt\/RocketChat\n\ncd \/opt\/RocketChat\/programs\/server \n\nnpm install<\/pre>\n\n\n\n<\/span>Step 5. Create the RocketChat Service<\/span><\/h2>\n\n\n\nBefore we create the service, we need to create a system user which RocketChat will run as:<\/p>\n\n\n\n
sudo useradd -M rocketchat && sudo usermod -L rocketchat\n\nsudo chown -R rocketchat:rocketchat \/opt\/RocketChat<\/pre>\n\n\n\nOnce the user is created, configure the storage for MongoDB:<\/p>\n\n\n\n
sudo sed -i \"s\/^# engine:\/ engine: wiredTiger\/\" \/etc\/mongod.conf\n\nsudo sed -i \"s\/^#replication:\/replication:\\n replSetName: rs01\/\" \/etc\/mongod.conf\n<\/pre>\n\n\n\nOnce this is added, we need to create the service file:<\/p>\n\n\n\n
touch \/lib\/systemd\/system\/rocketchat.service<\/pre>\n\n\n\nOpen the file with your favorite text editor and paste the following lines of code:<\/p>\n\n\n\n
[Unit]\nDescription=The Rocket.Chat server\nAfter=network.target remote-fs.target nss-lookup.target nginx.service mongod.service\n[Service]\nExecStart=\/usr\/bin\/node \/opt\/RocketChat\/main.js\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=rocketchat\nUser=rocketchat\nEnvironment=MONGO_URL=mongodb:\/\/localhost:27017\/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb:\/\/localhost:27017\/local?replicaSet=rs01 ROOT_URL=http:\/\/localhost:3000\/ PORT=3000\n\n[Install]\nWantedBy=multi-user.target<\/pre>\n\n\n\nReload the Daemon and start the RocketChat service. You should also enable the service to run on startup:<\/p>\n\n\n\n
sudo systemctl daemon-reload\n\nsudo systemctl start rocketchat\n\nsudo systemctl enable rocketchat<\/pre>\n\n\n\nWith this, your RocketChat instance is running! You can access it at http:\/\/<server IP address>:3000<\/strong> .<\/p>\n\n\n\n<\/span>Step 6. Configure RocketChat with an Nginx Reverse Proxy<\/span><\/h2>\n\n\n\nCreate the Nginx configuration file.<\/p>\n\n\n\n
touch \/etc\/nginx\/sites-enabled\/rocketchat.conf<\/pre>\n\n\n\nOnce created, open it with your favorite text editor and paste the following lines of code:<\/p>\n\n\n\n
server {\n listen 80;\n server_name YourDomainNameHere;\n access_log \/var\/log\/nginx\/rocket_access.log;\n error_log \/var\/log\/nginx\/rocket_error.log;\n\n location \/ {\n proxy_pass http:\/\/127.0.0.1:3000\/;\n proxy_http_version 1.1;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection \"upgrade\";\n proxy_set_header Host $http_host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forward-Proto http;\n proxy_set_header X-Nginx-Proxy true;\n }\n}\n<\/pre>\n\n\n\nSave the file, close it and check the Nginx configuration for syntax errors with the following command:<\/p>\n\n\n\n
nginx -t<\/pre>\n\n\n\nIf everything is OK, you should receive the following output:<\/p>\n\n\n\n
root@host:~# nginx -t\nnginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nnginx: configuration file \/etc\/nginx\/nginx.conf test is successful\n<\/pre>\n\n\n\nRestart the Nginx service, and access your RocketChat installation at http:\/\/YourDomainName<\/b><\/p>\n\n\n\n
The interface is very intuitive, and you will need to create an organization name, set up an admin account, and of course a strong password. <\/p>\n\n\n\n
If you find it difficult to set up such a configuration, you can always contact our technical support and they will do the rest. We are available 24\/7 and we will make your server run smoothly in no time.<\/p>\n\n\n\n
If you liked this post on how to install RocketChat on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks. <\/p>\n","protected":false},"excerpt":{"rendered":"
RocketChat is an open-source fully customizable communication platform written in Javascript. RocketChat offers a variety of features such as real-time … <\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":47114,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2072,13,1698],"tags":[971,59],"yoast_head":"\nHow to Install RocketChat on Ubuntu 22.04 - RoseHosting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n\t \n\t \n\t \n