How to install Tomcat 8.0.0 RC5 on Ubuntu 12.04/12.10/13.04/13.10

Apache tomcat is a Java based application server released by the Apache Software Foundation. It is a web server and a servlet container for Java web applications.

What’s new in Tomcat 8

Apache Tomcat 8 is aligned with Java EE 7. In addition to supporting updated versions of the Java EE specifications, Tomcat 8 includes a number of improvements compared to Tomcat 7. The notable changes include:

  • Support for Java Servlet 3.1, JavaServer Pages 2.3, Java Unified Expression Language 3.0 and Java WebSocket 1.0.
  • The default connector implementation is now the Java non-blocking implementation (NIO) for both HTTP and AJP.
  • A new resources implementation that replaces Aliases, VirtualLoader, VirtualDirContext, JAR resources and external repositories with a single, consistent approach for configuring additional web application resources. The new resources implementation can also be used to implement overlays (using a master WAR as the basis for multiple web applications that each have their own customizations).
  • Improved stability of the APR/native connector when using WebSocket
  • A new drawing board example has been added to the WebSocket examples.
  • Support has been added for directly serving gzipped versions of a resource via the default servlet.

In this tutorial i will show you how to installTomcat 8.0.0 RC5 on Ubuntu 12.04/12.10/13.04/13.10 server. 

Apache Tomcat 8.0.0-RC5 installation

Before you install Tomcat 8.0.0 RC5, you need to install Java.

# sudo apt-get install openjdk-7-jdk

Now, download Apache Tomcat 8.0.0 RC5:

# wget

Extract and move to /usr/local/ Apache Tomcat package:

# tar -xvf apache-tomcat-8.0.0-RC5.tar.gz
#sudo mv mv apache-tomcat-8.0.0-RC5 /usr/local/

Create tomcat8 file in /etc/init.d/

# sudo vim /etc/init.d/tomcat8

and paste following code:

export CATALINA_HOME=/usr/local/apache-tomcat-8.0.0-RC5
start() {
stop() {
case $1 in
  start|stop) $1;;
  restart) stop; start;;
  *) echo "Run as $0 <start|stop|restart>"; exit 1;;

This file will create a service named tomcat8. Please change CATALINA_HOME in the code according to your path.
Modify /etc/init.d/tomcat8 file permissions:

# sudo chmod 755 /etc/init.d/tomcat8

Set username and password to manage tomcat and add to:

#sudo vim /usr/local/apache-tomcat-8.0.0-RC5/conf/tomcat-users.xml

and add following line:

role rolename="manager-gui"
role rolename="admin-gui"
user username="rasho" password="password" roles="manager-gui,admin-gui"
Set username and password to manage tomcat
Start tomcat 8 service:

 sudo /etc/init.d/tomcat8 start

and type this command to start service automatically during reboot:

# sudo update-rc.d tomcat8 defaults

Now open http://serverip:8080 in your browser.

Tomcat 8 default page
Tomcat server status page
Tomcat virtual host manager


  1. I am struggling to install solr 4.7.2 with tomcat 8.

    I followed your instructions to install Tomcat 8.0.5 but Solr, which was manually installed, doesn’t appear in /etc, and my instructions require it –

    Now, let’s a get Solr into Tomcat Catalina config. Create a new solr.xml file:

    $ sudo nano /etc/tomcat7/Catalina/localhost/solr.xml

    Any advice on how to establish /etc/tomcat8/Catalina/localhost/solr.xml on my ubuntu server?

  2. I think there is a typo toward the end. Perhaps:

    # sudo update-rc.d tomcat747 defaults

    should be

    # sudo update-rc.d tomcat8 defaults

    Otherwise very helpful, thanks!

  3. i installed but for the 1st time it was running,after that if i try to shutdown tomcat,it is not shutdowning.SEVERE: Could not contact localhost:8005. Tomcat may not be running.
    Nov 21, 2014 4:39:21 AM org.apache.catalina.startup.Catalina stopServer
    SEVERE: Catalina.stop: Connection refused
    at Method)
    at org.apache.catalina.startup.Catalina.stopServer(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.apache.catalina.startup.Bootstrap.stopServer(
    at org.apache.catalina.startup.Bootstrap.main(
    can u help? thnks in advance

Leave a Reply to afro54 Cancel reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Check Also
Back to top button