
ejabberd is XMPP server software which can be used for instant messaging on your own server. In this tutorial, you will be able to learn how to properly install and configure ejabberd on Ubuntu Server.
With that, let’s get started.
Step 1: Download & Install
ejabberd is available in the Ubuntu repositories, so it’s easy to download and install.
Simply run:
sudo apt-get install ejabberd
Step 2: Configure
Open up the ejabberd configuration file by running:
sudo nano /etc/ejabberd/ejabberd.cfg
*If you prefer an editor other than nano, you can obviously substitute that for the file above.
In the config file, locate the following:
%% Hostname {hosts, ["localhost"]}.
Change “localhost” to the correct hostname for your server. Directly above you”ll find the following:
XMPP: The Definitive Guide: Building Real-Time Applications with Jabber Technologies
%% Admin user {acl, admin, {user, “”, “localhost”}}.
Between the quotes, type whatever you want your admin username to be, and then change “localhost” to your hostname.
Once that’s done, reboot the ejabberd daemon:
sudo /etc/init.d/ejabberd restart
Practical Guide to Linux Commands, Editors, and Shell Programming, A (2nd Edition)
Substitute ”admin” for the username you created in the config file earlier. After that, substitute “localhost” for your hostname, and finally create a password for your admin account, replacing “password” as shown above.
If all went well, you can now access the web interface for ejabberd by browsing over to http://yourhostname:5280/admin. Type in your username and hostname when prompted. You will need to type in your username and hostname together like this (without the quotes): “admin@hostname“. After that, type in the password you created earlier. You should see the following:
Step 3: Connect to the ejabberd Server
It should now be possible to connect to your ejabberd server from an IM client that supports XMPP. We”ll try connecting using Empathy, the current default IM client in the desktop version of Ubuntu.
Select Jabber as your account type, and then type in the username you created earlier with the hostname as well as your password. An example is provided in the picture below.
Step 4: Finishing Up
Additional Accounts
You might want to create some more accounts for your friends or other computers in your network on the server. The best way to do this is by running ejabberdctl for each individual account you want to create.
sudo ejabberdctl register newuser localhost password
Additional Admin Accounts
To create an additional admin account, open the ejabberd.cfg file and locate:
%% Admin user {acl, admin, {user, “”, “localhost”}}.
Create a new line under this and add:
{acl, admin, {user, “”, “localhost”}}
Add your new username between the quotes and provide your hostname, replacing “localhost”. Finally, run ejabberdctl as shown in Step 2 for creating the admin account.
This tutorial was last updated on August 2nd, 2012.


