How to install Ejabberd on RHEL 8?. Ejabberd is a free and open source XMPP server written in Erlang. Ejabberd has been designed for scalability and fault-tolerance. It has a small resource footprint and can run on any Unix like Operating system – Linux, FreeBSD, Solaris, macOS, OpenBSD, and others.

The default data store used by Ejabberd is Mnesia (the distributed internal Erlang database) but you can use SQL or NoSQL database server.

Features of Ejabberd XMPP Server

Ejabberd has a modular architecture which allows for high customisability and easy access to the required features, which includes:

  • Store-and-forward (offline messages)
  • Contact list (roster) and presence
  • One-to-one messaging
  • User presence extension: Personal Event Protocol (PEP) and typing indicator
  • User profile with vCards
  • Group chat: MUC (Multi-User Chat)
  • Messaging archiving with Message Archive Management (MAM)
  • Message Delivery Receipts (aka XEP-184)
  • Privacy settings, through privacy list and simple blocking extensions
  • Last activity
  • Metrics and full command-line administration
  • Full feature web support, with BOSH and web sockets
  • Stream management for message reliability on mobile (aka XEP-0198)
    and many many more.

How to install Ejabberd XMPP Server on RHEL 8

Ejabberd is packaged as RPM file which can be easily downloaded and installed with rpm package manager. If you have an ardor of compiling from source, do it.

Step 1: Update system

As usual, you need to work on updated system

sudo yum -y update

Step 2: Download and Install Ejabberd RPM package

After the update, download the Ejabberd RPM package. You’ll need to check for the latest release before doing the actual download.

As of this writing, the available version is 18.12.1

sudo yum -y install wget
export VER="18.12.1"

Install Downloaded RPM package by running the command:

sudo yum localinstall ejabberd-$VER-0.x86_64.rpm

This will place ejabberd init script under /etc/init.d/ejabberd

  • A system user called ‘ejabberd‘ is created
  • ejabberd application directory is /opt/ejabberd. This is a home for the ejabberd user.
  • When ejabberd is started, the processes that are started in the system are beam or beam.smp, and also epmd.

Step 3: Start Ejabberd service

Now that we have done the installation, we need to start the service and enable it to start automatically when the server is rebooted.

Locate ejabberd.service and copy it to /etc/systemd/system

sudo yum -y install mlocate
sudo updatedb
sudo cp $(locate ejabberd.service) /etc/systemd/system

Then reload systemd

sudo systemctl daemon-reload

Once the new ejabberd service is detected, start it

sudo systemctl enable --now ejabberd

You can confirm that the service is in running state.

systemctl status ejabberd

Step 4: Create ejabberd XMPP admin account.

You need an admin XMPP account for accessing the Web Admin dashboard.

Change your working directory to cd /opt/ejabberd-${VER}/bin

cd /opt/ejabberd-${VER}/bin

Add admin account

# ./ejabberdctl register myadmin localhost mystrongPassword
User [email protected] successfully registered

You may need to replace localhost with your actual server hostname. Other user accounts should be added in a similar manner.

./ejabberdctl register testuser localhost testuserpassword

Edit the ejabberd configuration file to give administration rights to the XMPP account you created /opt/ejabberd/conf/ejabberd.yml

user_regexp: ""
- ""
- "::1/128"
- "::FFFF:"
- "[email protected]"
- "[email protected]"

Restart ejabberd service.

sudo systemctl restart ejabberd

Step 4: Configure firewall and Access UI

Allow Ejabberd UI port on the firewall.

sudo firewall-cmd --add-port=5280/tcp --permanent
sudo firewall-cmd --reload

The Web Admin should be accessible onĀ  http://ip-address:5280/admin/. Open the URL using your favorite browser. Login with full username with domain name, e.g [email protected].

For further reading on Ejabberd administration, refer to the official documentation.

For Ubuntu/Debian users, you can install Ejabberd XMPP server using the guide: How to Install XMPP Server on Ubuntu / Debian