pypi i tomcatmanager


A command line tool and python library for managing a tomcat server

by tomcatmanager

6.0.1 (see all)License:Copyright (c) 2007 Jared Crapo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
pypi i tomcatmanager


.. image:: :target: :alt: latest version .. image:: :target: :alt: supported python versions .. image:: :target: :alt: license .. image:: :target: :alt: main branch build status .. image:: :target: :alt: develop branch build status .. image:: :target: :alt: code coverage .. image:: :target: :alt: code style black .. image:: :target: :alt: main branch documentation status .. image:: :target: :alt: develop branch documentation status

If you use Apache Tomcat for any sort of development work you’ve probably deployed lots of applications to it. There are a several ways to get your war files deployed:

  • use the Tomcat Manager <>_ application in your browser
  • use the Tomcat Ant Tasks <>_ included with Tomcat
  • use Cargo <>_ and its plugins for ant and maven

Here's another way: a command line tool and python library for managing a Tomcat server.

How Do I Use It?

This package installs a command line utility called tomcat-manager. It's easily scriptable using your favorite shell:

.. code-block:: text

$ tomcat-manager --user=ace --password=newenglandclamchowder \ http://localhost:8080/manager deploy local sample.war /sampleapp $ echo $? 0

There is also an interactive mode:

.. code-block:: text

$ tomcat-manager tomcat-manager>connect http://localhost:8080/manager ace Password: --connected to http://localhost:8080/manager as ace tomcat-manager>list Path Status Sessions Directory

/ running 0 ROOT /sampleapp stopped 0 sampleapp##9 /sampleapp running 0 sampleapp##8 /host-manager running 0 /usr/share/tomcat8-admin/host-manage /manager running 0 /usr/share/tomcat8-admin/manager

And for the ultimate in flexibility, you can use the python package directly:

.. code-block:: python

import tomcatmanager as tm tomcat = tm.TomcatManager() r = tomcat.connect(url="http://localhost:8080/manager", ... user="ace", password="newenglandclamchowder") tomcat.is_connected True r = tomcat.stop("/someapp") r.ok False r.status_message 'No context exists named /someapp'

What Can It Do?

Tomcatmanager has the following capabilities, all available from the command line, interactive mode, and as a python library:

  • deploy - deploy a war file containing a tomcat application in the tomcat server
  • redeploy - remove the application currently installed at a given path and install a new war file there
  • undeploy - remove an application from the tomcat server
  • start - start a tomcat application that has been deployed but isn't running
  • stop - stop a tomcat application and leave it deployed on the server
  • reload - stop and start a tomcat application
  • sessions - show active sessions for a particular tomcat application
  • expire - expire idle sessions
  • list - show all installed applications
  • serverinfo - show information about the server, including tomcat version, OS version and architecture, and jvm version
  • status - show server status information in xml format
  • vminfo - show diagnostic information about the jvm
  • threaddump - show a jvm thread dump
  • resources - show the global jdni resources configured in tomcat
  • findleakers - show tomcat applications that leak memory
  • sslconnectorciphers - show tls ciphers configured for each connector
  • sslconnectorcerts - show tls certificate chain for each virtual host
  • sslconnectortrustedcerts - show trusted certificates for each virtual host
  • sslreload - reload tls certificate and key files


Complete documentation for the last released version is available at <>_. It includes material showing how to use tomcat-manager from the command line or using interactive mode. There is also a walkthrough of how to use the API and an API reference.

Documentation is also built from the develop <> branch, and published at <>. The develop branch may not yet be released to PyPi, but you can see the documentation for what's coming up in the next release.


You'll need Python >= 3.7. Install using pip:

.. code-block:: text

$ pip install tomcatmanager

Works on Windows, macOS, and Linux.

Works with Tomcat >= 8.5 and <= 10.1.

Tomcat Configuration

This library and associated tools do their work via the Tomcat Manager web application included in the Tomcat distribution. You will need to configure authentication in tomcat-users.xml with access to the manager-script role:

.. code-block:: xml

... ...
5mos ago
5mos ago
1yr ago
2yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

No reviews found
Be the first to rate