How to Undeploy Web Applications Using the Apache Tomcat Manager (Windows)

One important function of the Apache Tomcat manager web application is to undeploy web applications. In other words, the website will be removed from Tomcat and therefore no longer be available on the World Wide Web.

To learn how to undeploy web applications using the Apache Tomcat manager, follow these eight steps:

  1. Start the Tomcat server.
  2. You'll need to create a WAR file so that you'll have a sample website to undeploy. For instructions for creating and deploying a WAR file, click here. Follow all of the steps before proceeding to the next step here.
  3. You'll need to create credentials to access the Tomcat manager. For instructions for setting up a user name and password, click here. You will need to restart the Tomcat server after completing the steps in that topic.
  4. In the address area of your browser, type http://localhost:8080/manager/html and submit that address to the browser.
  5. You will be challenged for credentials. Provide the user name and password you specified in tomcat-users.xml (make sure to provide the correct spelling and case):
    Manager credentials
    Click OK.
  6. The manager web page contains a list of the deployed web applications:
    Manager list deployed apps for undeploy
    Note that each application, including DemoWebsite has an associated set of buttons that allows you to start, stop, reload, and undeploy the web application. We will focus our attention now on the undeploy operation. Undeploy will delete the WAR file and unpacked folder under the "webapps" folder (note: if you have deployed the web application as a context file, then the context file will be deleted from CATALINA_BASE/conf/Catalina/host_name, e.g., c:/Tomcat8/conf/Catalina/localhost). **IMPORTANT: Before you undeploy your website, make sure you have a backup of the WAR file (or context file) in case you need to deploy the web application in the future.
  7. Click the undeploy button associated with DemoWebsite. The manager will respond indicating the web application has been undeployed:
    Manager undeployed message
  8. The website has now been removed from Tomcat. If you attempt to access the website through your browser, Tomcat will return a 404 HTTP status:
    Manager DemoWebsite HTTP 404
Author: Stephen Withrow

Stephen has over 30 years of experience in training, development, and consulting in a variety of technology areas including Python, Java, C, C++, XML, JavaScript, Tomcat, JBoss, Oracle, and DB2. His background includes design and implementation of business solutions on client/server, Web, and enterprise platforms. Stephen has a degree in Computer Science and Physics from Florida State University.

About Webucator

Webucator provides instructor-led training to students throughout the US and Canada. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP.NET, Microsoft Office, Azure, Windows, Java, Adobe, Python, SQL, JavaScript, Angular and much more. Check out our complete course catalog.