Install ejabberd

In the Tutorials page there are links to other tutorials about installing and configuring ejabberd.
  1. Install Erlang

    • from source

      1. Install Libncurses development files

        • with Debian APT

          apt-get install libncurses5-dev
      2. Install OpenSSL and its development files

        • with Debian APT

          apt-get install openssl libssl-dev
      3. Install Erlang

        Download Erlang/OTP source code and uncompress it. For example:

        tar -xzvf otp_src_R11B-5.tar.gz
        cd otp_src_R11B-5
        LANG=C; export LANG

        Compile and install it:

        make install
    • with Debian APT

      apt-get install erlang
    • using Port Collection on FreeBSD

      cd /usr/ports/lang/erlang-lite && make all install clean
  2. Verify Installation

    Check if it is correctly installed:

    Erlang (BEAM) emulator version 5.5.5 [source] [hipe]
    Eshell V5.5.5  (abort with ^G)
    1> halt().
  3. Install ejabberd

    • from source SVN

      1. Install Libexpatl development files

        • with Debian APT

          apt-get install libexpat1-dev
      2. Retrieve ejabberd from the Subversion repository

        svn co ejabberd
      3. Compile

        cd ejabberd/src
      4. Configure

        You can use the example configuration file:

        cp ejabberd.cfg.example ejabberd.cfg

        You should add a user to your system:

        addgroup jabber
        adduser ejabberd
        adduser ejabberd jabber
        chown ejabberd:jabber ../src -R
        chmod 750 ../src -R
      5. Execute

        Command to execute ejabberd:

        su ejabberd -c "erl -s ejabberd -name ejabberd 
                                       -ejabberd config '\"ejabberd.cfg\"' -detached"

        You can use a script.

    • using apt on Debian unstable and testing

      It is as easy as:

      apt-get install ejabberd
    • using apt on Debian stable

      Add Teopetuk's unofficial Debian APT repository if you do not have it. Then update the list of available packages and finally install it:

      apt-get install ejabberd
    • using Port Collection on FreeBSD

      cd /usr/ports/net-im/ejabberd && make all install clean
  4. Enable SSL/TLS Secured Communication

    Create a SSL key (read this tutorial for more information):

    openssl req -new -x509 -newkey rsa:1024 -days 3650 -keyout privkey.pem -out server.pem
    openssl rsa -in privkey.pem -out privkey.pem
    cat privkey.pem >> server.pem
    rm privkey.pem

    Now edit your ejabberd.cfg file and specify the correct location of your server.pem:

    {listen, [{5222, ejabberd_c2s,     [{access, c2s}, {shaper, c2s_shaper},
                                        starttls, {certfile, "/home/ejabberd/server.pem"}]},
              {5223, ejabberd_c2s,     [{access, c2s}, {shaper, c2s_shaper},
                                        tls, {certfile, "/home/ejabberd/server.pem"}]},
    {s2s_use_starttls, true}.
    {s2s_certfile, "/home/ejabberd/server.pem"}.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

FreeBSD - Erlang

The FreeBSD erlang-lite is depreciated in the new ports (using 10.2 myself) as it used the same options as the standard erlang port, so use the following line

cd /usr/ports/lang/erlang && make all install clean

git repository

Is this git repository official ?

It seems fresh enough.

Yes, it is


Is this git repository official ?

It seems fresh enough.

Yes, and it is updated automatically (every 5 minutes or so) from the same machine that hosts the main ejabberd SVN repository.


This is a good resource. Can you point me to any directions as to how to add AD authentication support?


Isn't AD LDAP compatible?


certificate format problem

I'm having trouble getting certs I'm generating to work. I came here looking for resources to learn to fix the problem, and I noticed that your tutorial link doesn't work.

Can someone please point me to a resource to fix my problem? Everything works fine except TLS, and whether I install from binary or source doesn't matter, as soon as I set ejabberd.cfg for my cert file, it starts complaining. Output from the log is

** Reason for termination =
** {{badmatch,{error,"SSL_CTX_use_PrivateKey_file failed: error:0906D06C:PEM routines:PEM_read_bio:no start line"}},

I'm reasonably sure it is a certificate format problem, but I've tried every method I can think of, and have generated 2 different certificates as a test (registered SSL not self signed). In fact, I just went to and got the XMPP format cert.

Thanks for any help or links!

There are two links in

There are two links in Tutorials about cert installation. They may give you some hint about how to install your cert.

Syndicate content