In this recipe, we will learn how to install the Ejabberd XMPP server. We will be using an integrated installation package that is available from the Ejabberd download site. You can also install Ejabberd from the Ubuntu package repository, but that will give you an older, and probably outdated, version.
The following are the steps to install Ejabberd:
$ wget https://www.process-one.net/downloads/downloads-action.php?file=/ejabberd/15.11/ejabberd_15.11-0_amd64.deb -O ejabberd.deb
.deb
extension. Use the dpkg
command to install Ejabberd from this package:$ sudo dpkg -i ejabberd.deb
$ whereis ejabberd
$ sudo /opt/ejabberd-15.11/bin/ejabberdctl start
start
command does not create any output. You can check the server status with the ejabberdctl status
command:$ sudo /opt/ejabberd-15.11/bin/ejabberdctl status
http://server_ip:5280/admin
. It should ask you to log in, as shown in the following screenshot:admin
.ubuntu
and the admin JID is admin@ubuntu
. Once you have entered the correct username and password, an admin console will be rendered as follows:Ejabberd binaries are available as a Debian package. It includes a minimum Erlang runtime and all other dependencies. You can download the latest package from the Ejabberd download page.
The installer unpacks all the contents at the /opt/ejabberd-version
directory. You can get an exact location of the installation with the whereis
command. All executable files are generally located under the bin
directory. We will mostly be working with ejabberdctl
, which is a command line administrative tool. It provides various options to manage and monitor Ejabberd installation. You can see the full list of supported options by entering ejabberdctl
without any options.
The following screenshot shows the partial output of executing ejabberdctl
without any options:
If you have noticed, I am using sudo
with each ejabberdctl
command. You can avoid the use of the sudo
command by switching to the ejabberd
user, which is created at the time of Ejabberd installation. The installer creates a system user account, ejabberd
, and sets its home
directory to the Ejabberd installation directory, /opt/ejabberd-version
. You will still need to use sudo
to switch user accounts as the ejabberd
user has no password set. Use the following command to log in as the ejabberd
user:
$ sudo su ejabberd
In addition to creating the system user to run the Ejabberd process, the installer also creates an ejabberd
admin account. The username and password for the administrator account is set to admin
/admin
. Make sure that you change this password before using your server in production. The installation process also creates a default XMPP host. The hostname is set to match your server hostname. It can be modified from the configuration file.
Once the server has started, you can access the handy web administrative console to manage most of the Ejabberd settings. You can add new users, create access control lists and set access rules, check the participating servers (node
), and all hosted XMPP domains (host
). Additionally, you can enable or disable Ejabberd modules separately for each domain. That means if you are using the same server to host xmpp1.example1.com
and xmpp2.example2.com
, you can enable a multi-user chat for xmpp1.example1.com
and disable the same module for xmpp2.example2.com
.