{"id":33575,"date":"2020-11-07T14:07:41","date_gmt":"2020-11-07T20:07:41","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=33575"},"modified":"2022-06-03T03:32:31","modified_gmt":"2022-06-03T08:32:31","slug":"how-to-install-tomcat-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/","title":{"rendered":"How to Install Tomcat on Ubuntu 20.04"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-large is-style-default\"><img decoding=\"async\" width=\"742\" height=\"372\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg\" alt=\"install apache tomcat ubuntu 20.04\" class=\"wp-image-34667\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg 742w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04-300x150.jpg 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04-150x75.jpg 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/figure>\n\n\n\n<p>Apache Tomcat (Or just Tomcat for short) is the most popular and widely-used Java application server. It is an open-source web server and servlet container developed by the Apache Software Foundation (ASF). In this tutorial, we will guide you through the steps of installing Tomcat 9 on an <a href=\"https:\/\/www.rosehosting.com\/ubuntu-hosting.html\">Ubuntu 20.04 VPS<\/a>.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"alignright size-large\"><img decoding=\"async\" width=\"120\" height=\"80\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/installation-apache-tomcat-ubuntu-20-04-vps.jpg\" alt=\"installation tomcat ubuntu server\" class=\"wp-image-34668\"\/><\/figure><\/div>\n\n\n\n<p>Tomcat is also an open-source software implementation of a subset of the Jakarta EE (formerly Java EE) technologies. Tomcat executes Java servlets and renders Web pages that include Java Server Page coding. By using Tomcat, you&#8217;re able to run your Java applications on a server that is designed to help you develop your Java applications faster and more efficiently. Let&#8217;s start installing Tomcat on our Ubuntu 20.04 VPS.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f3d7508e031\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f3d7508e031\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#Requirements\" >Requirements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#1-Getting-Started\" >1. Getting Started<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#2-Install-Java\" >2. Install Java<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#3-Install-Tomcat-9\" >3. Install Tomcat 9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#4-Add-a-Tomcat-user\" >4. Add a Tomcat user<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#5-Create-a-Systemd-Service-File-for-Tomcat\" >5. Create a Systemd Service File for Tomcat<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#6-Configure-Tomcat\" >6. Configure Tomcat<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-requirements\"><span class=\"ez-toc-section\" id=\"Requirements\"><\/span>Requirements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Make sure that your server meets the following minimum requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>For the purposes of this tutorial, we will use a server running Ubuntu VPS 20.04 LTS.<\/li><li>Full SSH root access, or a user with sudo privileges is also required.<\/li><li>Java 8 or higher.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-getting-started\"><span class=\"ez-toc-section\" id=\"1-Getting-Started\"><\/span>1. Getting Started<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Log in to your Ubuntu 20.04 VPS using SSH:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh root@IP_Address -p Port_number<\/pre>\n\n\n\n<p>Make sure to replace \u201cIP_Address\u201d and \u201cPort_number\u201d with your server\u2019s actual IP address and SSH port number.<\/p>\n\n\n\n<p>Once logged in, you can check whether you have the proper Ubuntu version installed on your server with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># lsb_release -a<\/pre>\n\n\n\n<p>You should get this as your output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Distributor ID: Ubuntu\nDescription: Ubuntu 20.04 LTS\nRelease: 20.04\nCodename: focal<\/pre>\n\n\n\n<p>Then, run the following command to make sure that all installed packages on the server are updated to the latest available version.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># apt update &amp;&amp; apt upgrade -y<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-install-java\"><span class=\"ez-toc-section\" id=\"2-Install-Java\"><\/span>2. Install Java<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Tomcat 9 requires Java version 8 or higher.<br>We can check if Java is already installed using this command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># which java<\/pre>\n\n\n\n<p>If there is no output, it means that Java is not installed on the server yet. We can install Oracle JDK or OpenJDK. We need to have Java version 8 or higher installed on your system to run Tomcat 9. We can install the default JDK, version 11, which is available on the built-in Ubuntu 20.04 repositories by using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># apt install default-jdk -y<\/pre>\n\n\n\n<p>Once installed, we can check the version using this command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># java --version<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">root@ubuntu20:~# java --version\nopenjdk 11.0.7 2020-04-14\nOpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)\nOpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-install-tomcat-9\"><span class=\"ez-toc-section\" id=\"3-Install-Tomcat-9\"><\/span>3. Install Tomcat 9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When writing this tutorial, the latest stable Tomcat to download is version 9.0.35. You can navigate to https:\/\/tomcat.apache.org\/download-90.cgi for more recent version, if any. To proceed with the installation, let&#8217;s download the binary distribution file first.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># wget https:\/\/downloads.apache.org\/tomcat\/tomcat-9\/v9.0.35\/bin\/apache-tomcat-9.0.35.tar.gz -O tomcat.9.0.35.tar.gz<\/pre>\n\n\n\n<p>In this article, we will install Tomcat  into the <code>\/opt\/tomcat<\/code> directory. Let&#8217;s create the directory and decompress the downloaded file there.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># mkdir \/opt\/tomcat<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># tar xzvf tomcat.9.0.35.tar.gz -C \/opt\/tomcat --strip-components=1<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-add-a-tomcat-user\"><span class=\"ez-toc-section\" id=\"4-Add-a-Tomcat-user\"><\/span>4. Add a Tomcat user<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It is not a good idea to run Tomcat as root, so for security reasons we will create a new system user:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># useradd -r tomcat -d \/opt\/tomcat --shell \/bin\/false<\/pre>\n\n\n\n<p>Once the Tomcat system user has been created, we need to update the ownership of the <code>\/opt\/tomcat<\/code> directory to tomcat user:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># chown tomcat: -R \/opt\/tomcat\/<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-create-a-systemd-service-file-for-tomcat\"><span class=\"ez-toc-section\" id=\"5-Create-a-Systemd-Service-File-for-Tomcat\"><\/span>5. Create a Systemd Service File for Tomcat<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Check the path of Tomcat\u2019s home by running this command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># update-java-alternatives -l<\/pre>\n\n\n\n<p>Output<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@ubuntu20:~# update-java-alternatives -l\njava-1.11.0-openjdk-amd64 1111 \/usr\/lib\/jvm\/java-1.11.0-openjdk-amd64<\/pre>\n\n\n\n<p>We need the value of the third column for our Tomcat systemd file to set the <code>JAVA_HOME<\/code> environment variable.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># nano \/etc\/systemd\/system\/tomcat.service<\/pre>\n\n\n\n<p>Paste the following into the systemd service file, then save it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[Unit]\nDescription=Apache Tomcat\nAfter=network.target\n\n[Service]\nType=forking\n\nUser=tomcat\nGroup=tomcat\n\nEnvironment=JAVA_HOME=\/usr\/lib\/jvm\/java-11-openjdk-amd64\nEnvironment=CATALINA_PID=\/opt\/tomcat\/tomcat.pid\nEnvironment=CATALINA_HOME=\/opt\/tomcat\nEnvironment=CATALINA_BASE=\/opt\/tomcat\nEnvironment=\"CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC\"\n\nExecStart=\/opt\/tomcat\/bin\/startup.sh\nExecStop=\/opt\/tomcat\/bin\/shutdown.sh\n\nExecReload=\/bin\/kill $MAINPID\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target\n<\/pre>\n\n\n\n<p>Save the changes, then start Tomcat.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl daemon-reload<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl start tomcat<\/pre>\n\n\n\n<p>Tomcat should be started now, you can check it with this command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@ubuntu20:~# systemctl status tomcat\n\u25cf tomcat.service - Apache Tomcat\nLoaded: loaded (\/etc\/systemd\/system\/tomcat.service; disabled; vendor preset: enabled)\nActive: active (running) since Mon 2020-06-01 03:43:31 CEST; 1h 14min ago\nProcess: 12975 ExecStart=\/opt\/tomcat\/bin\/startup.sh (code=exited, status=0\/SUCCESS)\nMain PID: 12997 (java)\nTasks: 30 (limit: 2286)\nMemory: 253.4M\nCGroup: \/system.slice\/tomcat.service\n\u2514\u250012997 \/usr\/lib\/jvm\/java-11-openjdk-amd64\/bin\/java -Djava.util.logging.config.file=\/opt\/tomcat\/conf\/logging.properties -Djava.util.logging.manager=org.ap&gt;\n\nJun 01 03:43:31 ubuntu20 systemd[1]: Starting Apache Tomcat...\nJun 01 03:43:31 ubuntu20 startup.sh[12975]: Tomcat started.\nJun 01 03:43:31 ubuntu20 systemd[1]: Started Apache Tomcat.\n<\/pre>\n\n\n\n<p>Now, you should be able to access Tomcat at <code>http:\/\/your-server-IP:8080<\/code> .<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"1011\" height=\"524\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat9.png\" alt=\"\" class=\"wp-image-33578\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat9.png 1011w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat9-300x155.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat9-150x78.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat9-768x398.png 768w\" sizes=\"(max-width: 1011px) 100vw, 1011px\" \/><\/figure><\/div>\n\n\n\n<p>In order to make Tomcat automatically run at boot, we need to enable the systemd service file. You can do so like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># systemctl enable tomcat<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-6-configure-tomcat\"><span class=\"ez-toc-section\" id=\"6-Configure-Tomcat\"><\/span>6. Configure Tomcat<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In order to be able to access the Tomcat Manager, we need to create a user for Tomcat. Let proceed with editing the <code>tomcat-users.xml<\/code> file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># nano \/opt\/tomcat\/conf\/tomcat-users.xml<\/pre>\n\n\n\n<p>then add the following lines just before the closing line <code>&lt;\/tomcat-users&gt;:<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;role rolename=\"manager-gui\" \/&gt;\n&lt;role rolename=\"admin-gui\" \/&gt;changes\n&lt;user username=\"admin\" password=\"<strong>M0d1fyth15<\/strong>\" roles=\"manager-gui,admin-gui\"\/&gt;<\/pre>\n\n\n\n<p>Don\u2019t forget to replace <strong>M0d1fyth15<\/strong> with an actual strong password.<\/p>\n\n\n\n<p>We would need to make another configuration because by default Tomcat restricts access to the Manager and Host Manager, it only allows connection from the server IP address itself. To change the IP address restrictions on these, open the appropriate context.xml files.<\/p>\n\n\n\n<p>To remove the restriction on the Manager App, we need to modify this <code>\/opt\/tomcat\/webapps\/manager\/META-INF\/context.xml<\/code> file. And, to remove the restriction on the Host Manager, we need to modify the <code>\/opt\/tomcat\/webapps\/host-manager\/META-INF\/context.xml<\/code> file.<\/p>\n\n\n\n<p>Find these two lines in those files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Valve className=\"org.apache.catalina.valves.RemoteAddrValve\"\n         allow=\"127\\.\\d+\\.\\d+\\.\\d+|::1|0:0:0:0:0:0:0:1\" \/>\n<\/code><\/pre>\n\n\n\n<p>Then comment them out. The lines should look like the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- \n&lt;Valve className=\"org.apache.catalina.valves.RemoteAddrValve\"\n         allow=\"127\\.\\d+\\.\\d+\\.\\d+|::1|0:0:0:0:0:0:0:1\" \/> \n-->\n<\/code><\/pre>\n\n\n\n<p>That&#8217;s it, you should be able to access Tomcat Manager and Host Manager using the user credentials that you created earlier.<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"1024\" height=\"488\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat-manager-gui-1024x488.png\" alt=\"\" class=\"wp-image-33579\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat-manager-gui-1024x488.png 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat-manager-gui-300x143.png 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat-manager-gui-150x71.png 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat-manager-gui-768x366.png 768w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/05\/tomcat-manager-gui.png 1349w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>That&#8217;s all you need to do &#8211; you now have a working install of Tomcat on your Ubuntu 20.04 VPS.<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"alignleft size-large\"><img decoding=\"async\" width=\"120\" height=\"80\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/managed-tomcat-java-install-configure-ubuntu.jpg\" alt=\"installing apache tomcat ubuntu 20.04 server\" class=\"wp-image-34670\"\/><\/figure><\/div>\n\n\n\n<p>Developing applications that benefit from a server environment can be complex for developers that aren&#8217;t system administrators. That is where our <a href=\"https:\/\/www.rosehosting.com\/tomcat-hosting.html\">Managed Tomcat hosting<\/a> services come in. Our administrators can get you completely set up and running with your projects quickly and easily. They also maintain and keep everything running as it should, and if you have any requests, they can help you with that as well.<\/p>\n\n\n\n<p>If this guide was useful to you and it helped you get Tomcat running on your system, please consider sharing this post on social networks with our share shortcuts, or let us know how your installation experience went by leaving a comment in our comment section. Thank you.<span style=\"color: #ff0000;\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache Tomcat (Or just Tomcat for short) is the most popular and widely-used Java application server. It is an open-source &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Install Tomcat on Ubuntu 20.04\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#more-33575\" aria-label=\"Read more about How to Install Tomcat on Ubuntu 20.04\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":34667,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,1698],"tags":[77,90,1839],"class_list":["post-33575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-ubuntu","tag-java","tag-tomcat","tag-ubuntu-20-04","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Install Tomcat on Ubuntu 20.04 | RoseHosting<\/title>\n<meta name=\"description\" content=\"We can show you how to set up Apache Tomcat on your Ubuntu 20.04 server. Tomcat lets you run your Java servlets easily and quickly.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Tomcat on Ubuntu 20.04\" \/>\n<meta property=\"og:description\" content=\"How to Install Tomcat on Ubuntu 20.04 | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-07T20:07:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-03T08:32:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Install Tomcat on Ubuntu 20.04\",\"datePublished\":\"2020-11-07T20:07:41+00:00\",\"dateModified\":\"2022-06-03T08:32:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/\"},\"wordCount\":838,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-install-tomcat-on-ubuntu-20-04.jpg\",\"keywords\":[\"java\",\"tomcat\",\"Ubuntu 20.04\"],\"articleSection\":[\"Tutorials\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/\",\"name\":\"How to Install Tomcat on Ubuntu 20.04 | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-install-tomcat-on-ubuntu-20-04.jpg\",\"datePublished\":\"2020-11-07T20:07:41+00:00\",\"dateModified\":\"2022-06-03T08:32:31+00:00\",\"description\":\"We can show you how to set up Apache Tomcat on your Ubuntu 20.04 server. Tomcat lets you run your Java servlets easily and quickly.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-install-tomcat-on-ubuntu-20-04.jpg\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/how-to-install-tomcat-on-ubuntu-20-04.jpg\",\"width\":742,\"height\":372,\"caption\":\"install apache tomcat ubuntu 20.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-install-tomcat-on-ubuntu-20-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Tomcat on Ubuntu 20.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Install Tomcat on Ubuntu 20.04 | RoseHosting","description":"We can show you how to set up Apache Tomcat on your Ubuntu 20.04 server. Tomcat lets you run your Java servlets easily and quickly.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Tomcat on Ubuntu 20.04","og_description":"How to Install Tomcat on Ubuntu 20.04 | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2020-11-07T20:07:41+00:00","article_modified_time":"2022-06-03T08:32:31+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Install Tomcat on Ubuntu 20.04","datePublished":"2020-11-07T20:07:41+00:00","dateModified":"2022-06-03T08:32:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/"},"wordCount":838,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg","keywords":["java","tomcat","Ubuntu 20.04"],"articleSection":["Tutorials","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/","name":"How to Install Tomcat on Ubuntu 20.04 | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg","datePublished":"2020-11-07T20:07:41+00:00","dateModified":"2022-06-03T08:32:31+00:00","description":"We can show you how to set up Apache Tomcat on your Ubuntu 20.04 server. Tomcat lets you run your Java servlets easily and quickly.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2020\/10\/how-to-install-tomcat-on-ubuntu-20-04.jpg","width":742,"height":372,"caption":"install apache tomcat ubuntu 20.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-install-tomcat-on-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install Tomcat on Ubuntu 20.04"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/33575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=33575"}],"version-history":[{"count":9,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/33575\/revisions"}],"predecessor-version":[{"id":34915,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/33575\/revisions\/34915"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/34667"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=33575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=33575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=33575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}