How to install ejabberd 17.04 on Ubuntu 16.04 and configure mysql

Follow the steps below to install ejabberd 17.04 to your ubuntu16.04 system. If you want to install from sources, it’s not difficult to combine this guide with intall ejabberd from source code to suit your needs.

Download the debian package


Install the debian package

dpkg -i ejabberd_17.04-0_amd64.deb

Add one or more virtual host(s)

Add add an admin account :

Register an admin :

/opt/ejabberd-17.04/bin/ejabberdctl register admin1 123456

Stop and start ejabberd for your changes to take effect:


NOTE : Starting ejabberd or running any ejabberdctl commands, you may get the :
bash: /opt/ejabberd-17.04/lib/linux-x86_64/ no version information available (required by bash)
warning . This is harmless according to this so .

Visit the admin web interface to manage your server:

Provide your admin credentials and login.

If you use mysql, you need to create the tables

mysql -uroot -p ...
create database ejabberd;
use ejabberd;
source /opt/ejabberd-17.04/lib/ejabberd-17.04/priv/sql/mysql.sql

Configure the privileges :

grant all privileges on ejabberd.* to ejabberd@'localhost' identified by 'ejabberd';
flush priviliges;

Change the configuration file accordingly

nano -c  /opt/ejabberd-17.04/conf/ejabberd.yml

Comment out line 286: ##auth_method: internal
Uncomment line 307:auth_method: sql
Uncomment line 378-387:

378 ## MySQL server:
379 ##
380 sql_type: mysql
381 sql_server: "localhost"
382 sql_database: "ejabberd"
383 sql_username: "ejabberd"
384 sql_password: "ejabberd"
385 ##
386 ## If you want to specify the port:
387 sql_port: 3306

Start ejabberd

/opt/ejabberd-17.04/bin/ejabberdctl stop
/opt/ejabberd-17.04/bin/ejabberdctl start

Have fun!

Complete step by step video Course on XMPP and Smack on Android now available. By the Same Author of this Tute.Help spread the news.

We publish both written&video tutorials on XMPP and it’s application on different platforms. Subscribe below to be among the first to be notified.

Liked this tutorial ? Would be great if you helped us back, here is how :

  • Share this tutorial with your friends
  • Buy or recommend video courses from our online school

You can also join our XMPP Learner Square Group on Facebook to find like minded people!

Posted in Servers, Tutorials, xmpp and tagged , , , .

Daniel Gakwaya loves computer Hardware/Software.He is a Software Engineer at BLIKOON and lead developer of bliboard-The whiteboard system currently marketed by the company.He is known to hack around on any piece of tech that happens to pick his interest. More on his tech endeavors here
Follow him on Twitter


Leave a Reply to gakwaya Cancel reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.