Learn how to install and use Apache Tomcat on CentOS 7. Apache Tomcat is a Java Servlet container developed by Apache to which allows you to deploy Java servlets and JSPs. Apache Tomcat also functions as a web server, which is able to support small to medium-sized websites.

This tutorial also covers how to install and use the Tomcat Web Admin Manager, which allows you to manage Tomcat and virtual hosts from a web browser.


  • Requirements
  • Install Tomcat
  • Use the Tomcat Web Admin Manager
  • Manage Virtual Hosts
  • Requirements

    • A Cloud Server running Linux (CentOS 7)
    • If you have a firewall, you will need to allow access to port 8080.

    vServer (VPS) from IONOS

    Low-cost, powerful VPS hosting for running your custom applications, with a personal assistant and 24/7 support.

    Ready in 55 sec.SSL certificateInstall Tomcat

    Installing Tomcat on CentOS 7 requires one simple command:

    sudo yum install tomcat

    This will install Tomcat and its dependencies, including Java.

    There are several additional packages which many users, particularly those who are new to Tomcat, will find useful. Install them with the command:

    sudo yum install tomcat-webapps tomcat-admin-webapps tomcat-docs-webapp tomcat-javadoc

    This will install:

    • The Tomcat root webpage (tomcat-webapps)
    • The Tomcat Web Admin Manager (tomcat-admin-webapps)
    • The official online Tomcat documentation (tomcat-docs-webappandtomcat-javadoc)

    If your server is running Apache, stop it with the command:

    sudo systemctl stop httpd

    Start Tomcat with the command:

    sudo systemctl start tomcat

    And enable Tomcat to automatically start if the server is rebooted:

    sudo systemctl enable tomcat

    You can verify that Tomcat is running by visiting the URLhttp://example.com:8080in a web browser. You will see the Tomcat welcome page, which includes links to the Tomcat documentation which you installed in the previous step.

    Use the Tomcat Web Admin Manager

    In order to use Tomcat\’s web management interface, you will need to create a user. Open thetomcat-users.xmlfile with the command:

    sudo nano /usr/share/tomcat/conf/tomcat-users.xml

    Scroll down to below the line which reads<tomcat-users>and add the information for your user account:

    <user username=”[username]” password=”[password]” roles=”manager-gui,admin-gui”/>

    For example, to add the userjdoewith passwordEn4EW25eI0this section will read:

    <tomcat-users><user username=”jdoe” password=”En4EW25eI0″ roles=”manager-gui,admin-gui”/>

    Save and exit the file. Restart the Tomcat service for the changes to take effect:

    sudo systemctl restart tomcat

    In a browser, visit the URLhttp://example.com:8080to see the Tomcat welcome page. Click theManager Applink.

    You will be prompted to log in with the username and password you created.

    From this page you can stop, reload, and run diagnostics on various Java applications.

    Dedicated Server from IONOS

    Hardware meets cloud: dedicated server with cloud integration and per-minute billing, including a personal assistant!

    Unlimited trafficSSL certificateManage Virtual Hosts

    To manage virtual hosts through the Web Application Manager, scroll down and click the/host-managerlink.

    This will take you to the Tomcat Virtual Host Manager, where you can add and manage virtual hosts to your Tomcat server.

    • 11.12.20
    • Configuration
    • Tutorials

    Related articlesKafka tutorial: getting started with Apache Kafka

    • 19.06.2019
    • Configuration

    The Scala-based streaming and messaging software is one of the most popular solutions for efficiently storing and processing large data streams. In this Kafka tutorial, you will learn the requirements for using this open source software and how best to install and set up .

    Upgrade PHP From 5.4 to 7.0 on a CentOS 7 Cloud Server

    • 02.06.2021
    • Web development

    The default version of PHP available on a new Cloud Server running CentOS 7 is version 5.4. Learn how to upgrade this to PHP 7.0. You will need to perform the upgrade by hand, since PHP 7 is not available in the standard CentOS 7 `yum` repository, because it is not considered stable.

    Cloud ServersSee packages Web hosting for agencies

    Provide powerful and reliable service to your clients with a web hosting package from IONOS.

    View packages Popular Articles Create a hair salon website

    We’ll show you how to quickly, easily and affordably create a professional hair salon website…

    Build a real estate website

    With a real estate website, you can set yourself apart from the competition…

    Handyman website

    With the right tools, a homepage for tradesmen can be created quickly and legally compliant…

    Create dental website

    Patients can easily find you online and gain an overview of your clinic’s services and offers…

    Build a photography website

    In this article, we’ll give you an overview of what components a website for photographers should have…


    By admin

    Leave a Reply

    Your email address will not be published.