{"id":16321,"date":"2019-03-29T12:33:02","date_gmt":"2019-03-29T12:33:02","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=16321"},"modified":"2025-02-21T14:16:25","modified_gmt":"2025-02-21T14:16:25","slug":"how-to-install-tomcat-on-ubuntu","status":"publish","type":"post","link":"\/ph\/tutorials\/how-to-install-tomcat-on-ubuntu\/","title":{"rendered":"How to Install Tomcat on Ubuntu in 2026"},"content":{"rendered":"<p>Tomcat, often called Apache Tomcat, is one of the most popular applications designed to execute a Java servlet and render web servers with Java page coding.<\/p><p>It is an open-source application released by Apache Software Foundation. Many developers favor it! That&rsquo;s why in this tutorial, we&rsquo;ll show you how to install Tomcat on Ubuntu and set it up for use on your VPS host.<\/p><p>Tomcat generates JSP files (server-generated webpages similar to PHP and ASP files) into Java code, further compiling to <strong>.class<\/strong> files by the server, and executed by the Java virtual machine. As of today, Tomcat is definitely one of the more useable servlet containers available.<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"2048\" height=\"566\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet.png 2048w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-300x83.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-1536x425.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-150x41.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2022\/11\/Linux-cheat-sheet-768x212.png 768w\" sizes=\"(max-width: 2048px) 100vw, 2048px\" \/><\/a><\/figure>\n<\/div><p>\n\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-prerequisites\">Prerequisites<\/h2><p>Before you begin with the guide, have a non-root user with&nbsp;sudo&nbsp;privileges set up on your server. Remember to access your server with <a href=\"\/ph\/tutorials\/ssh-tutorial-how-does-ssh-work\/\">SSH<\/a>. Check out our <a href=\"\/ph\/tutorials\/how-to-use-putty-ssh\/\">PuTTY tutorial<\/a> if you&rsquo;re having issues. Alternatively, you can access our browser-based SSH terminal straight from hPanel:<\/p><figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2019\/03\/hpanel-vps-overview-vpsinformation-browserterminal-highlighted.png\"><img decoding=\"async\" width=\"1024\" height=\"732\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2019\/03\/hpanel-vps-overview-vpsinformation-browserterminal-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The VPS information page on hPanel. The Browser terminal window is highlighted\" class=\"wp-image-87084\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/03\/hpanel-vps-overview-vpsinformation-browserterminal-highlighted.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/03\/hpanel-vps-overview-vpsinformation-browserterminal-highlighted-300x214.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/03\/hpanel-vps-overview-vpsinformation-browserterminal-highlighted-150x107.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2019\/03\/hpanel-vps-overview-vpsinformation-browserterminal-highlighted-768x549.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><figure class=\"wp-block-image size-large\"><a href=\"\/ph\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,h=1024,fit=scale-down\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-how-to-install-tomcat-on-ubuntu\">How to Install Tomcat on Ubuntu<\/h2><p>This tutorial will teach you how to install Tomcat 9 on Ubuntu, and how to configure it for use. <\/p><h3 class=\"wp-block-heading\" id=\"h-1-install-java\">1. Install Java<\/h3><p>Before we install Tomcat on Ubuntu, we need to install Java to execute the Java web application code. OpenJDK is the default Java development in Ubuntu. Installing Java is simple and quick. Just follow the below commands:<\/p><pre class=\"wp-block-preformatted\">sudo apt update<\/pre><p>Install the <a href=\"\/ph\/tutorials\/install-java-ubuntu\/\">OpenJDK<\/a> package by running:<\/p><pre class=\"wp-block-preformatted\">sudo apt install default&ndash;jdk<\/pre><p>Now that JDK is installed in your system, you can create the user tomcat by following the next step.<\/p><h3 class=\"wp-block-heading\" id=\"h-2-create-tomcat-user\">2. Create Tomcat User<\/h3><p>For security, you should not use Tomcat without a unique user. This will make the install of Tomcat on Ubuntu easier. Create a new tomcat group that will run the service:<\/p><pre class=\"wp-block-preformatted\">sudo groupadd tomcat<\/pre><p>Now, the next procedure is to create a new tomcat user. Create user members of the Tomcat group with a home directory opt\/tomcat&nbsp;for running the Tomcat service:<\/p><pre class=\"wp-block-preformatted\">sudo useradd -s \/bin\/false -g tomcat -d \/opt\/tomcat tomcat<\/pre><h3 class=\"wp-block-heading\" id=\"h-3-install-tomcat-on-ubuntu\">3. Install Tomcat on Ubuntu<\/h3><p>The best way to install Tomcat 9 on Ubuntu is to download the latest binary release from the <a href=\"https:\/\/tomcat.apache.org\/download-90.cgi\" target=\"_blank\" rel=\"noopener\">Tomcat 9 downloads page<\/a> and configure it manually. If the version is not 9.0.60&nbsp;or it&rsquo;s the latest version, then follow the latest stable version. Just copy the link of the core <a href=\"\/ph\/tutorials\/linux-tar-command-with-examples\/\">tar.gz<\/a> file under the Binary Distributions section.<\/p><p>Now, change to the <strong>\/tmp<\/strong> directory on your server to download the items which you won&rsquo;t need after extracting the Tomcat contents:<\/p><pre class=\"wp-block-preformatted\">cd \/tmp<\/pre><p>To download from the copied link (from Tomcat website), use the following <a href=\"\/ph\/tutorials\/curl-command-with-examples-linux\/\">curl command<\/a>:<\/p><pre class=\"wp-block-preformatted\">cucurl -O https:\/\/dlcdn.apache.org\/tomcat\/tomcat-9\/v9.0.63\/bin\/apache-tomcat-9.0.63.tar.gz<\/pre><h3 class=\"wp-block-heading\" id=\"h-4-update-permissions\">4. Update Permissions<\/h3><p>Now that you finished the install of Tomcat on Ubuntu, you need to set up the Tomcat user to have full access to the Tomcat installation. This user needs to have access to the directory. Follow the steps below:<\/p><pre class=\"wp-block-preformatted\">sudo mkdir \/opt\/tomcat<\/pre><pre class=\"wp-block-preformatted\">cd \/opt\/tomcat<\/pre><pre class=\"wp-block-preformatted\">sudo tar xzvf \/tmp\/apache-tomcat-9.0.*tar.gz -C \/opt\/tomcat --strip-components=1<\/pre><p>Now, give the Tomcat group ownership over the entire installation directory with the <a href=\"\/ph\/tutorials\/linux-chown-command\/\">chgrp command<\/a>:<\/p><pre class=\"wp-block-preformatted\">sudo chgrp&nbsp;-R tomcat \/opt\/tomcat<\/pre><p>Next, you need to give the Tomcat user&nbsp;access to the conf directory to view its contents and execute access to the directory itself:<\/p><pre class=\"wp-block-preformatted\">sudo chmod -R g+r conf<\/pre><pre class=\"wp-block-preformatted\">sudo chmod g+x conf<\/pre><p>Make the&nbsp;Tomcat&nbsp;user the owner of the&nbsp;web apps,&nbsp;work,&nbsp;temp, and&nbsp;logs&nbsp;directories:<\/p><pre class=\"wp-block-preformatted\">sudo chown -R tomcat webapps\/ work\/ temp\/ logs\/<\/pre><p>\n\n\n        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Suggested Reading                <\/p>\n            <\/div>\n            <p class=\"protip__content\">Check out our other article to learn more about <a href=\"\/ph\/tutorials\/vps\/change-linux-permissions-and-owners\/\">changing permissions and owners in Linux<\/a> using command-line interface.<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-5-create-a-systemd-unit-file\">5. Create a systemd Unit File<\/h3><p>We will need to create a new unit file to run Tomcat as a service. Open your text editor and create a file name tomcat.service&nbsp;in the <strong>\/etc\/systemd\/system\/<\/strong>:<\/p><pre class=\"wp-block-preformatted\">sudo nano \/etc\/systemd\/system\/tomcat.service<\/pre><p>Next, paste the following configuration:<\/p><pre class=\"wp-block-preformatted\">[Unit]\nDescription=Apache Tomcat Web Application Container\nAfter=network.target\n\n[Service]\nType=forking\n\nEnvironment=JAVA_HOME=\/usr\/lib\/jvm\/java-1.8.0-openjdk-amd64\/jre\nEnvironment=CATALINA_PID=\/opt\/tomcat\/temp\/tomcat.pid\nEnvironment=CATALINA_Home=\/opt\/tomcat\nEnvironment=CATALINA_BASE=\/opt\/tomcat\nEnvironment=&rsquo;CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC&rsquo;\nEnvironment=&rsquo;JAVA_OPTS.awt.headless=true -Djava.security.egd=file:\/dev\/v\/urandom&rsquo;\n\nExecStart=\/opt\/tomcat\/bin\/startup.sh\nExecStop=\/opt\/tomcat\/bin\/shutdown.sh\n\nUser=tomcat\nGroup=tomcat\nUMask=0007\nRestartSec=10\nRestart=always\n\n[Install]\n\nWantedBy=multi-user.target<\/pre><p>Save and close the file after finishing the given commands above.<\/p><p>Next, Notify the system that you have created a new file by issuing the following command in the command line:<\/p><pre class=\"wp-block-preformatted\">sudo systemctl daemon-reload<\/pre><p>The following commands will allow you to execute the Tomcat service:<\/p><pre class=\"wp-block-preformatted\">cd \/opt\/tomcat\/bin<\/pre><pre class=\"wp-block-preformatted\">sudo .\/startup.sh run<\/pre><h3 class=\"wp-block-heading\" id=\"h-6-adjust-the-firewall\">6. Adjust the Firewall<\/h3><p>It is essential to adjust the firewall so the requests get to the service. Tomcat uses port&nbsp;8080&nbsp;to accept conventional requests. Allow traffic to that port by using <a href=\"\/ph\/tutorials\/how-to-configure-firewall-on-ubuntu-using-ufw\/\">UFW<\/a>:<\/p><pre class=\"wp-block-preformatted\">sudo ufw allow 8080<\/pre><p>You can also set up a firewall via hPanel. Select your VPS and navigate to the <strong>Firewall<\/strong> section:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/hpanel-vps-firewall-sidebar.png\"><img decoding=\"async\" width=\"394\" height=\"826\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/hpanel-vps-firewall-sidebar.png\/public\" alt=\"The Firewall button on hPanel VPS dashboard\" class=\"wp-image-90696\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-sidebar.png 394w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-sidebar-143x300.png 143w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-sidebar-72x150.png 72w\" sizes=\"(max-width: 394px) 100vw, 394px\" \/><\/a><\/figure>\n<\/div><p>Then create a new firewall configuration and give it a name. Once created, click the <strong>Edit<\/strong> button:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/hpanel-vps-firewall-edit-highlighted.png\"><img decoding=\"async\" width=\"1024\" height=\"375\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/hpanel-vps-firewall-edit-highlighted.png\/w=1024,h=1024,fit=scale-down\" alt=\"The Firewall page on hPanel. The Edit button is highlighted\" class=\"wp-image-90698\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-edit-highlighted.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-edit-highlighted-300x110.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-edit-highlighted-150x55.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-edit-highlighted-768x282.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><p>Lastly, add any preferred configuration and click <strong>Add rule<\/strong>:<\/p><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/09\/hpanel-vps-firewall-configuration.png\"><img decoding=\"async\" width=\"1024\" height=\"465\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/09\/hpanel-vps-firewall-configuration.png\/w=1024,h=1024,fit=scale-down\" alt=\"The process of creating a new firewall rules on hPanel\" class=\"wp-image-90699\" srcset=\"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-configuration.png 1024w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-configuration-300x136.png 300w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-configuration-150x68.png 150w, https:\/\/www.hostinger.com\/ph\/tutorials\/wp-content\/uploads\/sites\/44\/2016\/09\/hpanel-vps-firewall-configuration-768x349.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div><p>Follow the command below to access the splash page by going to your domain or IP address followed by :8080 in a web browser &ndash; http:\/\/IP:8080<\/p><h3 class=\"wp-block-heading\" id=\"h-7-configure-the-tomcat-web-management-interface\">7. Configure the Tomcat Web Management Interface<\/h3><p>Follow the command below to add a login to your Tomcat user and edit the&nbsp;<strong>tomcat-users.xml<\/strong>&nbsp;file:<\/p><pre class=\"wp-block-preformatted\">sudo nano \/opt\/tomcat\/conf\/tomcat-users.xml<\/pre><p>Now, define the user who can access the files and add username and passwords:<\/p><pre class=\"wp-block-preformatted\">tomcat-users.xml &mdash; Admin User\n&lt;tomcat-users . . .&gt;\n&lt;tomcat-users . . .&gt;\n&lt;user username=\"admin\" password=\"password\" roles=\"manager-gui,admin-gui\"\/&gt;\n&lt;\/tomcat-users&gt;<\/pre><p>For the Manager app, type:<\/p><pre class=\"wp-block-preformatted\">sudo nano \/opt\/tomcat\/webapps\/manager\/META-INF\/context.xml<\/pre><p>For the Host Manager app, type:<\/p><pre class=\"wp-block-preformatted\">sudo nano \/opt\/tomcat\/webapps\/host-manager\/META-INF\/context.xml<\/pre><p>To restart the Tomcat service and view the effects:<\/p><pre class=\"wp-block-preformatted\">sudo systemctl restart tomcat<\/pre><h3 class=\"wp-block-heading\" id=\"h-8-access-the-online-interface\">8. Access the Online Interface<\/h3><p>Now that you already have a user, you can access the web management interface in a browser. Once again, you can access the interface by providing your server&rsquo;s domain name or IP address followed by port 8080 in your browser &ndash; http:\/\/server_domain_or_IP:8080<\/p><p>Let&rsquo;s take a look at the Manager App, accessible via the link &ndash; http:\/\/server_domain_or_IP:8080\/manager\/html.<\/p><p>Make sure that you entered the account credentials to the <strong>t<\/strong><strong>omcat-users.xml<\/strong>&nbsp;file.<\/p><p>We use the <strong>Web Application Manager<\/strong> to manage our Java applications. You can Begin, Stop, Reload, Deploy, and Undeploy all apps here.&nbsp;Lastly, it provides data about your server at the bottom of the page.<\/p><p>Now let&rsquo;s look at the<strong> Host Manager<\/strong>, accessible via http:\/\/server_domain_or_IP:8080\/host-manager\/html\/<\/p><p>From the <strong>Virtual Host Manager<\/strong> page, you can also add new virtual hosts that follow your application form&rsquo;s guidelines.<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Ubuntu supports Tomcat 6 and the latest version Tomcat 9 which includes new features to allow users to work freely on the application.<\/p><p>With this tutorial, your Tomcat installation is functional but entirely unencrypted, so other parties on a web browser can view or change the information or data, passwords, and other sensitive data. The only way to resolve this issue is to encrypt your connections with SSL.<\/p><p>\n\n\n        <div class=\"protip\">\n            <div class=\"protip__heading\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                    <path d=\"M1.49234 23.5024C1.23229 23.5024 0.972242 23.4024 0.782206 23.2123C0.562165 22.9923 0.452144 22.6822 0.502153 22.3722C0.562165 21.9221 1.14227 17.9113 3.00262 16.351C3.63274 15.8209 4.43289 15.5509 5.26305 15.5609C6.09321 15.5909 6.87335 15.9109 7.47347 16.4911C8.6937 17.6913 8.76371 19.6717 7.6435 20.9919C6.0832 22.8523 2.08245 23.4324 1.63237 23.4924C1.59236 23.4924 1.54235 23.4924 1.50234 23.4924L1.49234 23.5024ZM5.16303 17.5613C4.84297 17.5613 4.53291 17.6713 4.29287 17.8813C3.60274 18.4614 3.07264 19.9317 2.75258 21.242C4.06282 20.9219 5.5331 20.3918 6.11321 19.7017C6.55329 19.1716 6.54329 18.3814 6.0832 17.9213C5.85316 17.7013 5.5431 17.5713 5.20304 17.5613C5.19304 17.5613 5.17303 17.5613 5.16303 17.5613ZM11.7243 21.8821C11.4942 21.8821 11.2642 21.8021 11.0841 21.652C10.8541 21.462 10.7241 21.1819 10.7241 20.8819V15.9109L8.08358 13.2705H3.11264C2.81259 13.2705 2.53254 13.1404 2.3425 12.9104C2.15246 12.6803 2.07245 12.3803 2.12246 12.0902C2.19247 11.7102 2.84259 8.36953 4.70294 7.12929C6.33325 6.04909 8.96375 6.49918 10.244 6.80923C11.5442 4.96889 13.2546 3.4286 15.2349 2.33839C17.4553 1.11816 19.9858 0.518051 22.4963 0.498047C23.0464 0.498047 23.4865 0.948132 23.4865 1.49824C23.4865 5.0389 22.3763 9.97983 17.1753 13.7605C17.4853 15.0408 17.9354 17.6613 16.8552 19.2816C15.615 21.1419 12.2744 21.7921 11.8943 21.8621C11.8343 21.8721 11.7743 21.8821 11.7143 21.8821H11.7243ZM12.7245 16.181V19.6016C13.7146 19.2916 14.7948 18.7915 15.2049 18.1814C15.675 17.4812 15.605 16.091 15.385 14.9008C14.5248 15.3808 13.6346 15.8109 12.7245 16.181ZM9.66388 12.0302L11.9643 14.3307C13.1845 13.8306 14.3648 13.2204 15.485 12.5103C19.9358 9.51974 21.2361 5.60901 21.4561 2.53843C19.6157 2.67846 17.8254 3.20856 16.2051 4.09872C14.2847 5.14892 12.6544 6.68921 11.4942 8.54956C10.7841 9.65977 10.174 10.82 9.66388 12.0302ZM4.39289 11.2701H7.81353C8.1936 10.3599 8.63368 9.46974 9.11377 8.60957C7.92355 8.38953 6.51329 8.31952 5.81315 8.78961C5.19304 9.19968 4.70294 10.3099 4.39289 11.2701Z\" fill=\"#673DE6\"\/>\n                <\/svg>\n                <p class=\"protip__title\">\n                    Learn What Else Your Ubuntu Can Do                <\/p>\n            <\/div>\n            <p class=\"protip__content\"><a href=\"\/ph\/tutorials\/how-to-list-installed-packages-on-ubuntu\/\">How to List Packages in Ubuntu<\/a><br>\n<a href=\"\/ph\/tutorials\/how-to-install-git-on-ubuntu\/\">How to Install Git on Ubuntu<\/a><br>\n<a href=\"\/ph\/tutorials\/how-to-setup-ftp-server-on-ubuntu-vps\/\">How to Setup an FTP Server for Ubuntu<\/a><br>\n<a href=\"\/ph\/tutorials\/how-to-install-node-ubuntu\/\">How to Install Node.js in Ubuntu<\/a><br>\n<\/p>\n                    <\/div>\n        \n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-install-tomcat-on-ubuntu-faq\">Install Tomcat on Ubuntu FAQ<\/h2><p>In this section, we&rsquo;ll cover some of the most common questions for configuring Tomcat on Ubuntu.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1708600355455\"><h3 class=\"schema-faq-question\">What Command Do I Use to Install Tomcat on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">To install Tomcat on Ubuntu, use <strong>sudo apt install tomcat9<\/strong> for Tomcat version 9. Adjust the version number based on your requirements.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1708600298448\"><h3 class=\"schema-faq-question\">Can I Install Multiple Versions of Tomcat on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">Yes, you can install multiple Tomcat versions on Ubuntu. Ensure they are configured to run on different ports to avoid conflicts.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1708600385121\"><h3 class=\"schema-faq-question\">What Is the Default Installation Directory for Tomcat on Ubuntu?<\/h3> <p class=\"schema-faq-answer\">The default installation directory for Tomcat on Ubuntu is <strong>\/var\/lib\/tomcat9<\/strong> for Tomcat 9. This path varies with the version.<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Tomcat, often called Apache Tomcat, is one of the most popular applications designed to execute a Java servlet and render web servers with Java page coding. It is an open-source application released by Apache Software Foundation. Many developers favor it! That&rsquo;s why in this tutorial, we&rsquo;ll show you how to install Tomcat on Ubuntu and [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ph\/tutorials\/how-to-install-tomcat-on-ubuntu\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":110,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Install Tomcat on Ubuntu","rank_math_description":"Tomcat is a great way to improve your VPS project. Learn how to install Tomcat on Ubuntu. Follow along and get started!","rank_math_focus_keyword":"install tomcat ubuntu","footnotes":""},"categories":[22641,22639],"tags":[],"class_list":["post-16321","post","type-post","status-publish","format-standard","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-install-tomcat-on-ubuntu","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/comment-installer-tomcat-sur-ubuntu","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-instalar-tomcat-en-ubuntu","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/install-tomcat-ubuntu","default":0},{"locale":"en-GB","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-install-tomcat-on-ubuntu","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-install-tomcat-on-ubuntu\/","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-install-tomcat-on-ubuntu\/","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-instalar-tomcat-en-ubuntu","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-instalar-tomcat-en-ubuntu","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-instalar-tomcat-en-ubuntu","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-install-tomcat-on-ubuntu","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-install-tomcat-on-ubuntu","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-install-tomcat-on-ubuntu","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-install-tomcat-on-ubuntu","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/16321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/comments?post=16321"}],"version-history":[{"count":19,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/16321\/revisions"}],"predecessor-version":[{"id":123346,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/posts\/16321\/revisions\/123346"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/media?parent=16321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/categories?post=16321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ph\/tutorials\/wp-json\/wp\/v2\/tags?post=16321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}