Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk11 min

How to Deploy a WAR File on Tomcat on Ubuntu

Deploy a WAR on Ubuntu Tomcat without guessing paths: identify the active service and appBase, copy the archive with correct permissions, use autoDeploy or Manager, verify the context, and troubleshoot Java, permissions, and stale deployments.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To deploy a WAR on Ubuntu, place the archive in the active Tomcat Host appBase (normally a webapps directory), or deploy it through Tomcat Manager. If the Host has autoDeploy="true", a running Tomcat detects a newly copied or updated WAR; unpackWARs="true" makes Tomcat expand it into a directory. A file named myapp.war normally becomes available at /myapp.

The reliable procedure is to identify the actual Tomcat instance and Java runtime first, copy the archive with readable ownership, follow the deployment log, and test the application’s own endpoint. Ubuntu package layouts and service names differ by release, so do not assume that a path such as /var/lib/tomcat10/webapps exists on your host.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need before deploying

Tomcat is a web container for Java Servlets and JSP applications. A WAR (Web Application Archive) is the packaged application Tomcat deploys; installing Ubuntu’s Tomcat package alone does not install your application.

  • An Ubuntu server with administrative access.
  • A Java runtime or JDK supported by your application and Tomcat. Tomcat’s setup documentation requires JAVA_HOME to identify the Java installation used by the service.
  • A WAR built for the Servlet or Jakarta Servlet generation supported by your Tomcat major version.
  • The name of the active systemd unit, its CATALINA_BASE, and the Host’s appBase.
  • Network access to the connector and hostname on which the application is configured to listen.

This guide uses commands that help you discover those values rather than assuming one Ubuntu release, package name, or filesystem layout. If you are installing Tomcat as well as deploying the application, choose the Ubuntu release and Tomcat major version first. Distribution packages are convenient when Ubuntu should manage updates and lifecycle; a private Tomcat instance under a dedicated account is preferable when an application needs an independently managed Tomcat version.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

How Tomcat chooses where and how to deploy a WAR

Each Tomcat Host has an appBase, the directory from which applications are deployed. It is commonly named webapps, but the configured value is authoritative. The Host’s deployment settings determine what happens after a file arrives there.

Setting or name Effect
appBase The directory in which Tomcat looks for applications when using appBase deployment.
autoDeploy When enabled, a running Host watches for new or changed applications and can deploy a WAR without a Tomcat restart.
unpackWARs When enabled, Tomcat expands the archive into an exploded directory. When disabled, Tomcat can run directly from the compressed WAR.
WAR basename The filename normally supplies the context path: myapp.war maps to /myapp.

The application’s URL is therefore normally the connector address followed by the context path. For example, an archive named orders.war is requested as http://server:8080/orders/, unless the Host, connector, proxy, or an explicit Context configuration changes that address.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Method 1: copy the WAR into the active appBase

1. Confirm the Tomcat service and Java runtime

List running Tomcat-related units instead of guessing the unit name:

systemctl list-units --type=service | grep -i tomcat
systemctl list-unit-files | grep -i tomcat

Check the unit that owns the instance. The unit name below is an example; use the name shown on your server:

sudo systemctl status tomcat10.service
sudo systemctl cat tomcat10.service

Look in the unit definition and its environment files for CATALINA_BASE, CATALINA_HOME, and the Java setting. A systemd service does not necessarily inherit the JAVA_HOME from your interactive shell. Confirm the service’s Java path and make sure it points to the runtime intended for this Tomcat and application.

If the service is not active, start it and resolve startup errors before deploying:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl start tomcat10.service
sudo systemctl is-active tomcat10.service

Replace the example unit with the actual unit discovered on your host. A failed service usually indicates a Java, permission, configuration, or port problem; deploying another WAR will not correct that underlying failure.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

2. Find the Host appBase

Use the active CATALINA_BASE from the service definition, then inspect the Tomcat configuration beneath it. The Host element is normally in conf/server.xml, although an installation can use additional configuration files.

sudo grep -R "<Host|appBase|autoDeploy|unpackWARs" /path/to/CATALINA_BASE/conf

Replace the path with the real CATALINA_BASE you found; do not copy a WAR into a similarly named directory belonging to another Tomcat instance. If no appBase is written on the Host element, Tomcat’s conventional default is webapps below the relevant base directory. Verify the resolved directory and its permissions before transferring the archive.

Check the directory itself:

sudo ls -ld /path/to/CATALINA_BASE/webapps
sudo find /path/to/CATALINA_BASE -maxdepth 3 -type d -name webapps -print

When more than one candidate appears, correlate each candidate with the service’s CATALINA_BASE and Host configuration. The directory used by a different instance may contain a perfectly valid but unrelated deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Handle an older deployment deliberately

