HomeAEM Fundamentals › Run modes

Run modes

Purpose: Understand how one codebase behaves differently per instance and environment via run modes.

Who this page is for

AudienceWhy it matters to you
All engineersConfig-per-environment mechanics

What they are

Startup flags that classify an instance. Standard: author or publish, plus environment modes your team defines (dev, stage, prod). Set via jar filename (aem-author-p4502.jar) or sling.run.modes property; fixed at startup.

What they select

MechanismExample
OSGi config folders/apps/phi-academy/osgiconfig/config.publish.prod/ applies only on prod publish
Code branches (rare, discouraged)slingSettings.getRunModes().contains("author")
Installation of contentPackages can target run modes via install folders (install.author)
config/                     ← all instances
config.author/              ← any author
config.publish/             ← any publish
config.publish.prod/        ← prod publish only (most specific wins)

Rules of thumb

Quick navigation