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!

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.

Leave a Reply

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