Decide how the release should replace the existing version before copying anything. A prior exploded directory can contain stale files and can make troubleshooting confusing. Back up the current WAR and application data according to your release procedure, or remove the old deployment in a controlled maintenance step. Do not delete an application directory merely because its name resembles the new archive; verify the context and any persistent data first.

If the release procedure calls for a clean replacement, stop writes to the application, preserve required external data, and remove the old exploded directory only after confirming that it is generated content. A WAR replacement is not a database rollback and does not restore data changed by the application.

4. Copy the archive with usable ownership and permissions

Transfer the file to the verified appBase. The Tomcat service account must be able to read the archive and traverse every parent directory. A typical local copy looks like this:

sudo install -o tomcat -g tomcat -m 0644 myapp.war /path/to/CATALINA_BASE/webapps/myapp.war

The account and group may be different on your installation. Determine them from the systemd unit or the running process, then use those values instead of blindly applying tomcat:tomcat. If you upload with a separate transfer account, copy to a temporary location and perform the privileged install so the final owner and mode are explicit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Confirm the archive is present and readable:

sudo ls -l /path/to/CATALINA_BASE/webapps/myapp.war
sudo -u tomcat test -r /path/to/CATALINA_BASE/webapps/myapp.war

Use the actual service account in the second command. A readable file is necessary but not sufficient: the WAR must also be a valid archive and compatible with the Tomcat runtime.

5. Follow deployment as Tomcat detects the file

With autoDeploy enabled, a running Host should notice the new WAR. Follow both the service journal and the logs under the active CATALINA_BASE/logs; the exact filenames depend on the Ubuntu package or private installation.

sudo journalctl -u tomcat10.service -f
sudo ls -l /path/to/CATALINA_BASE/logs

Look for a deployment message and check that no stack trace follows it. Tomcat may create an exploded directory when unpackWARs is enabled. If that setting is disabled, the absence of an exploded directory is expected and does not by itself mean deployment failed.

6. Test the application, not only the container

Request the context path derived from the filename, using the configured connector port and hostname:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -i http://server:8080/myapp/

Then exercise one static asset and one application endpoint or health response. A successful HTTP status from Tomcat’s default page does not prove that your application initialized correctly. Confirm that the displayed build or version identifier matches the WAR you just released, and inspect the application log for initialization errors.

Deploying with Tomcat Manager

Tomcat Manager provides an alternative when you need an explicit deployment operation rather than filesystem delivery. It supports an HTML upload workflow and a text API. Manager must be configured deliberately, protected with a dedicated management account, and restricted to trusted networks. Do not expose its endpoint broadly on the public Internet.

Text API deployment

The Manager deployment pattern is:

curl --upload-file myapp.war "http://server:8080/manager/text/deploy?path=/myapp"

The Manager guide also supports a file URL form such as .../manager/text/deploy?war=file:/path/to/bar.war. When no context path is supplied, the context normally defaults to the WAR basename. Use the form supported by the Manager version installed on your server and protect credentials; do not place reusable passwords in shell history or an unrestricted script.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

An existing application path, an invalid context path, or a Java exception can make the installation fail. Read the complete Manager response and Tomcat stack trace, correct the cause, and retry only after deciding whether the old application should be undeployed.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTML Manager upload

The HTML Manager interface can upload a WAR from the operator’s computer and install it into the Host appBase. Select the intended Host, choose the archive, and verify the resulting context path. The same access-control requirements apply: use a narrowly scoped management account, limit network reachability, and disable or remove Manager exposure when it is not needed.

Copy-to-appBase versus Manager

Decision point Copy to appBase Manager
Must Tomcat be running? For automatic detection, yes. A stopped instance can receive a file, but deployment occurs when it starts. Yes; the Manager application and its API must be available.
Credentials and network exposure Requires filesystem or host-level access; no Manager endpoint is needed. Requires a protected management account and reachable Manager endpoint.
Automation Fits file-transfer or CI/CD workflows that can set ownership and target the correct appBase. Fits pipelines that can securely call the API and interpret its response.
Context control Filename normally determines the context; explicit Context configuration is needed for a different URL. Deployment parameters can specify the context path directly.
Rollback Restore the previous WAR or follow the controlled undeploy-and-copy procedure. Undeploy or redeploy deliberately through Manager, then verify the result.
Operational risk Wrong instance, ownership, or stale exploded content can cause a silent-looking failure. Incorrect roles, an existing path, invalid context, or exposed credentials can block or compromise deployment.

Neither method guarantees zero downtime or automatic rollback. Availability during replacement depends on the application, traffic path, Tomcat configuration, and release procedure.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Context paths, custom URLs, and the root application

Default filename mapping

Tomcat normally removes .war from the archive name to produce the context. Thus billing.war maps to /billing. Renaming the archive changes the default URL on the next deployment, so treat a filename change as a routing change rather than a cosmetic edit.

Root deployment

