How to Install and Configure the Datadog Agent on Windows and Linux
Step-by-step guide to installing the Datadog agent on Windows and Linux servers, including configuration, verification, and troubleshooting tips.
The Datadog agent is the foundation of your observability setup. It collects metrics, logs, and traces from your infrastructure and sends them to Datadog's cloud. Getting it installed and configured correctly is the first step to full visibility.
What the Datadog Agent Does
The Datadog agent runs on your servers and collects:
- System metrics — CPU, memory, disk, network
- Service metrics — custom application metrics
- Logs — application and system logs
- Traces — distributed tracing data
- Process data — running processes and resource usage
- Events — system and application events
The agent is lightweight, uses minimal resources, and supports every major operating system.
Installing on Linux
Debian/Ubuntu
# Add Datadog repository
DD_API_KEY=YOUR_API_KEY \
DD_SITE="datadoghq.com" \
bash -c "$(curl -fsSL https://install.datadoghq.com/scripts/install_script_agent7.sh)"
RHEL/CentOS/Amazon Linux
DD_API_KEY=YOUR_API_KEY \
DD_SITE="datadoghq.com" \
bash -c "$(curl -fsSL https://install.datadoghq.com/scripts/install_script_agent7.sh)"
Verify Installation
# Check agent status
sudo datadog-agent status
# Check agent version
sudo datadog-agent version
# View agent configuration
sudo datadog-agent config
Common Linux Configuration
Edit /etc/datadog-agent/datadog.yaml:
# Your Datadog API key
api_key: YOUR_API_KEY
# Site configuration (us, eu, us3, us1-federal)
site: datadoghq.com
# Tags for this host
tags:
- environment:production
- team:backend
- region:us-east-1
# Log collection
logs_enabled: true
logs_config:
- type: file
path: /var/log/nginx/access.log
service: nginx
source: nginx
Restart the agent after configuration changes:
sudo systemctl restart datadog-agent
Installing on Windows
Using the Installer
- Download the MSI installer from the Datadog agent page
- Run the installer with administrator privileges
- Enter your API key when prompted
- Select the site (datadoghq.com for US)
Using PowerShell
# Download installer
Invoke-WebRequest -Uri "https://s3.amazonaws.com/ddagent-windows-stable/installers/datadog-agent-7-latest.amd64.msi" -OutFile "datadog-agent.msi"
# Install with API key
Start-Process msiexec.exe -Wait -ArgumentList '/i datadog-agent.msi API_KEY=YOUR_API_KEY SITE=datadoghq.com /quiet'
Verify Windows Installation
# Check agent status
& "C:\Program Files\Datadog\Datadog Agent\bin\agent.exe" status
# Check agent version
& "C:\Program Files\Datadog\Datadog Agent\bin\agent.exe" version
Common Windows Configuration
Edit C:\ProgramData\Datadog\datadog.yaml:
api_key: YOUR_API_KEY
site: datadoghq.com
tags:
- environment:production
- platform:windows
- team:backend
logs_enabled: true
logs_config:
- type: file
path: C:\inetpub\logs\*.log
service: iis
source: iis
Restart the agent via Services or PowerShell:
Restart-Service -Name "DatadogAgent"
Docker and Kubernetes
Docker
docker run -d \
--name datadog-agent \
-e DD_API_KEY=YOUR_API_KEY \
-e DD_SITE="datadoghq.com" \
-e DD_LOGS_ENABLED=true \
-e DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
gcr.io/datadoghq/agent:7
Kubernetes (Helm)
helm repo add datadog https://helm.datadoghq.com
helm repo update
helm install datadog datadog/datadog \
--set datadog.apiKey=YOUR_API_KEY \
--set datadog.site=datadoghq.com \
--set datadog.logs.enabled=true \
--set datadog.logs.containerCollectAll=true
Verification Checklist
After installation, verify these items:
- Agent status shows "running"
- Metrics appearing in Datadog dashboard within 5 minutes
- Host appears in Datadog infrastructure list
- Tags are correctly applied
- Log collection is working (if enabled)
- Agent can reach Datadog endpoints
Troubleshooting Common Issues
Agent not sending metrics:
- Check API key is correct
- Verify network connectivity to Datadog endpoints
- Check firewall allows outbound HTTPS (port 443)
High resource usage:
- Review integrations — disable unused ones
- Check collection intervals
- Review log collection volume
Logs not appearing:
- Verify log paths in configuration
- Check file permissions
- Ensure log format is supported
Configuration Best Practices
- Use tags consistently — environment, team, service, region
- Enable only needed integrations — each integration adds overhead
- Configure log collection carefully — avoid collecting everything
- Use process discovery instead of process monitoring when possible
- Review agent health regularly — check status monthly
Getting Started
The Datadog agent installation takes about 5 minutes per server. Start with your most critical infrastructure, verify metrics are flowing, then expand to all servers.
For teams evaluating Datadog, consider starting with the free tier (5 hosts, 1-day metrics retention) to understand the platform before committing to a paid plan.