Deployment guide

Apache TomEE

Overview

Apache TomEE is the Jakarta EE / Java EE application server from the Apache Tomcat project. The "plus" distribution this image ships bundles the full enterprise stack (JAX-RS, JPA, EJB, CDI, JMS, JSF, JTA and Bean Validation) on top of Tomcat 10.1. You can run a complete Jakarta EE application without assembling the server yourself.

The SecureAnyCloud image installs Apache TomEE 9.1.3 on OpenJDK 17 and runs it as a systemd service bound to loopback behind an nginx reverse proxy on port 80. It keeps application deployments, logs and work directories on a dedicated Azure data disk, and it generates a unique Manager password on the first boot of every VM.

What you get:

  • Apache TomEE 9.1.3 "plus" (Tomcat 10.1 core, CATALINA_HOME=/opt/tomee) on OpenJDK 17
  • The Tomcat/TomEE Manager (/manager) and host-manager (/host-manager) web consoles
  • nginx on :80 as a reverse proxy to the loopback TomEE connector on 127.0.0.1:8080
  • A per-VM admin account for the Manager, generated on first boot and recorded in a root-only file
  • A dedicated Azure data disk at /var/lib/tomee (CATALINA_BASE) for app deployments, logs and work
  • A small sample application deployed at /sample/ so the Manager shows a running app out of the box
  • tomee.service + nginx.service as systemd units, enabled and active
  • 24/7 SecureAnyCloud support

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet and subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a reasonable starting point. Size up for heavier Jakarta EE workloads. In the NSG, allow inbound 22/tcp from your management network and 80/tcp.

TomEE serves plain HTTP on port 80. For production, terminate TLS in front of it with your own domain.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Apache TomEE by SecureAnyCloud, and select Create.

On Basics, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) and HTTP (80). Review the dedicated data disk on the Disks tab. Then select Review + create, and then Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:apache-tomee-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name tomee \
  --image sac1647283583153:apache-tomee-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name tomee --port 80 --priority 1010

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm the services are running

systemctl is-active tomee.service nginx.service

Both report active. TomEE listens on the loopback connector 127.0.0.1:8080 and nginx fronts it on port 80. The application deployments, logs and work directories live on the dedicated Azure data disk mounted at /var/lib/tomee.

Step 5 - Retrieve your Manager password

The TomEE Manager admin password is generated uniquely on the first boot of your VM and written to a root-only file:

sudo cat /root/tomee-credentials.txt

The file contains TOMEE_ADMIN_USERNAME (admin) and TOMEE_ADMIN_PASSWORD, along with the Manager and host-manager URLs. Store the password somewhere safe.

Step 6 - Confirm the health endpoint

nginx serves an unauthenticated health endpoint for load balancers and probes:

curl -s http://localhost/health

It returns ok. This endpoint never requires authentication, so you can use it for an Azure Load Balancer health probe.

Step 7 - Open the TomEE Manager

Browse to http://<vm-public-ip>/manager/html and sign in as admin with the password from Step 5. The Manager lists every deployed application and lets you start, stop, reload, undeploy and deploy WARs. The bundled /sample application is already running.

The Server Status page shows JVM memory, thread pools and connector activity.

The host-manager console at http://<vm-public-ip>/host-manager/html manages Tomcat virtual hosts.

The bundled sample application is served at http://<vm-public-ip>/sample/ and confirms the Java and server versions.

Step 8 - Verify Manager authentication from the command line

The Manager's text interface rejects a wrong password with 401 and accepts the per-VM admin password with 200. Read the password from the credentials file first, and then call the Manager.

Because the command embeds your unique password, run it interactively rather than from a script. Substitute the value of TOMEE_ADMIN_PASSWORD from Step 5 for <TOMEE_ADMIN_PASSWORD>:

curl -s -u "admin:<TOMEE_ADMIN_PASSWORD>" http://localhost/manager/text/list

The response begins with OK - Listed applications for virtual host [localhost] and lists each context, including /sample:running:...:sample. A wrong password returns 401 Unauthorized.

Step 9 - Deploy your own application

You can deploy a WAR from the Manager UI (Deploy section -> WAR file to deploy), or drop it onto the data disk and let TomEE auto-deploy it:

sudo cp /path/to/myapp.war /var/lib/tomee/webapps/

Within a few seconds, TomEE expands and starts the application. It then appears in the Manager list and is served at http://<vm-public-ip>/myapp/.

The webapps directory lives on the dedicated data disk, so your deployments survive OS changes and you can resize the disk independently.

Step 10 - Confirm app data lives on the dedicated disk

TomEE's CATALINA_BASE holds the per-instance webapps, work, temp, logs and conf directories. It is stored on the dedicated Azure data disk, so it survives OS changes and you can resize it independently:

findmnt /var/lib/tomee

The mount is backed by a separate Azure data disk captured into the image and re-provisioned on every VM.

Maintenance

  • Manager users: add or rotate Manager users by editing /var/lib/tomee/conf/tomcat-users.xml and restarting tomee.service.
  • Deployments: drop WARs into /var/lib/tomee/webapps or use the Manager. Manage running apps from the Manager UI.
  • Logs: TomEE logs are under /var/lib/tomee/logs (catalina.out, localhost_access_log and others) on the data disk.
  • Tuning: to adjust the heap size, edit JAVA_OPTS / CATALINA_OPTS in the tomee.service unit (/etc/systemd/system/tomee.service). Then run sudo systemctl daemon-reload && sudo systemctl restart tomee.
  • TLS: TomEE serves plain HTTP on port 80. Front it with TLS (for example with certbot) and your own domain before running it in production.
  • Security patches: unattended-upgrades remains enabled, so the OS continues to receive security updates automatically.

Support

SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.

Deploy on Azure

Launch Apache TomEE on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure