Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install Apache Tomcat on Windows

Install the Tomcat servlet container, start it and open the manager page.

Windows Hosting2 min read16 steps11 screenshots

What Tomcat is

Apache Tomcat is an open-source server for Java web applications. Its main parts:

  1. Servlet container. Runs Java servlets.
  2. JSP engine. Turns JavaServer Pages into servlets.
  3. Web server. Serves static files and answers HTTP requests.
  4. Connector. Connects Tomcat with web clients.
  5. Manager. Manages the life cycle of deployed web applications.
  6. Security. Features that protect web applications.

Before you start

  • Tomcat needs a JDK (Java Development Kit). Install one first and note its folder.
  • You need administrator rights on Windows.
  • Pick a Tomcat version that fits your application and your JDK version.

Download

Go to the Apache Tomcat website and download the 32-bit/64-bit Windows Service Installer.

The Tomcat website
Downloading the Windows installer

Install

  1. Run the installer and accept the license.
  2. Select the components. The defaults (Tomcat, Service Startup) are fine. The Manager and Host Manager can be useful.
    Choosing the components
  3. Set the configuration: the HTTP port (8080 by default), a user name and password for the admin pages.
    The Tomcat configuration
  4. Choose the install folder.
    The installation location
  5. Choose the path of the JDK (or JRE) that Tomcat will use.
    The Java path
  6. Click Install and Finish.

Start Tomcat

If you ticked Run Apache Tomcat, it starts by itself. You can also start it from the Windows Services, or from a Command Prompt:

cd C:\Program Files\Apache Software Foundation\Tomcat 11.0\bin
Opening the bin folder in Command Prompt
startup.bat
Starting Tomcat

Check it

Open http://localhost:8080 in your browser. The Tomcat start page appears.

The Tomcat start page

Configure Tomcat

The main files are in the conf folder.

The Tomcat files
  1. server.xml. The global settings, such as ports and connectors.
  2. context.xml. The global settings for web applications.
  3. web.xml. The default settings for all web applications.
  4. tomcat-users.xml. The users and roles for the Manager.

To change the HTTP port, edit server.xml and change the number in the connector for protocol HTTP/1.1 (port="8080"). Restart Tomcat afterwards.

Changing the Tomcat port

Deploy a web application by copying its .war file into the webapps folder.

Tip: Open the port in Windows Firewall if you want to reach Tomcat from other computers.

Quick recap

  • Install a JDK, then the Tomcat Windows service installer.
  • Open http://localhost:8080 to check.
  • Configure through conf\server.xml and deploy .war files in webapps.