Tutorial

How To Install eJabberd XMPP Server on Ubuntu

Published on June 4, 2013
author

By Bulat Khamitov

How To Install eJabberd XMPP Server on Ubuntu

First, we would have to spin up a Ubuntu 12.10 x64 droplet:

Next, login to your droplet via SSH as root.

Step 1 - Install eJabberd

apt-get -y install ejabberd

Step 2 - Setup Admin User

Change "password" to your own value:

ejabberdctl register admin localhost password

Give Admin Privileges

By default, hostname used by eJabberd is 'localhost', which can be modified from config file.

For our example we will call our admin user "admin@localhost" and modify the following lines in /etc/ejabberd/ejabberd.cfg:

%% Admin user
{acl, admin, {user, "admin", "localhost"}}.

%% Hostname
{hosts, ["localhost"]}.

Restart eJabberd

service ejabberd restart

Now you can navigate to your eJabberd Web Admin interface on droplet's IP address port 5280

 
http://198.199.90.115:5280/admin

The login username is user@domain ("admin@localhost" in our case):

From the web admin interface you can modify all the settings:

Adding New Users

From web admin interface, click Virtual Hosts -> localhost -> Users

You can also add a user from command line via SSH:

Now you can install a client like Pidgin to connect to XMPP:

Remember to use port 5222 to connect to your XMPP server using encryption:

Adding Users to your Buddy List

From Pidgin you can either press CTRL+B or from menu "Buddies" -> "Add Buddy" to buddies:

Your buddy would receive a friend request that they would have to authorize:

Now you will be able to communicate securely using XMPP and OTR encryption module in Pidgin:

And you are all done!

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Category:
Tutorial
Tags:

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
26 Comments
Leave a comment...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Thank you, that is very helpful. I hope I can also find an article that helps me integrate an already created database with ejabberd’s authentication/functions

Did you figure out a way to integrate mysql (or other external databases) onto your server?

Have you? Still looking…

Hmmm - all I have listed in my CP is this:

When I click on virtual hosts:

Virtual Hosts [Guide: Virtual Hosting] Host Registered Users Online Users

my CP doesn’t look anything like the screenshot - barebones :( - any ideas?

For those that see his issue in the future:

You need to change the /etc/ejabberd/ejabberd.cfg file from {acl, admin, {user, “”, “localhost”}}. to {acl, admin, {user, “admin”, “localhost”}}

Thank you, very helpful…

How can i Configure ejabber On goDaddy Linux shared Hosting?

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
July 1, 2014

@barkamlesh.nit: Unfortunately it’s not possible to install ejabberd on shared hosting.

404 Error when calling from the browser

Thanks…

2 Questions:

  1. How can I install latest version of ejabberd i.e. 14.07?
  2. I have installed ejabberd via the above procedures and I was able to install ejabberd. However whenever I try adding a custom module for Push Notification, offline_message_hook doesn’t get called.

Good explanation :)

The weg login with @localhost did not work for me, so I added a domain as a host, then it worked.

Thank you, It is very helpful. But I cannot start Ejabberd.

adduser: Warning: The home directory `/var/lib/ejabberd' does not belong to the user you are currently creating.

How can I fix it?

Thank you.

This comment has been deleted

    Hi, I cannot start Ejabberd server, please give me a hand. Thank you.

    E(<0.38.0>:ejabberd_config:554) : Error reading Mnesia database spool files: The Mnesia database couldn’t read the spool file for the table ‘config’. ejabberd needs read and write access in the directory: /var/lib/ejabberd Maybe the problem is a change in the computer hostname, or a change in the Erlang node name, which is currently: ejabberd@truongps Check the ejabberd guide for details about changing the computer hostname or Erlang node name.

    When I follow all of these steps then log into ejabberd, my credentials never work. I have tried multiple different passwords.

    this is what i get when i try apt-get -y install ejabberd

    The following packages have unmet dependencies:
     ejabberd : Depends: erlang-abi-15.b
    E: Unable to correct problems, you have held broken packages.
    
    

    I already have erlang and rabbitmq installed and thoroughly tested

    Hi i want to install ejabbered on my linux machine but it show permission denied when i use this command /etc/ejabberd/ejabberd.cfg: ,please help me to solve this problem.Thanks in Advance.

    Great tutorial :) Thanks

    I have one query can you suggest me a good monitoring tool for Ejabberd so that I can do following things:

    1. Search for users
    2. Monitor logs and messages
    3. Filter users
    4. Filter undelivered messages
    5. Server performance
    6. etc…

    The only problem that I have is when trying to connect to the admin panel via my browser. It says that my server isn’t sending any data. Any ideas? I would really love to get this up and running.

    Are you connecting to the admin panel via http or https? Try https://<droplet-ip-address>:5280/admin.

    ejabberdctl register keeps crashing on ubuntu-16-10-x64. Error message:

    /usr/sbin/ejabberdctl: line 385: /proc/sys/kernel/random/uuid: Permission denied
    /usr/sbin/ejabberdctl: line 366:  3189 Segmentation fault      $EXEC_CMD "$CMD"
    

    Worked with 16.04 though.

    FYI ejabberd.cfg is converted to ejabberd.yml

    Hi, it is not possible to establish an OTR connection when I want to send a message by Pidgin client. The eJabberd server says: “...@localhost has requested an Off-the-Record private conversation https://otr.cypherpunks.ca/. However, you do not have a plugin to support that.”. How can I add the required plugin to support OTR?

    Not working in 16.04 , after all configuration my home page is not opening for ejabberd home with port 5280

    Hey

    Can I run eJabbered on the same server as the app eJabbered is used on? Or does it need it’s own server?

    My server has 4GB Ram

    eJabberd no longer uses the .cfg file mentioned in this writeup, and now uses .yml

    With the package install, how can we enable mysql configuration?

    ejabberd is configured to use ‘mysql’, but the following Erlang modules are not installed: ‘[mysql, mysql_auth, mysql_conn, mysql_recv]’

    Any pointers?

    Not works:(( http://165.227.137.175:5280/ ERR_EMPTY_RESPONSE

    It needs to be ‘https’ not ‘http’

    This tutorial is severely outdated. Please update.

    Config is a YAML and the admin page must be accessed using https, not http.

    Join the Tech Talk
    Success! Thank you! Please check your email for further details.

    Please complete your information!

    Become a contributor for community

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    DigitalOcean Documentation

    Full documentation for every DigitalOcean product.

    Resources for startups and SMBs

    The Wave has everything you need to know about building a business, from raising funding to marketing your product.

    Get our newsletter

    Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

    New accounts only. By submitting your email you agree to our Privacy Policy

    The developer cloud

    Scale up as you grow — whether you're running one virtual machine or ten thousand.

    Get started for free

    Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

    *This promotional offer applies to new accounts only.