ROOT.war is the conventional archive name for the root context, represented by /. A request to http://server:8080/ then reaches that application instead of a named subpath. Ensure another root application is not already deployed before replacing it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When the URL must differ from the filename

Use a per-application Context configuration or an explicit Manager deployment path when the public context must not match the WAR basename. Keep one deployment mechanism authoritative: do not configure the same application through Context XML while also allowing an identically named WAR to auto-deploy from appBase. Duplicate declarations can produce conflicts, repeated deployment messages, or an application being managed by the wrong configuration.

For ordinary application delivery, avoid editing server.xml. A per-application Context file or Manager/appBase deployment is easier to audit and less likely to make a server-wide configuration mistake.

Deploying a new WAR without restarting Tomcat

A restart is unnecessary when the Host is running and autoDeploy is enabled. Copy the new archive into the active appBase, watch the logs, and wait for Tomcat to finish replacing the application. A newer WAR can replace the exploded application under the documented auto-deployment behavior.

  1. Confirm the running service and the correct Host appBase.
  2. Build and transfer the new WAR under a temporary name outside appBase if your process requires an atomic final copy.
  3. Replace the destination archive with the release file and ensure the Tomcat account can read it.
  4. Follow the journal and CATALINA_BASE/logs until deployment completes.
  5. Check the application’s health endpoint, static content, and build identifier.

Do not promise uninterrupted requests while Tomcat unloads and initializes an application. Schedule a maintenance window or use an external traffic strategy when the application cannot tolerate a brief redeployment interruption.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verification checklist

  • systemctl status shows the expected Tomcat unit as active.
  • The deployment log contains a successful application deployment and no related stack trace.
  • The expected context path returns an HTTP response on the configured connector and hostname.
  • A static asset and an application endpoint load correctly.
  • The running build identifier matches the WAR that was released.
  • The WAR and any generated directory belong to the intended Tomcat instance.
  • A planned restart does not lose the deployment, and the service starts with the intended Java runtime.
  • Persistent data, external configuration, secrets, and uploaded files are outside the disposable exploded application directory where the application design requires it.

Troubleshooting deployment failures

Symptom Checks and corrective action
404 at the expected URL Check the WAR basename, resulting context path, connector port, hostname, and deployment messages. A file named myapp.war is not normally requested at the server root.
WAR is ignored Verify that it is in the active Host appBase, readable by the Tomcat account, and that autoDeploy and background deployment processing are enabled. Confirm that you did not copy it to a different Tomcat instance.
Manager reports that the application already exists Decide whether to undeploy the existing context or replace it through the approved release procedure. Do not force a second deployment with the same path.
Java exception or startup failure Read the complete stack trace, verify JAVA_HOME for the systemd service, and confirm that the application’s Servlet or Jakarta Servlet APIs match the Tomcat major version. A WAR compiled for a different API generation may fail before serving requests.
New code does not appear Check the deployment timestamp and build identifier. If stale exploded content remains, remove it only under a controlled release procedure, then redeploy. A newer WAR normally triggers replacement when the documented auto-deployment settings are active.
Manager upload is blocked Check the Manager role, endpoint protection, accepted file extension, available disk space, and network restrictions. Keep the management interface inaccessible to untrusted networks.
Permission denied or deployment stops partway Inspect ownership and mode on the WAR and every parent directory, then look for disk-space and filesystem errors in the journal. Correct permissions for the actual service account rather than granting broad write access.
Deployment works until restart Confirm that the archive is in the configured appBase or that the Context definition is persistent, and verify that the service starts with the same CATALINA_BASE and Java runtime used during deployment.

Safe replacement and rollback

Keep the previously released WAR until the new version has passed health and functional checks. Record which context, Host, Java runtime, and archive version were used. If the release fails, stop traffic or writes when necessary, remove or undeploy the faulty version according to the chosen method, restore the previous archive, and follow the logs through redeployment. Restore application data separately; replacing a WAR cannot undo schema changes or user transactions.

For repeated releases, automate discovery and validation: resolve the target service and appBase, verify the archive checksum and ownership, capture deployment logs, test a known endpoint, and retain a clear version identifier. Automation should fail rather than copy to an unverified directory.

Compatibility and operational cautions

Tomcat and Ubuntu versions change. Before deployment, verify the Java level required by the application, the Java runtime actually selected by systemd, and the Servlet or Jakarta Servlet compatibility of the WAR with the Tomcat major version. Confirm connector and reverse-proxy settings separately; a correct deployment can still be unreachable if the request is sent to the wrong port or hostname.

Manager and Context XML are alternatives to appBase deployment, not layers to enable indiscriminately. Choose one authoritative path, protect management interfaces, and document the exact Host and context used. These practices prevent duplicate deployment, accidental exposure, and a successful-looking copy into the wrong Tomcat installation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.