Install Openfire XMPP chat server on Ubuntu 20.04

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

In a recent article, we discussed how to install and configure the Ejabberd XMPP server. XMPP (Extensible Messaging and Status Protocol) is a widely used open protocol for instant messaging. Openfire is a free to use and powerful instant messaging (IM) server using XMPP / Jabber protocol. This article will focus on setting up Openfire XMPP Chat Server on Ubuntu 20.04 Linux computer

Here are some cool features provided by Openfire:

  • LDAP integration support
  • MySQL, Oracle, PostgreSQL and embedded databases support user details and message storage.
  • Support both TLS and SSL to ensure security
  • Many plugins to extend its functionality
  • Web GUI configuration manager
  • Spark IM client integration
  • Cluster avoid single point of failure
  • Integration with other external IM servers

The following are the standard steps to install and configure Openfire XMPP Chat Server on Ubuntu 20.04.

Step 1: Update the system

Make sure you are using an updated version of Ubuntu Linux.

sudo apt update

Upgrading installed packages is optional.

sudo apt upgrade

If you perform an operating system upgrade, you must restart:

sudo systemctl reboot

Step 2: Install Openfire XMPP server on Ubuntu 20.04

Down download Open fire The latest packaging. The version we will install in this article is 4.5.2.

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

After downloading the Openfire debian package, please use Easy command:

sudo apt install ./openfire.deb

Accept the installation prompt by pressing ÿ The keys on the keyboard.

The following additional packages will be installed:
  ca-certificates-java default-jre-headless fontconfig-config fonts-dejavu-core java-common libavahi-client3 libavahi-common-data libavahi-common3
  libcups2 libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libpcsclite1 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6
  libxi6 libxrender1 libxtst6 openjdk-11-jre-headless x11-common
Suggested packages:
  default-jre cups-common liblcms2-utils pcscd libnss-mdns fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
  | fonts-wqy-zenhei fonts-indic
The following NEW packages will be installed:
  ca-certificates-java default-jre-headless fontconfig-config fonts-dejavu-core java-common libavahi-client3 libavahi-common-data libavahi-common3
  libcups2 libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libpcsclite1 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6
  libxi6 libxrender1 libxtst6 openfire openjdk-11-jre-headless x11-common
0 upgraded, 28 newly installed, 0 to remove and 0 not upgraded.
Need to get 41.3 MB/80.5 MB of archives.
After this operation, 230 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Start and enable the openfire service to start at system startup.

sudo systemctl enable --now openfire

Check service status (if running).

$ systemctl status openfire
● openfire.service - LSB: Start/stop openfire jabber server
     Loaded: loaded (/etc/init.d/openfire; generated)
     Active: active (running) since Sat 2020-05-23 17:10:43 CEST; 2min 41s ago
       Docs: man:systemd-sysv-generator(8)
      Tasks: 32 (limit: 4567)
     Memory: 199.9M
     CGroup: /system.slice/openfire.service
             └─1800 /bin/java -server -DopenfireHome=/usr/share/openfire -Dlog4j.configurationFile=/usr/share/openfire/lib/log4j2.xml -Dopenfire.lib.di>

May 23 17:10:43 ubuntu systemd[1]: Starting LSB: Start/stop openfire jabber server...
May 23 17:10:43 ubuntu openfire[1784]: best java alternative in:
May 23 17:10:43 ubuntu openfire[1784]: Starting openfire: openfire.
May 23 17:10:43 ubuntu systemd[1]: Started LSB: Start/stop openfire jabber server.

Step 3: Configure database support for the Openfire XMPP server

We will use the MariaDB database to store message data. Use the following command to install MariaDB database server.

sudo apt update
sudo apt -y install mariadb-server

Create a database for openfire:

$ sudo mysql -u root
CREATE DATABASE openfire;
GRANT ALL PRIVILEGES ON openfire.* TO [email protected] IDENTIFIED BY '[email protected]!';
FLUSH PRIVILEGES;
QUIT

Import the Openfire database schema:

$ mysql -u openfire -p'[email protected]!'
USE openfire;
source /usr/share/openfire/resources/database/openfire_mysql.sql;

Confirm by listing the tables in the database.

MariaDB [openfire]> SHOW tables;
+----------------------+
| Tables_in_openfire   |
+----------------------+
| ofExtComponentConf   |
| ofGroup              |
| ofGroupProp          |
| ofGroupUser          |
| ofID                 |
| ofMucAffiliation     |
| ofMucConversationLog |
| ofMucMember          |
| ofMucRoom            |
| ofMucRoomProp        |
| ofMucService         |
| ofMucServiceProp     |
| ofOffline            |
| ofPresence           |
| ofPrivacyList        |
| ofProperty           |
| ofPubsubAffiliation  |
| ofPubsubDefaultConf  |
| ofPubsubItem         |
| ofPubsubNode         |
| ofPubsubNodeGroups   |
| ofPubsubNodeJIDs     |
| ofPubsubSubscription |
| ofRemoteServerConf   |
| ofRoster             |
| ofRosterGroups       |
| ofSASLAuthorized     |
| ofSecurityAuditLog   |
| ofUser               |
| ofUserFlag           |
| ofUserProp           |
| ofVCard              |
| ofVersion            |
+----------------------+
33 rows in set (0.001 sec)

Step 4: Configure the firewall and access the Openfire UI

If you have an active firewall service, please allow ports for Openfire.

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

Use the IP address or server host name and port 9090 to access the Openfire web interface on the server. At the first prompt, select the installation language:

Select the default language and click carry on. On the Server Settings window, set your area Then click the Continue button.

Install Openfire XMPP chat server on Ubuntu 20.04

For database settings, choose Standard database connection.

You can also use Embedded database If you don’t want to use MySQL database.

Install Openfire XMPP chat server on Ubuntu 20.04

These are the parameters I will use:

  • Database driver presets:MySQL
  • JDBC driver class: com.mysql.jdbc.Driver
  • Database URL:jdbc: mysql: //127.0.0.1/openfire? useUnicode = true characterEncoding = UTF-8 & characterSetResults = UTF-8
  • username: Open fire
  • Password: [email protected]!

This is my screenshot.

Install Openfire XMPP chat server on Ubuntu 20.04

Please click carry on And use the default options in the configuration file settings; you can add external authentication mechanisms later, such as LDAP

Install Openfire XMPP chat server on Ubuntu 20.04

Set the email address and password of the administrator user:

Install Openfire XMPP chat server on Ubuntu 20.04

Log in to the Openfire console on the next page.

Install Openfire XMPP chat server on Ubuntu 20.04

Enjoy the fun of using Openfire.

Install Openfire XMPP chat server on Ubuntu 20.04

The
The

The
You can download this article in PDF format to support us through the following link.

Download the guide in PDF format

turn off
The

The
The

Sidebar