Install Ejabberd XMPP Server on Ubuntu 20.04

July 14, 2020

Ejabberd is an open source XMPP server designed for speed and efficiency. This tool has been built from the ground-up with fault-tolerance, easy configurations, and scalability. Scaling up is a matter of adding extra Virtual Machines to the cluster. Ejabberd has support for authenticating modules such as Mnesia, SQL, LDAP or through the use of external scripts. This article will walk you through the steps you’ll need to install Ejabberd XMPP Server on Ubuntu 20.04.

Ejabberd makes use ofMnesia(distributed internal Erlang database) to persist data, but other database systems are supported. This includes;

  • SQL databaseslike MySQL or PostgreSQL
  • NoSQL databaseslikeRiak(also written in Erlang)

Key Features of Ejabberd XMPP Server

Ejabberd is designed to be modular to ensure high levels of customizations and easy access to the required features.

  • 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.

    1)sudo apt-get update

    Copy link by right click according to your platform from

    https://www.process-one.net/en/ejabberd/downloads/

    1. wget https://www.process-one.net/downloads/downloads-action.php?file=/20.07/ejabberd-20.07-linux-x64.run

    Check the file is download or not by command ls Result ‘downloads-action.php? file=%2F20.07%2Fejabberd-20.07-linux-x64.run’

    1. chmod +x downloads-action.php?file=%2F20.07%2Fejabberd-20.07-linux-x64.run full access
    2. ./downloads-action.php?file=%2F20.07%2Fejabberd-20.07-linux-x64.run
    3. Choose your lang
    4. Now agree to the license by enter --- enter
    5. Now choose your install path or

    in my case Installation Directory [/opt/ejabberd-20.07]:

    8)ejabberd server domain [Xmpp]:

    if your point the domain then use your domain or otherwise go with localhost,

    1. setting the administrator username, setting the administrator password,
    2. selecting if this ejabberd instance will be part of a cluster: for simple local install, just select “No”, start the installation,

      11)go to the installation folder check 7th setup path

    and execute ./bin/ejabberdctl live

    For Example

root@Xmpp:~# cd /opt/ root@Xmpp:/opt# ls
ejabberd  ejabberd-20.07 
root@Xmpp:/opt# cd ejabberd-20.07/
root@Xmpp:/opt/ejabberd-20.07# ls
bin  doc  lib  logs  uninstall  uninstall.dat
root@Xmpp:/opt/ejabberd-20.07# ./bin/ejabberdctl live

or you directly use ejabberdctl command by doing this 

nano ~/.bashrc
then line at the top of file - PATH=$PATH:/opt/ejabberd-20.07/bin/
Apply source by using this command - source ~/.bashrc
Then Reboot and Login 
Try this command to verify - ejabberdctl

Change Host and Domain name by changes in ejabberd.yml

Path : /opt/ejabberd/conf/ejabberd.yml

  1. Configure this:

Make sure that Jabber clients in other machines know that 1.1.1.1 is the IP address of the machine where you have ejabberd installed. Otherwise, instead of “1.1.1.1”, you must put the real IP address, or the machine network name.

  1. Grant admin rights to an account
  2. Create that account:
  3. Now you can login to that account with a Jabber client. And WebAdmin must show all the admin pages

you can change 1.1.1.1 do your doamin also

Step 5: Access ejabberd Web Admin

  • The Web Admin should be accessible on http://serveripaddressorhostname:5280/admin/.

    Check if the port is bound:

    ss -tunelp | grep 5280

    If you have ufw firewall, allow port5280:

    sudo ufw allow 5280

    Open the ejabberd web URL in your browser. Input the username and password configured earlier

    You have installed Ejabberd XMPP server on Ubuntu successfully.

Set up Adium for XMPP chat

Follow these steps to connect SmarterMail chat using Adium’s Setup Assistant:

  1. When the Assistant opens, it asks you to select aService. In the dropdown, chooseXMPP (Jabber).
  2. For theJabber ID, enter your full SmarterMail email address. (E.g., user@example.com)
  3. For thePassword, enter your SmarterMail account password. Hit the Continue button.
  4. Adium will display some brief text once the connection is complete. Hit the Done button and you should see a list of other users on your domain and you’re ready to go!

If need be, you can also set up your account manually. Below are instructions on how to do that.

  1. Open Adium.
  2. Click theFilemenu and clickAddAccounts.
  3. SelectXMPP (Jabber)and enter your SmarterMail username and password on theAccounttab.
  4. Click thePersonaltab.
  5. In the Alias field, enter what you want displayed as your name in chat.
  6. Click theOptionstab.
  7. In theConnectServerfield, enter your domain, such as example.com.
  8. In theResourcefield, enter a unique name for the device you’re running the client on. For example, “Work Laptop”. As the XMPP protocol allows you to connect to your account from multiple devices, being able to distinguish between those devices is important.
  9. Select theAllow plain text authenticationcheckbox.
  10. Click thePrivacytab.
  11. In theEncryptionfield, selectEncryptchats as requested.
  12. ClickDone.

Written by Manoj Bhardwaj who lives and works in Mohali Punjab (India). My stackoverflow