How To Install Openfire XMPP Server On Ubuntu

Install Openfire On Ubuntu Server

Today, We will learn how to install the Openfire XMPP chatting server on Ubuntu. Openfire is the most popular and amazing texting (IM) server using the XMPP/Jabber convention. Openfire is better than the other Presence Servers. Therefore, the Openfire server is be defined as a Real-Time Collaboration (RTC) server that the client should use it. But there are heaps of clients that support the XMPP protocol. Spark is the most popular and created by Openfire. In addition, XMPP (Extensible Messaging and Presentation Protocol) known as the open protocol for instant messaging. Its a real-time communication protocol based on XML (which includes chat). We can also create an Android chat App like Whatsapp in Android Studio. So, You can link to the Openfire XMPP server as a user database.

Openfire Most Popular features

Openfire provides the best features from other XMPP servers.

  1. MYSQL, Embedded Database and Oracle for massages storage and user details.
  2. Integration With LDAP.
  3. Web Admin Panel.
  4. Support Jingle Node for Audio and Video Calling.
  5. User Status Plugin Which Traces User IP.
  6. Integrate With android XMPP Clients apps like Conversations Android App, Xabber and A talk.
  7. A lot of plugins.

Install Openfire XMPP Server On Ubuntu

First of all, So, We need to update our Ubuntu server to install Openfire. Therefore open a new window and run the following command.

sudo apt update

sudo apt upgrade 

Install JAVA JDK For Openfire

Once our ubuntu server packages are updated. To install Java JDK we will run the following command

sudo apt install openjdk-8-jdk

 java -version 

Installing MariaDB With New Version

It’s most important to install MariaDB with the new version because the Openfire database has a long table that can’t upload properly without a new version. So, Please run the following commands to install MariaDB with the latest version.

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

Now add a new file by running this command

sudo nano /etc/apt/sources.list.d/mariadb.list

After opening a new file, Please copy and paste the following lines and save it.

deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main
deb-src http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main

Now, We need to update our ubuntu server with the following command.

sudo apt update

Once our ubuntu server updated, We will install MariaDB with running the following command.

sudo apt install mariadb-server

sudo systemctl status mariadb

 sudo systemctl stop mariadb.service      # To Stop MariaDB service 
 sudo systemctl start mariadb.service     # To Start MariaDB service 
 sudo systemctl status mariadb.service    # To Check MariaDB service status 
 sudo systemctl restart mariadb.service

Download & Install Openfire XMPP On Ubuntu Server

We will download Openfire from the official website. So please visit and copy the new version download link and paste here

wget -O openfire.deb  https://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_4.5.0_all.deb 

Once Openfire downloaded then we will run the following command to install.

sudo  dpkg -i openfire.deb 

systemctl status openfire   #check status 

‚óŹ openfire.service - LSB: Start/stop openfire jabber server
 Loaded: loaded (/etc/init.d/openfire; generated)
 Active: active (running) since Tue 2020-01-26 12:00:06 UTC; 9min ago
 Docs: man:systemd-sysv-generator(8)
 Tasks: 22 (limit: 1153)
 CGroup: /system.slice/openfire.service

Create Database For Openfire XMPP Server

So, We will create a database for the Openfire server by running the following commands.

mysql -u root -p
 
Enter password. 


 create database openfire; 

 GRANT ALL PRIVILEGES ON openfire.* TO openfire@localhost IDENTIFIED BY 'password123!'; 

 flush privileges; 

  exit 

So, After creating a database and user. Now, we will import the Openfire database schema by running the following command

 mysql -u root -p

 Enter password:  

 use openfire; 

 source /usr/share/openfire/resources/database/openfire_mysql.sql; 

 show tables; 

exit;

Firewall To Access Openfire

$ sudo ufw enable
$ for i in 9090 9091 5222 7777; 
sudo ufw allow $i; 

sudo ufw disable     // you can also stop firewall 

To open admin panel, So please visit HTTP://<server-ip|domain>:9090

how to install openfire on ubuntu

In addition, the server setting page gives the same domain URL. Secondly, database Settings is Given Below and also shown in the screenshot.

1. Database Driver Presets:MySQL
2. JDBC Driver Class: com.mysql.jdbc.Driver
2. Database URL:jdbc:mysql://127.0.0.1/openfire?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8
4.Username: openfire
5. Password: password123!

After fill-up, the information. So, please hit the Continue button and you will see a Profile Settings page and Default option. In finally you will see the admin user, email address and password. Set your new password for admin user name. Now you can log in with the following details

username: admin

password: your new given password