How To Install Chatwoot Live Chat on Ubuntu 24.04

In our last article we were able to install Chatwoot using Docker Container. This article will cover the alternative method of installing Chatwoot on Ubuntu 24.04 without using Docker Container. Chatwoot is a powerful open source software application used to manage customer interactions in a company across various communication channels like WhatsApp, Live Chat, Email, Social Media platforms.

With Chatwoot you will access all communications from a unified inbox and respond to customer queries with ease and efficiently. For live chat, you get embedded widget to use in your website for real-time customer support. Workflows enables you to automate repetitive tasks and measure support performance across teams using Chatwoot detailed reporting and analytics.

Install Chatwoot on Ubuntu 24.04

We will use an installer script that automates the setting up of Chatwoot on Ubuntu 24.04.

1) Prerequisites

For this deployment to succeed you will need:

For my server an A record exists in DNS 95.67.14.38 pointing to livechat.cloudspinx.com.

2) Download Installer Script

Update your OS package list index and install wget tool.

sudo apt update && sudo apt install wget vim nano -y

Use wget to download Chatwoot deployment script.

wget https://get.chatwoot.app/linux/install.sh

Make the script downloaded executable.

chmod +x install.sh

3) Install Chatwoot on Ubuntu 24.04

Execute the script which will handle the initial setup of Chatwoot.

sudo ./install.sh --install

The installation script will ask if you want to configure domain and SSL. If you are on a Cloud Instance with A record mapped to your DNS name, then agree to this.

***************************************************************************
              Chatwoot Installation (v3.10.2)
***************************************************************************

For more verbose logs, open up a second terminal and follow along using,
'tail -f /var/log/chatwoot-setup.log'.

Would you like to configure a domain and SSL for Chatwoot?(yes or no): yes

Next provide your domain or sub-domain for Chatwoot installation.

Enter the domain/subdomain for Chatwoot (e.g., chatwoot.domain.com): livechat.cloudspinx.com

For Let’s Encrypt expiry reminders you are required to provide your email address.

Enter an email address for LetsEncrypt to send reminders when your SSL certificate is up for renewal: [email protected]

The script will help you with the generation of SSL certificates using Let’s Encrypt.

This script will generate SSL certificates via LetsEncrypt and
serve Chatwoot at https://livechat.example.com.
Proceed further once you have pointed your DNS to the IP of the instance.

Do you wish to proceed? (yes or no): yes

Accept installation of Postgres and Redis on the Ubuntu server.

Would you like to install Postgres and Redis? (Answer no if you plan to use external services)(yes or no): yes

Wait for a few minutes as the downloading and configuration of Chatwoot services proceeds.

➥ 1/9 Installing dependencies. This takes a while.
➥ 2/9 Installing databases.
➥ 3/9 Installing webserver.
➥ 4/9 Setting up Ruby
➥ 5/9 Setting up the database.
➥ 6/9 Installing Chatwoot. This takes a long while.
➥ 7/9 Running database migrations.
➥ 8/9 Setting up systemd services.
➥ 9/9 Setting up SSL/TLS.

If all goes well you will get a success message similar to the one shown below.

***************************************************************************
Woot! Woot!! Chatwoot server installation is complete.
The server will be accessible at https://livechat.example.com

Join the community at https://chatwoot.com/community?utm_source=cwctl
***************************************************************************

🚀 Try out the all new Chatwoot CLI tool to manage your installation.
🚀 Type "cwctl --help" to learn more.

Access Chatwoot web application over https – https://yourdomain

After account creation and login you will see dashboard like below.

4) Configure Chatwoot Environment

Here we will perform the bare minimum, for more explanations refer to the official Environment variables list.

Switch to chatwoot user account.

sudo -i -u chatwoot

Then open .env file for editing.

cd chatwoot
vim .env || nano .env

Update required variables in .env file by referring to Environment variables. Save the file when done and restart chatwoot.target.

exit
sudo systemctl restart chatwoot.target

The service can also be restarted by running the commands sudo cwctl -r.

$ sudo cwctl -r
● chatwoot.target
     Loaded: loaded (/etc/systemd/system/chatwoot.target; enabled; preset: enabled)
     Active: active since Wed 2024-07-03 23:44:56 UTC; 14ms ago

Jul 03 23:44:56 chats.cloudspinx.com systemd[1]: Reached target chatwoot.target.

To check logs from the rails server, run:

journalctl -u chatwoot-web.1.service -f

Viewing sidekiq logs.

journalctl -u chatwoot-worker.1.service -f

5) Enabling IP Logging

Chatwoot allows you to identify your user’s location by geocoding the IP address. Th service used for this is MaxmindDB. Follow below steps to configure your Chatwoot instance with the geocoding.

Step 1: Sign up for a MaxmindDB account and create an API key.

After it’s generated copy or download config file.

Step 2: Open .env file and add the following environment variables.

$ su - chatwoot
$ vim chatwoot/.env||nano chatwoot/.env
IP_LOOKUP_API_KEY=paste-your-api-key

Chatwoot would automatically download the MaxmindDB downloadable databases and cache it locally.

Restart service.

sudo cwctl -r
#OR
sudo systemctl restart chatwoot.target

Step 3: Enable IP Lookup on your account.

Login to your Chatwoot dashboard access “Super Admin Console“.

Select your account and click “edit

Toggle the ip_lookup feature.

Option 2 is to use Rails Console.

sudo su - chatwoot
cd chatwoot
RAILS_ENV=production bundle exec rails console

account_id = 1 // Please fill your account id instead of 1
account = Account.find(account_id)
account.enable_features('ip_lookup')
account.save!

References and more reading:

Contact us for support with the installation, configurations and usage of Chatwoot on Ubuntu or any other Linux distribution. We are available to help ASAP.

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

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

Related Post

Let’s clarify the differences between merge requests (commonly called pull requests in GitHub), releases, release candidates (RCs), tags, and branches […]

Kind (which in full means “Kubernetes IN Docker”), is a command line tool that enables you to run Kubernetes clusters […]

Are you looking for an easy way to migrate packages from one cPanel server to a new cPanel server? In […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.