How to install JBoss AS on Ubuntu

Today I installed JBoss AS 7.1 on our Ubuntu 13.04 stend. I'm sure it is not the last time when I prepare JBoss application server, so I decided to memorize my steps in this post.

The installation procedure is:

Install JDK 7

Install JDK from repository (oracle-java7-installer from this ppa is JDK)
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

Set this version to be used by default
sudo update-java-alternatives -s java-7-oracle
Set up environment variables
sudo apt-get install oracle-java7-set-default

Install JBoss AS 7.1.1

Download and unpack JBoss AS 7.1.1. For manually installed software I use old-fashioned /opt folder.
tar xfvz jboss-as-7.1.1.Final.tar.gz
sudo mv jboss-as-7.1.1.Final /opt/jbossas7

Create jboss service user, give permissions, enter as jboss
adduser jboss
chown -R jboss:jboss /opt/jbossas7
su jboss

Add new management user, when adding, press "a" to select management user, leave ManagementRealm and enter admin username and password:

Test run JBoss AS 

Change user to jboss
su jboss
Run with remote access management allowed
/opt/jbossas7/bin/ -Djboss.bind.address=
Open a management console in browser http://localhost:9990
Open default web http://localhost:8080
Just press Ctrl-C in terminal to stop the server

Configure to run as a daemon

Create script
with the following content:

# Provides: jboss
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Management of JBoss AS v7.x
#Defining JBOSS_HOME
case "$1" in
echo "Starting JBoss AS7…"
sudo -u jboss sh ${JBOSS_HOME}/bin/ &
echo "Stopping JBoss AS7…"
sudo sh ${JBOSS_HOME}/bin/ –connect command=:shutdown
echo "Showing server.log…"
tail -1000f ${JBOSS_HOME}/standalone/log/server.log
echo "Usage: /etc/init.d/jboss {start|stop|log}"
exit 1
;; esac
exit 0

Set the script as executable
chmod +x /etc/rc.d/init.d/jbossas7 

Test it
sudo service jbossas7 start
sudo service jbossas7 stop


And finally make it auto run when system starts
update-rc.d jbossas7 defaults

Allow remote access

JBoss restricts remote access by default. To be able to open JBoss console and apps in browser from any remote machine, do the following steps.

Open config file /opt/jbossas7/standalone/configuration/standalone.xml, change addresses from to in interfaces section:

    <interface name="management">
        <inet-address value="${}" />
    <interface name="public">
        <inet-address value="${jboss.bind.address:}" />
    <interface name="unsecure">
        <inet-address value="${jboss.bind.address.unsecure:}" />
Now we can open  http://my-jboss-server-name:8080 and http://my-jboss-server-name:9990 from another machine

Leave a Reply

Your email address will not be published.