Installing & Setup Openfire




Openfire is a powerful IM and chat server that implants the XMPP written in Java. For more info Here

This guide I be installing it on Centos Linux.

Installing Openfire

To get starting we going to need to install Openfire there two way doing this

Download the latest version Here. I would recommend the RPM file.

Or you can the following command in terminal

# yum install java-1.7.0-openjdk –y

Install Openfire

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

Once you install Openfire. Let start it and also set start automatically every boot.

# service openfire start
# chkconfig openfire on


Next we going to add the ports for connect to http and https. On terminal. If you don’t know how to use vi than read here before edit the file or else you will damage the firewall.


You going to add those two lines.

-A INPUT -p tcp -m state --state NEW --dport 9090 -j ACCEPT

-A INPUT -p tcp -m state --state NEW --dport 9091 -j ACCEPT

Restart the iptables on the terminal

#service iptables restart.

Now navigate to http://ip-address:9090 from your browser you can do it within machine if you on GUI or not go other computer and access from there. Example my is ip address of machine.

You should see the following screen. Select your preferred language and press Continue.

Enter your server hostname or IP address and press Continue. I use the ip address on the machine that got installed

Now you will be asked to select the database settings. Openfire offers an embedded database powered by HSQLDB. Or you can select external databases like MySQL and Oracle etc. To install and configure external databases click on this link. Here, I select Embedded Database Connection.

Now choose your profile settings and press Continue. Or you can import the users from LDAP server.

Now the installer will ask you to set the administrator password. Setup your account password. It will ask the current password. If it is new installation, the default password will be admin.

Openfire installation is completed now. Restart openfire

# service openfire start


Click on Login to Admin Console to enter into Openfire administrative console. Enter username and password.

You will be able to login to the administrative console.

Create Users

Go to Users/Groups section. Select Users tab. Click on Create a new user link and enter the username and password for the new user. Click on Create.

I would highly recommend going to the tab Server under Server settings> Registration & Login. I make sure that those are set.

Disable users can not automatically create new accounts
Disable users cannot change their password
Disable only registered user may login.

Create new user and group
You can go to tab Users/Groups. Here you can create your users and there tab call Group and you can set your groups.

Now we going to test it to see if working we need to install IM Client for this guide we use Spark. Go and install on two computers or other computer connect to the network.
Here the link to download it Spark

Open Spark
You can use the admin as test and put in the password you create. Server is the machine that openfire is installed in. My is
ScreenHunter_92 Jan. 08 21.59


Now go to Advanced>General

Check Automatically discover host and port and check Ok
ScreenHunter_93 Jan. 08 22.00

Click on the login if worked that mean your ready to go. If you want to install outside of your network than you will need to add ports and also forward those ports.


Forward Ports connect to the outside.

On terminal. If you don’t know how to use vi than read here before edit the file or else you will damage the firewall. Those just in case if you make Centos as your firewall.


Put those underneat the ones you added in the iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5222 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5223 -j ACCEPT

Restart the iptables on the terminal

#service iptables restart.


If you have router than you will need to login and go to port forward. Port range will be 5222 to 5223.

You will need to know what is your public ip address. Go here to find out. You will need to provide the user from their side the public ip and port. On Spark  go to Advanced>General. On connections you will put the public ip address and the port should be added already.

If you want to test it on Android phone. Download App call Xabber

Add account
Account type XMPP
username: example Joe@publicip