XMPP and ejabberd on Debian

Published on: Tue, Nov 18, 2014 at 3:27 pm EST
Debian Linux Guides

This setup will show you how to setup an XMPP server with ejabberd and Debian. For the course of this setup, we will assume that you are working with administrative privileges. If you want to use sudo, then append it where needed.

First, make sure that your packages are up-to-date. Then install ejabberd from the official Debian repositories:

apt-get update && apt-get upgrade && apt-get install ejabberd

Initial configuration can be done via debconf:

dpkg-reconfigure ejabberd

This will prompt you for:

  • A hostname - yourserver.tld.
  • An administrative user - name it whatever you like.
  • A password for the administrative user.

At this point, ejabberd is now functional, but you may want to do some fine-tuning. The configuration file is located under /etc/ejabberd/ejabberd.cfg. Open this file with your favorite text editor. Here you will see server variables, and you can edit them accordingly.

Ejabberd comes with three means of administrating it:

  • The command-line tool ejabberdctl.
  • The possibility to use your client (Pidgin, for example, supports this).
  • A web interface listening on yourdomain.tld:5280.

If you don't need the web interface, then you can comment out the following sequence:

{5280, ejabberd_http, [
                       %%{request_handlers,
                       %% [
                       %%  {["pub", "archive"], mod_http_fileserver}
                       %% ]},
                       %%captcha,
                       http_bind,
                       http_poll,
                       web_admin
                      ]}

The built-in certificate of ejabberd is not valid and will prompt a security warning from your client. If possible, you should replace it with a certificate from a valid certificate authority (CA).

{s2s_use_starttls, true}.
{s2s_certfile, "/path/to/your/certificate.pem"}.

After making any changes to the configuration file, ejabberd needs to be restarted:

service ejabberd restart

You are now ready to use your new XMPP server. We recommend reviewing the official documentation, as it has a lot of useful features that aren't covered here. For example, shared rosters and transport functionality for other instant messaging services.

Want to contribute ?

You could earn up to $300 by adding new articles