DEV Community

Datadog Agent Installation on AWS EC2 (Windows Server) and Sending Logs to Datadog Cloud

Datadog Agent Installation on AWS EC2 (Windows Server) and Sending Logs to Datadog Cloud

1.Prerequisites

  • A running Windows Server EC2 instance
  • Administrator access to the instance
  • A Datadog account and your API key (found in Datadog → Integrations → APIs)
  • Internet access from the EC2 instance to Datadog endpoints

  1. Download and Install the Datadog Agent
  • Connect to your EC2 instance via RDP.
  • Open PowerShell as Administrator.
  • Run the following command to download and install the Datadog Agent (replace with your actual key):
    start-bitstransfer -source https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-7-latest.amd64.msi -destination C:\datadog-agent.msi
    msiexec /i C:\datadog-agent.msi APIKEY= SITE="datadoghq.com" /qn

    - If your Datadog site is datadoghq.eu, use SITE="datadoghq.eu" instead.

    3.Enable Log Collection

1.Open the Datadog Agent configuration file:
C:\ProgramData\Datadog\datadog.yaml
2.Find and set:
logs_enabled: true
3.Save and close the file.


4.Configure Log Sources
To send specific logs (e.g., application or Windows Event logs):

  • For Windows Event Logs: Create or edit the file: C:\ProgramData\Datadog\conf.d\win32_event_log.d\conf.yaml Add: init_config:

instances:

  • name: application event_log: Application
  • name: system
    event_log: System

    • For Custom Log Files: Create or edit: C:\ProgramData\Datadog\conf.d\logs.yaml Add: logs:
  • type: file

    path: C:\path\to\your\logfile.log

    service: my-service

    source: custom


5.Restart the Datadog Agent
Run in PowerShell:

Restart-Service datadogagent


6.Verify Installation

  • In Datadog, go to Infrastructure → Host Map to confirm your EC2 instance appears.
  • Go to Logs → Live Tail to check if logs are being received.

  1. (Optional) Tag Your Host You can add tags during installation or later in the config file:

tags:

  • env:production
  • role:webserver

Then restart the agent again.

Datadog Documentation Reference:

Top comments (0)