--- title: "Ruby APM with Docker" slug: "ruby-apm-with-docker" description: "Learn how to install Ruby APM Profiler for Docker/Docker Swarm. Follow the Retrace Docker Install Guide and configure your Ruby app for efficient monitoring in Retrace dashboard." updated: 2020-06-18T20:40:19Z published: 2020-06-18T20:40:19Z canonical: "docs.stackify.com/ruby-apm-with-docker" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.stackify.com/llms.txt > Use this file to discover all available pages before exploring further. # Ruby APM with Docker This document details how to install the **Ruby APM Profiler** in your **Ruby** application running on **Docker** or **Docker Swarm**. ## Prerequisite Follow the [Retrace Docker Install](https://docs.stackify.com/docs/retrace-docker-install) Guide. ## Ruby Docker Setup ### Add Stackify Ruby APM GEM **Add the Stackify APM GEM to each application to monitor.** Modify application `Gemfile`: ``` gem 'stackify-ruby-apm' ``` ### Configure Application Add `config/stackify_apm.yml` to your application, modify **application_name** and **environment_name**. ``` application_name: 'Ruby Application' environment_name: 'Production' ``` #### Rails Profiler will startup automatically, no additional configuration. #### Non-Rails Include **StackifyRubyAPM::Middleware** when starting your application: ``` # config.ru require 'stackify-ruby-apm' use StackifyRubyAPM::Middleware StackifyRubyAPM.start # application startup at_exit { StackifyRubyAPM.stop } ``` ## Running your Application Start your application with the `stackify` shared volume. ``` docker run -v stackify:/usr/local/stackify [your-application-image] ``` ## Verify Make application requests, you can then verify results in the Retrace dashboard.