DataDog/datadog-agent
Installer
Active contributors: Arthur Bellal, Baptiste Foy, Raphael Gavache
Purpose
The Datadog Installer is the binary that manages Agent installation, upgrade, rollback, and configuration on a host. It enables remote-controlled deployment from the Datadog backend: the customer installs the installer once, then receives Agent (and other Datadog software) upgrades over Remote Config without manual intervention.
The installer also installs non-Agent Datadog software where applicable, including the OTel agent, the Database Monitoring software, and APM injection libraries.
Directory layout
cmd/installer/
├── main.go
├── command/
├── subcommands/ # install, remove, upgrade, status, ...
├── user/ # Privileged user resolution
├── windows_resources/
└── BUILD.bazel
pkg/fleet/ # The bulk of installer logic
├── env/
├── installer/ # Core install/upgrade/rollback engine
├── ipc/
├── packages/ # Per-package handlers (agent, otel, ddot, …)
├── telemetry/
└── ...
cmd/agent/installer.go # The core agent's hook into the installer (downstream)Subcommands
| Subcommand | Purpose |
|---|---|
bootstrap |
Bootstrap a new install. |
install <package> |
Install a specific Datadog package. |
remove <package> |
Uninstall a package. |
purge |
Remove all packages and the installer itself. |
setup |
Run post-install setup (systemd unit installation, etc.). |
daemon |
The long-running daemon (handles Remote Config push and lifecycle). |
status |
Status snapshot. |
is-installed |
Test whether a given package is present. |
migrate-policies |
Migrate older config policy formats. |
The full list lives in cmd/installer/subcommands/.
Architecture
graph LR
RC[Remote Config<br/>Datadog backend] -->|policies| DAEMON[installer daemon]
DAEMON -->|install/upgrade| ENGINE[Engine<br/>pkg/fleet/installer]
ENGINE -->|os-specific actions| OS[apt / dnf / msiexec / pkg]
ENGINE -->|writes config| CONFIG[/etc/datadog-agent]
AGENT[Datadog Agent] -. status / config events .-> ENGINEThe installer keeps a versioned set of installed packages on disk under /opt/datadog-packages/ (or the equivalent on the platform) and switches the running version by manipulating symlinks. This enables atomic upgrade and rollback.
Package handlers
pkg/fleet/packages/ implements per-package install/remove/configure handlers. Examples:
agent/— the Datadog Agent itself.otel/,ddot/— the OpenTelemetry Collector flavor.apm-inject— APM auto-injection library.dbm-jdbc— Database Monitoring agent helpers.
Each handler implements the same interface so the engine can drive any package the same way.
Telemetry
pkg/fleet/telemetry/ ships installer events and metrics back to Datadog so customers can see install/upgrade history in the Fleet Automation UI.
Windows specifics
Windows installations use MSI packages; the installer wraps msiexec rather than handling install steps directly. Windows-specific code lives in cmd/installer/windows_resources/ and conditional _windows.go files. There is dedicated logic in pkg/fleet/installer/install_windows.go and the install_msi package family.
A recent example bug fix (fix(installer): retry rename on Windows for transient access-denied errors, PR #50028) is illustrative of the platform-specific issues the installer routinely deals with.
Key abstractions
| Type / package | Location | Purpose |
|---|---|---|
Installer |
pkg/fleet/installer/installer.go |
The install/upgrade engine |
Repositories |
pkg/fleet/installer/repository/ |
Versioned on-disk package store |
Daemon |
pkg/fleet/daemon/ |
Long-running lifecycle daemon |
RemoteConfig |
pkg/fleet/installer/rcaction.go |
RC-driven actions |
Entry points for modification
- Adding a new package handler: implement
pkg/fleet/packages/<name>/mirroring the existing handlers. - Adding a new subcommand: copy from
cmd/installer/subcommands/and register. - Changing the on-disk layout: ripple through
pkg/fleet/installer/repository/and the per-platform install code.
Related pages
- Apps: Agent — the most-installed package.
- Systems: Remote Config — how the backend reaches the installer.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.