Install and configure ejabberd jabber IM Server

by jagbir on July 9, 2008

ejabberd, as described in its home page:
” ejabberd is a distributed, fault-tolerant technology that allows the creation of large-scale instant messaging applications.The server can reliably support thousands of simultaneous users on a single node and has been designed to provide exceptional standards of fault tolerance. As an open source technology, based on industry-standards, ejabberd can be used to build bespoke solutions very cost effectively.”

Describing here Instructions I followed to install and configure ejabberd in CentOS 5:

Step 1. Download the current stable version of ejabberd from its official site. While writing this article the stable version was 2.0.6. I’ve download the binary file for 32 bit Linux machine and uncompress it:

$ cd /opt
$ wget 
$ gunzip ejabberd-2.1.6-linux-x86-installer.bin.gz
$ chmod +x ejabberd-2.1.6-linux-x86-installer.bin

and execute the installer:

$ ./ejabberd-2.1.6-linux-x86-installer.bin

The installer begins and completes few steps like asking you to accept license, enter hostname for server (something like, administrator username and password, select location (in my case, its /opt/ejabberd-2.1.6/) to install etc. It should install quickly without any problem.

Step 3. Start the Server:

$ /opt/ejabberd-2.1.6/bin/ejabberdctl start

ejabberd will be started. You should be able to get its admin interface using port 5280. If your server has GUI installed, open your favorite browser and enter: http://localhost:5280/admin/, in case GUI not there (as common in Servers), you can follow SSH port forwarding tutorial from this site to access its Web Admin Interface in your machine.

Enter the username and password you created when installation in web admin interface authentication. You should be able to several menu items. Let’s create some users now for testing purposes: select ‘Virtual Host’ option, then the hostname of your server (initially you should see only one host i.e., select it. You should see several menu options, there’s an option there named ‘Users’. select it to create a new user and see the list of existing users, if any.

Update your DNS Server to include your new Jabber Server and Test it out with your favourite client. Some popular IM Clients which support Jabber are: Pidgin, Soapbox, Psi, Exodus etc.

Step 4. Configure ejabberd
We will now update configuration of ejabberd to suite our taste. Please note that these settings are entirely optional.

* Max Sessions: A user can connect/login from one location at a time. (by default, a user can simultaneously connect from 10 locations).
Solution: open config file (/opt/ejabberd-2.1.6/conf/ejabberd.cfg), jump to line number 333 and change default 10 to 1. or search for ‘max_user_sessions’ if you dont find the line.

* vCards: Better support for vCards, like easy searching for people.
Solution: Goto line 433 (or search for mod_vcard) and enter following inside capital brakets []:

{search, true}, {matches, infinity}, {allow_return_all, true}, {search_all_hosts, false}

* Administrative Rights: Assign admin rights to some users so that they can perform administrative tasks.
Solution: Goto line 306 (or search for ‘acl, admin’) and add lines for each user whom you want to assing admin rights, such as:

{acl, admin, {user, "admin", ""}}.
{acl, admin, {user, "maharana", ""}}.
{acl, admin, {user, "katrina", ""}}.

* External authentication: Authentication from MySQL Database using external script.
Solution: Comment the line (no. 192 or nearby) which state: {auth_method, internal} and remove comments from line (no. 198 or nearby) and update it with your authentication script path, such as:

{auth_method, external}.
{extauth_program, "php /opt/ejabberd-2.1.6/auth/jabber_ext_auth.php"}.

Save the config file and restart the ejabberd Server.

$ /opt/ejabberd-2.1.6/bin/ejabberdctl restart

Check it now and let me know if there’s any issue via posting comment here.

You may also like to read:
* 5 steps to secure your Linux Server
* Ensuring secure access to production Linux Servers
* Bash script to backup essential log files in Linux
* Quickly change your ssh port from defualt 22 to something higher
* SSH port forwarding from remote to local machine
* Save root or user history to check later
* Install and configure denyhost to prevent brute force attacks

  • Nappy_d

    OK I have tried these steps 100x over and the password I enter in the setup NEVER works. Any ideas?

  • Eldho


    How can I create a conference room in ejabberd?



    Just unregister and register again admin user via ejabberdctl.


    root@server [/opt/ejabberd/bin]# ./ejabberdctl unregister admin
    root@server [/opt/ejabberd/bin]# ./ejabberdctl register admin password

  • Eduardo Costa

    @Nappy_d – I know this sound stupid, but are you trying to login using “admin@domain” or just “admin”? I admit I was using only “admin” (with no success, of course)… :)

    • hensem

      use admin@domain

  • daminda

    hey with
    try user name with your domain

  • green


    after install ejabberd, i can’t register new user from pidgin in windows xp client
    any ideas?

    • hensem

      you need to edit config file. allow from all, not from trusted only

Previous post:

Next post: