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 And Configure Apache Tomcat 8 on Ubuntu 15.10


Previously we already learned how-to install and configure Apache Tomcat 7 on Ubuntu 14.04. In this tutorial we will learn how-to install Apache Tomcat 8 on Ubuntu 15.10.

Apache Tomcat is an open source software implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies.

Apache Tomcated is powered many large sites and applications world wide, including but not limited to, Alfresco, CiteSeerX. We can see a list of sites and applications PoweredBy page on Apache Tomcat wiki.

Updating Base System

This tutorial assumes that we have clean install of Ubuntu 15.10 Server. Before we install Apache Tomcat 8 and its prerequisites let's update our base system.

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

Installing JDK 8

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

Add the webupd8team ppa repository :

$ sudo add-apt-repository ppa:webupd8team/java
Press [ENTER] to continue or ctrl-c to cancel adding it

... OK

We need to press enter to continue adding the webupd8team PPA repository. The output is truncated above to show you only the most important part.

Let apt-get download and read the metadata of the new repository that we just added:

$ sudo apt-get update

Install JDK 8.

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

The -y option above will make you agree automatically with packages to be installed including dependencies. If you want to check what packages will be installed you can remove the -y option above.

Package configuration. Choose OK Accepting Oracle Binary Code Lisence Terms. Choose Yes

After installing Java 8, you can check the current java version by running the command below :

$ java -version
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

We've confirmed that we already have JDK 8 installed.

Installing Apache Tomcat 8

Now we're ready to install Apache Tomcat 8. To install Apache Tomcat 8 we can run the command below :

$ sudo apt-get -y install tomcat8

Apache Tomcat 8 should now be installed. Let's check the tomcat8 service status using command below:

$ sudo service tomcat8 status
● tomcat8.service - LSB: Start Tomcat.
   Loaded: loaded (/etc/init.d/tomcat8)
   Active: active (running) since Tue 2016-03-22 23:07:55 UTC; 38s ago
``` language-bash
     Docs: man:systemd-sysv-generator(8)

CGroup: /system.slice/tomcat8.service

<pre><code class="language-bash"> └─15286 /usr/lib/jvm/java-8-oracle/bin/java -Djava.util.logging.config.file=/var/lib/tomcat8/conf/ -Djava.util.logging.manage... </code></pre>

Mar 22 23:07:50 vagrant-ubuntu-wily-64 systemd[1]: Starting LSB: Start Tomcat.... Mar 22 23:07:50 vagrant-ubuntu-wily-64 tomcat8[15263]: * Starting Tomcat servlet engine tomcat8 Mar 22 23:07:55 vagrant-ubuntu-wily-64 tomcat8[15263]: ...done. Mar 22 23:07:55 vagrant-ubuntu-wily-64 systemd[1]: Started LSB: Start Tomcat..

<pre><code><br />We can also check whether the tomcat8 process is already listening on the correct port or not. By default tomcat listens on port 8080. </code></pre>

$ sudo netstat -naptu | grep java tcp6 0 0 :::8080 :::* LISTEN 15286/java<br /> tcp6 0 0 :::* LISTEN 15286/java

<pre><code><br />We can see from both of the outputs above that tomcat is already running. Now from our browser, open http://:8080. You should see a page like below :


## Install Tomcat 8 Web Admin Tomcat 8 has a web based application to manage its own service and application running on top of it. It's not installed by default. We will install the ```tomcat8-admin``` package first before configuring a user for Tomcat 8 Web Admin. We can run the command below to install tomcat8 admin:

$ sudo apt-get -y install tomcat8-admin

## Install Tomcat 8 Documentation and Examples

If this is not a production machine, we can also install Tomcat 8 Documentation and an example package. We can use the commmand below to install documentation and example packages:

$ sudo apt-get -y install tomcat8-docs tomcat8-examples

However, if this is a production machine, it's recommended to only install ```tomcat8``` and ```tomcat8-admin``` packages.

## Configure Admin User on Apache Tomcat 8

The Tomcat 8 web manager admin does not ship with default username and password. We have to add a username and put the user to the correct role.

There are four roles available that we can use. The available roles are:

* manager-gui — Access to the HTML interface. * manager-status — Access to the "Server Status" page only. * manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page. * manager-jmx — Access to JMX proxy interface and to the "Server Status" page. In this tutorial we will add the ```hostpresto``` user, and add this user to the ```manager-gui``` role. Open ```/etc/tomcat8/tomcat-users.xml``` using a text editor. We will need open the text editor using the ```sudo``` command. Find `````` at the end of the file, above this line, add the line :

Don't forget to change the password ```verysecretchangeme``` above.

Restart the tomcat8 service so the configuration changes are applied :

$ sudo service tomcat8 restart Now point your browser tohttp://:8080/manager/html```. It will show you a login prompt. We can login to the Tomcat Web Application Manager that we created above.

After logging in we can manage tomcat using the Tomcat Web Application Manager. On the top of the page we can see a list of applications deployed on this tomcat 8 server.

On the bottom, we can deploy a new application from this web manager by uploading a .war file. We can also see the status of the server by clicking the Server Status link or open http://:8080/manager/status in your browser.


In this tutorial we learned how-to install Tomcat 8 on Ubuntu 15.10. We also installed Tomcat web application manager and configured the administrator level user with role manager-gui role.

Now you can start deploying your own applications on Tomcat 8. Have Fun!

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

View Plans