5 min read

The Openfire instant messaging server is very easy to install. In fact, it’s totally newbie-proof. So much so, that unlike other complex server software, even if you’ve never setup up Openfire before, you’ll be able to get it up and running on your first try. If you’re sceptical, by the time we are done with this short article, we’ll have ourselves a fully-functional Openfire server that will register users and connect with clients.

Preparing Your System

Openfire is a cross-platform server and can be installed under Linux, Solaris, Mac, or Windows operating system environments. Openfire reserves its enormity for its users. When it comes to system requirements, Openfire is very suave and a perfect gentleman who has very moderate demands.

You don’t need to spend much time preparing your system for installing Openfire. Just pick out the environment you’re comfortable with—Windows or one of the popular Linux distributions such as Fedora, Debian, or Ubuntu, and you’re good to go. You don’t have to run around getting obscure libraries or worry about mismatched versions.

But like any hard-working gentleman, Openfire has a thing for caffeine, so make sure you have Java on your system. No need to run to the kitchen—this isn’t the Java in the cupboard. Openfire is written in the Java programming language, so it’ll need a Java Runtime Environment (JRE) installed on your system. A JRE creates a simple (breathable, so to say) environment for Java applications to live and function in. It’s available as a free download and is very easy to install.

If you’re installing under Windows, just skip to the “Installing Under Windows” section later in the article.

Linux Users Get Your Cuppa!

Sun’s Java Runtime Environment is available as a free download from Sun’s website (http://www.java.com/en/download/linux_manual.jsp) or it can also be installed from your distribution’s software management repositories. Users of RPM-based systems can safely skip this section because the Openfire installer for their distribution already includes a JRE.

On the other hand, users of Debian-based systems such as Ubuntu will have to install the JRE before installing Openfire. Thanks to the popular apt-get package management system, there isn’t much to installing the JRE.

Because Sun’s JRE isn’t free and is also not an open source software, most Linux distributions make the JRE package available in their non-free tree. If the following command doesn’t work, check out the detailed installation instructions for your specific distribution, at  https://jdk-distros.dev.java.net.

Open a console and issue the following command:

$ sudo apt-get install sun-java6-jre

Now the apt-get system will automatically fetch, install, and activate the JRE for you!

Meet The Protagonists

This article is about making sure that you have no trouble installing one file. This one file is the Openfire installer and it is available in multiple flavors. The four flavors we’re concerned with aren’t as exotic as Baskin Robbins’ 31 flavors but that doesn’t make the decision any easier.

The Openfire project releases several installers. The four flavors we’re concerned with are:

  • Openfire-3.5.2-1.i386.rpm: RPM package for Fedora Linux and other RPM-based variants
  • Openfire_3.5.2_all.deb: DEB package for Debian, Ubuntu Linux and their derivates
  • Openfire_3_5_2.tar.gz: Compressed “tarball” archive that’ll work on any Linux distribution
  • Openfire_3_5_2.exe: Openfire installer for Windows

We’ll cover installing Openfire from all of these files, so that you may use Openfire from your favorite Linux distribution or from within Windows. Just to reiterate here, the Windows installer and the RPM Linux installer both bundle the JRE, while the other other versions do not.

The Actual Install-Bit

Alright, so you have the Java JRE setup and you’ve downloaded the Openfire installer. In this section, we’ll install Openfire server from the various versions we discussed in the last section.

Let’s first install from the source tarball.

The first step when dealing with .tar.gz source archive is to extract the files. Let’s extract ours under /tmp and then move the extracted directory under /opt.

# tar zxvf openfire_3_5_2.tar.gz
# mv openfire /opt

Now we’ll create a non-priviledged user and group for running Openfire.

# groupadd openfire
# useradd -d /opt/openfire -g openfire openfire

Next, we’ll change ownership of the openfire/directory to the newly-created user and group.

# chown -R openfire:openfire /opt/openfire

Believe it or not, that’s it! You’ve just installed Openfire server. Surprised? Get ready for more. It gets even simpler if you install using the precompiled RPM or DEB binaries. In the case of RPM, Openfire is installed under /opt/openfire and in case of the DEB file, Openfire resides under /etc/openfire.

On RPM-based systems such as Fedora and its derivates (as root), use:

# rpm -ivh openfire-3.5.2-1.i386.rpm

On DEB-based systems such as Debian, Ubuntu, and so on, use:

$ sudo dpkg -i openfire_3.5.2_all.deb

Voila! You’re done. Now, who thought my “installing Openfire is totally newbie-proof” comment was an exaggeration?

Running Openfire on Linux/Unix

So, we now have Openfire on our favourite Linux distribution, whichever distribution this may be. Now it’s time to fire it up and get going. Depending on how you installed Openfire, the procedure to start it varies a little.

If you’ve installed Openfire from the RPM or DEB, you’ll be pleased to know that the Openfire developers have already done most of the hard work for you. These binaries contain some custom handling for the RedHat/Debian-like environments.

You can start and stop Openfire just like any other service on your system:

# /etc/init.d/openfire start
Starting Openfire:

You can also view the other options available:

# /etc/init.d/openfire
Usage /etc/init.d/Openfire {start|stop|restart|status|condrestart|reload}

On the other hand, if you’ve installed Openfire using the .tar.gz archive, you can start and stop Openfire using the bin/openfire script in your Openfire installation directory. First, change to the user that owns the /opt/openfire directory:

# su - openfire
# cd /opt/openfire/bin/
# ./openfire start
Starting Openfire

And now you have Openfire up and running!

If you are using a firewall, which you most probably are, make sure to forward traffic on ports 5222 and 5223 (for SSL) which clients use for connecting with the Openfire server. Also forward traffic on port 7777 for file transfer. Linux users can skip the next section on installing Openfire under Windows and move directly to the section that discusses the preliminary Openfire setup.

LEAVE A REPLY

Please enter your comment!
Please enter your name here