Install tomcat in Ubuntu


Apache Tomcat is an Open Source Application that implements java Servlet, JSP(java Server Page) is used to deploy web application in the servlet container. Catalina┬áis┬áTomcat’s┬áservlet┬ácontainer.┬áContainer┬áManage┬ásecurity┬áas┬ádescribed┬áin┬áthe┬áServlet┬áSpecification.


  1. One user account who has sudo access.
  2. JRE must be installed and JAVA_HOME variable must be set into environment.
    (If you don’t have JDK/JRE installed in you system you can find the steps here ).


Install Apache tomcat on Ubuntu

Step 1. Download the tar.gz file from Download page


$ wget

Step 2. Goto to the directory where you want to install tomcat. I have installed it in “/etc/opt/ ”

$ sudo cd /etc/opt

Step 3. Extract the tar

$ sudo tar -xvzf ~/Downloads/apache-tomcat-9.0.30.tar.gz

Step 4. Rename the folder to tomcat only.

$ sudo mv apache-tomcat-9.0.30 tomcat

Step 5. Give permission for executing and

$ chmod +x etc/opt/tomcat/bin/*

Step 5. Now set environment variable CATALINA_HOME

$ sudo vi /etc/environment

Press E for edit and add the tomcat installed path to the environment /opt/tomcat
To take effect you need to refresh the environment.

$ sudo source /etc/environment

Now check the CATALINA_HOME path


If CATALINA_HOME is not showing the path redo the above steps.

Step 7. Now Start Tomcat

$ sudo CATALINA_HOME/bin/

Step 8: Default port of Tomcat is 8080. If you want you can change the default port of tomcat in config. Now go to the browser and type this URL localhost:8080

Stopping tomcat

$ sudo CATALINA_HOME/bin/

Congratulations you have successfully installed Tomcat in your system. Now you can deploy your Web Apps in tomcat.

To change the default configuration of tomcat read here. Change Tomcat default port in Ubuntu

Thank You

Leave a Reply