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

wget https://www.process-one.net/downloads/downloads-action.php?file=/ejabberd/17.04/ejabberd_17.04-0_amd64.deb

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 192.168.1.106 123456

Stop and start ejabberd for your changes to take effect:

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

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

Visit the admin web interface to manage your server:

http://192.168.1.106:5280/admin

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 on Udemy. By the Same Author of this Tute. If you take the course , please use the coupon code LEARNSMACK for a discount.Help spread the news.
Visit our online school to see some of our other courses. Be sure you know how to enrol in our courses. If you want to support us, please consider taking our courses from our school.

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 Facebook
Follow him on Twitter
Follow him on LinkedIn
Follow him on Github

2 Comments

Leave a Reply

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

*