26.8 C
Texas

How To Install Ejabberd XMPP Server On Ubutnu 20.04

Today we are going to learn that how to install Ejabberd XMPP Server on Ubuntu 20.04. Follow the below steps for an easy and quick installation.

Ejabberd is an open source XMPP Server specially designed for speed and the efficiency having support for SQL, LDAP, Mnesia or the external scripts. It uses Mnesia(distributed internal Erlang database) to persist data but other DB systems are also supported like SQL and NoSQL databases(Riak).

Some important features of Ejabberd XMPP Server are given below:

  • Store-and-forward (offline messages)
  • Contact list and presence
  • One-to-one messaging
  • User presence extension: Personal Event Protocol (PEP) and typing indicator
  • User profile with vCards
  • Group chat
  • Messaging archiving with Message Archive Management (MAM)
  • Message Delivery Receipts
  • 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

Step 1: Update Your System

As usual we do, first of all update your system to have the latest updates installed.

- Advertisement -
sudo apt -y update

Step 2: Download Ejabberd Package

Visit the Ejabberd official page to download the latest version of ejabberd. Here I’m going to use the 20.04 version.

EJ_VERSION=20.04

I’ll download the package with the help of wget.

sabir@foreman:~$ wget https://static.process-one.net/ejabberd/downloads/20.04/ejabberd_${EJ_VERSION}-0_amd64.deb
--2020-08-01 09:50:52-- https://static.process-one.net/ejabberd/downloads/20.04/ejabberd_20.04-0_amd64.deb
Resolving static.process-one.net (static.process-one.net)… 13.225.87.114, 13.225.87.70, 13.225.87.71, …
Connecting to static.process-one.net (static.process-one.net)|13.225.87.114|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 18476816 (18M) [application/x-deb]
Saving to: ‘ejabberd_20.04-0_amd64.deb.1’
ejabberd_20.04-0_am 100%[==================>] 17.62M 3.13MB/s in 8.4s
2020-08-01 09:51:02 (2.09 MB/s) - ‘ejabberd_20.04-0_amd64.deb.1’ saved [18476816/18476816]

Verify that the package is downloaded by hitting.

abir@foreman:~$ ls -lh ejabberd_20.04-0_amd64.deb
-rw-rw-r-- 1 sabir sabir 18M اپریل 30 13:06 ejabberd_20.04-0_amd64.deb

Step 3: Install Ejabberd XMPP Server On Ubuntu 20.04

Once the package is downloaded, install it with the help of APT package manager. Type the following command in your terminal.

sudo apt install ./ejabberd_20.04-0_amd64.deb

Various actions will be performed by the installer.

A user named “ejabberd” will be created and the directory for this system user -/opt/ejabberd

Step 4: Start Ejabberd Services On Ubuntu 20.04

After the successful installation, start and enable the services on Ubuntu 20.04.

sudo cp $(sudo find / -name ejabberd.service) /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable --now ejabberd

Verify the status of ejabberd.

sabir@foreman:~$ sudo systemctl status ejabberd
● ejabberd.service - XMPP Server
Loaded: loaded (/etc/systemd/system/ejabberd.service; enabled; vendor pre>
Active: active (running) since Sat 2020-08-01 09:29:39 PKT; 28s ago
Process: 5281 ExecStart=/bin/sh -c /opt/ejabberd-20.04/bin/ejabberdctl sta>
Tasks: 29 (limit: 4623)
Memory: 47.7M
CGroup: /system.slice/ejabberd.service
├─5311 /opt/ejabberd-20.04/bin/epmd -daemon
├─5313 /opt/ejabberd-20.04/bin/beam.smp -K true -P 250000 -- -roo>
├─5323 erl_child_setup 65536
├─5354 inet_gethost 4
├─5355 inet_gethost 4
└─5404 /opt/ejabberd-20.04/lib/os_mon-2.4.7/priv/bin/memsup
اگست 01 09:29:34 foreman.example.com systemd[1]: Starting XMPP Server…
اگست 01 09:29:39 foreman.example.com systemd[1]: Started XMPP Server.
lines 1-16/16 (END)

Add ejabberdctl command location to your PATH

$ sudo find / -name ejabberdctl
/opt/ejabberd-20.04/bin/ejabberdctl

Then add path to the .bashrc file

sudo nano ~/.bashrc

And set it like you see here after.

PATH=$PATH:/opt/ejabberd-20.04/bin/

Finally source the file

source ~/.bashrc

Step 5: Add An Admin User To Ejabberd

Now, add the admin user for administrative purposes to Ejabberd.

Follow the below syntax to add the user.

ejabberdctl register <username> <server_hostname> <user_password>
jabberdctl register osradar ejabberd.example.com StrongPassword
User [email protected] successfully registered

Now, edit the ejabberd configuration file to provide the administrative rights to the XMPP account created above.

sudo nano /opt/ejabberd/conf/ejabberd.yml
acl:
     admin:
      user:
- "[email protected]"

User format:

"username@servername"

Step 6: Access Ejabberd Web Dashboard

You can find the ejabberd Web Admin at

http://server_ip_address_or_hostname:5280/admin/.

And verify if the port is bound.

ss -tunelp | grep 5280

Now, visit the above URL and then provide the credentials details as created earlier to login to the dashboard.

Upon visiting the link, You’ll see the similar Web Admin.

How To Install Ejabberd XMPP Server On Ubutnu 20.04
How To Install Ejabberd XMPP Server On Ubutnu 20.04

So, this is how you can install Ejabberd XMPP Server On Ubuntu 20.04

Please share this post and join our Telegram Channel.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article