Container Environment

Containers on Aptible Deploy run with the following environment variables:

You can access those environment variables through whatever facilities your language exposes to access them, such as ENV in Ruby, process.env for Node apps, os.environ in Python.

If there is a name collision, Aptible Deploy Metadata takes precedence over App Configuration, which itself takes precedence over Docker Image Variables.

Docker Image Variables

Your Docker Image can specify environment variables. Those are defined via the ENV directive, and will be present when your Containers are started:


App Configuration

Your App’s Configuration is injected as environment variables. For example, if you set the keys FOO and BAR:

aptible config:set --app "$APP_HANDLE" \

Then your Containers will be run with the environment variables FOO and BAR set respectively to SOME and OTHER.

Aptible Deploy Metadata

Finally, Aptible Deploy injects a set of metadata keys as environment variables.

Here is the list of variables injected by Aptible Deploy:


Represents the name of the Service this Container belongs to.

For example, if you Procfile defines the services:

web: bundle exec rails s
worker: bundle exec sidekiq

Then the Containers for the web Service will run with APTIBLE_PROCESS_TYPE=web, and the Containers for the worker Service will run with APTIBLE_PROCESS_TYPE=worker.

If you do not have a Procfile and instead rely on an Implicit Service (CMD), this will be set to APTIBLE_PROCESS_TYPE=cmd.


All containers for a given Release of a Service are assigned a unique 0-based process index.

For example, if your web service is scaled to 2 containers, one of them will have APTIBLE_PROCESS_INDEX=0, and the other will have APTIBLE_PROCESS_INDEX=1.


Represents the memory limit in MB of the Container. See Memory Limits for more information.


Set to app or database, representing whether the Container is an App or Database Container.


For App Containers using Dockerfile Deploy or Companion Git Repository, the git SHA that was used at the time the Container was deployed.


Aptible API URL representing the Organization this container belongs to.


Aptible API URL representing the App this container belongs to, if any.


Aptible API URL representing the Database this container belongs to, if any.


Aptible API URL representing the Service this container belongs to, if any.


Aptible API URL representing the Release this container belongs to, if any.


Used internally by Aptible. Do not depend on this value.


Used internally by Aptible. Do not depend on this value.