20 C
Texas
angeloma
Senior Writer and partner

Install OpenFire server on Debian 10

Hello, friends. In this post, you will learn how to install OpenFire server on Debian 10. This is an XMMP server that helps to manage the internal communications of a company using this well-known protocol.

According to the application’s website:

Openfire is a real-time collaboration (RTC) server licensed under the Open Source Apache License. It uses the only widely adopted open protocol for instant messaging, XMPP Openfire is incredibly easy to setup and administer, but offers rock-solid security and performance.

Thanks to this application we can create our own chat system in an internal network or with internet access. In this way, it joins a long list of professional applications with which we can work in an organization.

Install OpenFire on Debian 10

The installation process consists of several parts to achieve the goal.

- Advertisement -

So, open a terminal or connect via SSH to the DEbian server and update the system.

sudo apt update
sudo apt upgrade

Now you have to visit the OpenFire download site to find out which is the latest version of the program.

At the time of writing this post, the latest stable version is 4.6.2 which can be downloaded using various formats. To simplify the installation process we will opt to download the DEB package with the wget command. You can also download it on a client computer and upload it to the server.

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

Remember that this command will vary depending on the version of OpenFire.

Running the above command will download the file and rename it to oepnfire.deb which we need to install.

sudo apt install ./openfire.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'openfire' instead of './openfire.deb'
The following additional packages will be installed:
  ca-certificates-java default-jre-headless fontconfig-config fonts-dejavu-core java-common libasound2 libasound2-data libavahi-client3 libavahi-common-data
  libavahi-common3 libcups2 libfontconfig1 libjpeg62-turbo 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 libasound2-plugins alsa-utils 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 libasound2 libasound2-data libavahi-client3 libavahi-common-data
  libavahi-common3 libcups2 libfontconfig1 libjpeg62-turbo 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, 29 newly installed, 0 to remove and 5 not upgraded.
Need to get 43.7 MB/86.9 MB of archives.
After this operation, 239 MB of additional disk space will be used.
Do you want to continue? [Y/n]

OpenFire depends on Java so during the installation process it will also install Java and other packages. But this will be taken care of by APT.

At the end of the process, a new system service will be created to manage the application. The first thing you have to do is to start and enable the service to start with the system.

sudo systemctl enable --now openfire
openfire.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable openfire

And check the status

sudo systemctl status openfire

Output:

● openfire.service - LSB: Start/stop openfire jabber server
   Loaded: loaded (/etc/init.d/openfire; generated)
   Active: active (running) since Fri 2021-03-12 14:49:16 CET; 48s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 26 (limit: 2296)
   Memory: 110.1M
   CGroup: /system.slice/openfire.service
           └─3416 /bin/java -server -DopenfireHome=/usr/share/openfire -Dlog4j.configurationFile=/usr/share/openfire/lib/log4j2.xml -Dopenfire.lib.dir=/usr/share/openfir

Mar 12 14:49:15 osradar systemd[1]: Starting LSB: Start/stop openfire jabber server...
Mar 12 14:49:16 osradar openfire[3408]: best java alternative in:
Mar 12 14:49:16 osradar openfire[3408]: Starting openfire: openfire.
Mar 12 14:49:16 osradar systemd[1]: Started LSB: Start/stop openfire jabber server.

Install MariaDB on Debian 10

OpenFire has its own database driver, but it is also possible to use MariaDB / MySQL or PostgreSQL which increases the performance of the application but the flexibility.

So, install it with the following command:

sudo apt install mariadb-server

Then, configure it:

sudo mysql_secure_installation

Then create a new database and user for OpenFire:

sudo mysql -u root -p
CREATE DATABASE openfire;
GRANT ALL PRIVILEGES ON openfire.* TO 'openfire'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit;

Replace the fields with the data you want and set a strong password.

Now upload the default OpenFire data to the created database

sudo mysql -u openfire -p'password'

Replace 'password' with your password

Inside the MariaDB shell, switch to the created database and load the data:

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

And to verify the changes, you can run:

SHOW tables;

And there you should see all the tables loaded.

Open the OpenFire ports

There are many ports that we have to open in the firewall for OpenFire to work properly.

So, start opening them:

sudo ufw allow 9090
sudo ufw allow 9091
sudo ufw allow 5222
sudo ufw allow 7777

This should get the application working.

Complete the installation

Now, you have to open a web browser and go to http://your-domain:9090 and you will see the following screen

1.- Select the installation language
1.- Select the installation language

Select the language of the installation and click Continue.

Then set the server options. There you will be able to configure the XMMP domain and define other ports to replace the default ones.

2.- Server settings
2.- Server settings

Next, you can choose to use the internal database driver or an external one as we have done. So, choose the first option.

3.- Database settings
3.- Database settings

In this step, you have to configure the database connection. Select MySQL and in the url modify the values of hostname and database name.

Database URL:jdbc:mysql://localhost/openfire?useUnicode=true characterEncoding=UTF-8&characterSetResults=UTF-8

Below define the username and password for the OpenFire user we have created.

You can also configure the database connections.

4.- Configuring the database connection
4.- Configuring the database connection

If the connection is successful, you will see the profile options.

5.- Profile settings
5.- Profile settings

Next, you have to create an administrator account with an email and password.

6.- Creating the Admin account
6.- Creating the Admin account

In the end, you will see this message indicating that everything went well.

7.- OpenFire installed on Debian
7.- OpenFire installed on Debian

Then go to the login screen

8.- Login screen
8.- Login screen

and finally, you will be in the OpenFire control panel.

9.- OpenFire on Debian 10
9.- OpenFire on Debian 10

So, enjoy it.

Conclusion

OpenFire helps us with a very common task in all modern organizations. Creating an XMMP server can be very useful and help us with our tasks.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article