ManagedCloud Servers

High performance handled and monitored by us 24/7/365. A complete solution to provide you with our in house expertise 24/7 tailored to your specific needs. We'll setup a bespoke server for your site using the latest tehnologies so you can get the most out of your hardware and get your website loading quickly and reliably. Find out more..

cPanelCloud Servers

Recommended - High performance cloud servers with no technical knowledge required. If you're hosting multiple websites already and you're looking to consolidate, or if you're looking to isolate yourself from the shared hosting environment but you don't have the time or knoweldge to manage a server, then the Managed cPanel Servers are for you. Find out more..

UnmanagedCloud Servers

Our unmanaged range gives you complete control at rock bottom prices and our cloud platform boasts super fast multipath 40Gb/s network, the latest Intel Xeon V3 CPUs and enterprise grade redundant SSDs. If you're a sysadmin look no further, we offer some of the best specification to price ratio servers available. Find out more..

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 / month.

View Plans

How to Install Apache ActiveMQ on Ubuntu 14.04

ActiveMQ is one of the most popular and powerful open source messaging and integration patterns server.

ActiveMQ Features

Several ActiveMQ features:

  • Support a wide variety of language clients and protocol including but not limited to Java, C, C++, Ruby and Python.
  • On Java, C, C++ and C# we can use OpenWire for high performance client
  • Stomp support that enable us easily writing client code in C, Ruby, Perl, Python, PHP, ActionScript/Flash, Smalltalk to talk not only to ActiveMQ but also another popular message broker
  • Support AMQP v1.0
  • Support mQTT v3.1


In this tutorial we'll learn how-to install and do basic configuration of Apache ActiveMQ and all of its prerequisite on Ubuntu 14.04.


We assume that we have these items before we install Apache ActiveMQ:

  • Fresh install of Ubuntu Server 14.04. You can use any ubuntu flavors but using ubuntu server will make sure your server have minimalist ubuntu installation so your system will not be loaded by unnecessary softwares.
  • JDK 8. We will use Oracle JDK 8 for this tutorial. If you prefer OpenJDK you can instal OpenJDK 8.

Update Base System

Before we install Apache ActiveMQ and its prerequisites let's update the system to the latest update using the following commands:

$ sudo apt-get update
$ sudo apt-get -y upgrade

Install Oracle JDK

Now, let's install Java Development Kit 8. We will use Oracle JDK instead of OpenJDK version of JDK 8.

We'll also use webupd8team ppa repository instead of installing JDK manually. Add webupd8team PPA repository.

$ sudo add-apt-repository ppa:webupd8team/java
 Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 / JDK8 / JDK9). There are no actual Java files in this PPA.

More info (and Ubuntu installation instructions): - for Oracle Java 7: - for Oracle Java 8:

Debian installation instructions: - Oracle Java 7: - Oracle Java 8:

Important!!! For now, you should continue to use Java 8 because Oracle Java 9 is available as an early access release (it should be released in 2016)! You should only use Oracle Java 9 if you explicitly need it, because it may contain bugs and it might not include the latest security patches! Also, some Java options were removed in JDK9, so you may encounter issues with various Java apps. More information and installation instructions (Ubuntu / Linux Mint / Debian): More info: Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpaz5gxp9d/secring.gpg' created gpg: keyring `/tmp/tmpaz5gxp9d/pubring.gpg' created gpg: requesting key EEA14886 from hkp server gpg: /tmp/tmpaz5gxp9d/trustdb.gpg: trustdb created gpg: key EEA14886: public key "Launchpad VLC" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK

Update repository metadata.

$ sudo apt-get update

Install Oracle JDK 8.

$ sudo apt-get -y install oracle-java8-installer

Package configuration. Choose OK.

Accepting Oracle Binary Code Lisence Terms. Choose Yes

Check Java version by running command below.

$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Install ActiveMQ

Download Apache ActiveMQ from ActiveMQ mirror :

$ wget -c "" -O apache-activemq-5.14.3-bin.tar.gz

Extract downloaded file

$ tar xzf apache-activemq-5.14.3-bin.tar.gz

Rename extracted directory to activemq

$ mv apache-activemq-5.14.3 activemq

We will create user and group named activemq that will be used to run ActiveMQ. Create the group first

$ sudo addgroup --quiet --system activemq

Create activemq system user.

$ sudo adduser --quiet --system --ingroup activemq --no-create-home --disabled-password activemq

Modify /etc/passwd entry to change home and group for activemq user.

$ sudo usermod -c "ActiveMQ Broker" -d /opt/activemq -g activemq activemq

Change ownership of /opt/activemq directory to user activemq and group activemq.

$ sudo chown -R activemq:activemq /opt/activemq

Change the permission of /opt/activemq directory.

$ sudo chmod u=rwx,g=rxs,o= /opt/activemq

Configure ActiveMQ

Create default file for file by copying bin/env file to /etc/default/activemq.

$ sudo cp /opt/activemq/bin/env /etc/default/activemq

Change the ownership of /etc/default/activemq file to user and group root.

$ sudo chown root:root /etc/default/activemq

Now let's start configuring ActiveMQ. Open /etc/default/activemq file.

Find these lines:

# ACTIVEMQ_HOME="<Installationdir>/"

Replace with:


Replace with:


Copy init script to /etc/init.d using command below:

$ cd /opt/activemq
$ sudo cp bin/activemq /etc/init.d

Change ownership of ActiveMQ init script to user and group root

$ sudo chown root:root /etc/init.d/activemq

Set activemq to start on boot using update-rc.d

$ sudo update-rc.d activemq defaults

Now let's start ActiveMQ service using command below:

$ sudo service activemq start

ActiveMQ will show some output regarding the startup process:

INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
INFO: Starting - inspect logfiles specified in and to get details
INFO: changing to user 'activemq' to invoke java
INFO: pidfile created : '/opt/activemq/data/' (pid '22291')

To check whether ActiveMQ is already running or not we can use command below:

$ sudo service activemq status
INFO: Loading '/etc/default/activemq'
INFO: Using java '/usr/bin/java'
ActiveMQ is running (pid '22291')

We can also use ps to check whether ActiveMQ process is running or not.

$ ps aux | grep activemq
activemq 22516  108  7.9 2962096 80584 ?       Sl   09:14   0:03 /usr/bin/java -Xms64M -Xmx1G -Djava.awt.headless=true -Dactivemq.classpath=/opt/activemq/conf:/etc//../lib/: -Dactivemq.home=/opt/activemq -Dactivemq.base=/opt/activemq -Dactivemq.conf=/opt/activemq/conf -jar /opt/activemq/bin/activemq.jar start

ActiveMQ default port is 61616 we can use netstat to check if ActiveMQ already listen on that port.

$ sudo netstat -naptu | grep 61616
tcp6       0      0 :::61616                :::*                    LISTEN      22516/java 

ActiveMQ also has a web console that listens on port 8161 we can also check using netstat to check if ActiveMQ is already listening on that port:

$ sudo netstat -naptu | grep 8161
tcp6       0      0 :::8161                 :::*                    LISTEN      22516/java  

Accessing ActiveMQ Web Admin

To access the web admin we can point our browser to http://activemq-ipaddress:8161/admin

It will prompt authentication form. Input admin as default username and password.

From this web admin we can manage and monitor our ActiveMQ installation.

Monitoring ActiveMQ With

Beside using ActiveMQ default web admin we can also monitor our ActiveMQ installation using but we need to install Hawtio first.

We can download the latest version of from Getting Stated Page.

Let's download offline .war using wget

$ wget -c

Unzip downloaded .war:

$ unzip hawtio-default-offline-1.4.67.war -d hawtio

Move extracted war to webapps directory:

$ sudo mv hawtio /opt/activemq/webapps

We need to change ACTIVEMQ_OPTS to add hawtio options. Open /etc/default/activemq

Find the line:


Replace with:

ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY$ACTIVEMQ_CONF/login.config -Dhawtio.realm=activemq -Dhawtio.role=admins -Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal"

Open /opt/activemq/conf/jetty.xml, find line:

<ref bean="rewriteHandler"/>

Add these line below the line.

<bean class="org.eclipse.jetty.webapp.WebAppContext">
    <property name="contextPath" value="/hawtio" />
    <property name="resourceBase" value="${activemq.home}/webapps/hawtio" />
    <property name="logUrlOnStart" value="true" />

Now restart ActiveMQ process

$ sudo service activemq restart

Now point our browser to http://activemq-ipaddress:8161/hawtio. Login using admin as username and password.

Hawtio Welcome Page

Hawtio ActiveMQ dashboard.


In this tutorial we learned how-to install ActiveMQ on Ubuntu 14.04. We also learned accessing ActiveMQ web admin and installing Hawtio as alternative web admin for ActiveMQ.

Want your very own server? Get our 1GB memory, Xeon V4, 20GB SSD VPS for £10.00 / month.

View Plans