Java APM with Docker
  • 1 Minute to read
  • Dark
  • PDF

Java APM with Docker

  • Dark
  • PDF

Article summary

This document details how to install the Java APM Profiler in your Java application running on Docker or Docker Swarm.


Follow the Retrace Docker Install Guide.

Java Docker Setup

Dockerfile Configuration

Adjust your Dockerfile to include the Java Profiler:

RUN mkdir -p /stackify-java-apm && \
    cd /stackify-java-apm && \
    wget; tar -zxvf  stackify-java-apm-latest.tar.gz; rm stackify-java-apm-latest.tar.gz && \

Enabling the Java Agent

Follow Enable the Stackify Java Profiler instructions based on the application server being used.

Note: Adjust the Java Profiler path to: /stackify-java-apm/stackify-java-apm.jar.

Running your Application

Start your application with the stackify shared volume. Customize the STACKIFY_APPLICATION_NAME and STACKIFY_ENVIRONMENT_NAME values.

docker run -v stackify:/usr/local/stackify \
--env STACKIFY_APPLICATION_NAME="My Java Application" \


Make application requests, you can then verify results in the Retrace dashboard.


  • Running in Docker Swarm requires that STACKIFY_DOCKER_ENABLED be set when running your application. This can be done using -DSTACKIFY_DOCKER_ENABLED=true.

Was this article helpful?