How to install ActiveMQ on Ubuntu 16.04

Spread the love


How to install ActiveMQ on Ubuntu 16.04

In this tutorial, we’ll show you, How to install ActiveMQ on Ubuntu 16.04. ctiveMQ is an open-source, message broker software, which can serve as a central point for communication between distributed processes. In other words, it’s used to reliably communicate between two distributed processes or applications/services that need to communicate with each other, but their languages are incompatible between each other. Since its creation, ActiveMQ has turned into a strong alternative to the commercial alternatives like EMS/TIBCO or WebSphereMQ and it is actively used in production by some of the top companies ranging from financial services to retail. Installing ActiveMQ on Ubuntu 16.04, if pretty easy task, just follow the steps bellow and you should have it installed in less then 10 minutes. There is very little information on how ActiveMQ is installed. In reality, the installation is pretty straight forward, but and the official documentation is very vague and this leads to frustration in an inexperienced person. In this blog post, we will explain how ActiveMQ can be installed on a Ubuntu 16 VPS.

First things update/upgrade your Virtual Server with the latest software:

# apt-get update && apt-get upgrade

Install the default Java JDK

# apt-get install default-jdk

Check if the java has correctly been installed:

# java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2ubuntu0.16.04.2-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

We are now ready to install ActiveMQ. We will be installing into the /opt directory by downloading the tar archive from their official site. At the moment of installing 5.14.3 is the current version:

# cd /opt
# wget

### Unpack the archive and create a simlink to the current installation for easier access later.
# tar zxf apache-activemq-5.14.3-bin.tar.gz
# ln -s /opt/apache-activemq-5.14.3 activemq
# rm apache-activemq-5.14.3-bin.tar.gz

At this moment the installation is complete. ActiveMQ configuration files are located in its default directory in the conf folder. In our case, they are located into /opt/activemq/conf/. The default configuration files work well for testing the application. The file of our interest is the /opt/activemq/conf/activemq.xml file because in here are defined the transport connectors i.e. the protocols which we like to be enabled or disabled for our ActiveMQ implementation.

Feel free to check the <transportConnectors> section and comment out any unwanted protocols. For testing purposes, you can leave the default as it is.

 <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
 <transportConnector name="openwire" uri="tcp://;wireFormat.maxFrameSize=104857600"/>
 <transportConnector name="amqp" uri="amqp://;wireFormat.maxFrameSize=104857600"/>
 <transportConnector name="stomp" uri="stomp://;wireFormat.maxFrameSize=104857600"/>
 <transportConnector name="mqtt" uri="mqtt://;wireFormat.maxFrameSize=104857600"/>
 <transportConnector name="ws" uri="ws://;wireFormat.maxFrameSize=104857600"/>

Start the ActiveMQ server whenever you feel ready:

# /opt/activemq/bin/activemq start

Check that everything is good using the netstat command:

# netstat -tulnp | grep java
tcp 0 0* LISTEN 25074/java
tcp 0 0* LISTEN 25074/java
tcp 0 0* LISTEN 25074/java
tcp 0 0* LISTEN 25074/java
tcp 0 0* LISTEN 25074/java
tcp 0 0* LISTEN 25074/java
tcp 0 0* LISTEN 25074/java

ActiveMQ’s web administration interface listens on port :8161. It can be accessed using the bellow URL for the front-end and the back-end respectively where WW.XX.YY.ZZ is your VPS IP Address. The default username and password are both admin


And that’s it, you now have functioning ActiveMQ service

PS. If you liked this post, on howw to install ActiveMQ on Ubuntu 16.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.


  Comments: 2

  1. Hi, thanks for sharing.
    How can you configure it to run as a service on Ubuntu 16.04 and log in the file /var/log/activemq/activemq.log ?

Your feedback