Datadog
Install or Update to the latest Agent version on Ubuntu
The Datadog Agent has x86_64
and arm64
(ARM v8) packages. For other architectures, use the source install.
Run this command to install or update...
DD_API_KEY=721fb15b3ffb0bba810abc5695f4d2aa DD_SITE="us5.datadoghq.com" bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
This will install the APT packages for the Datadog Agent and will prompt you for your password.
If the Agent is not already installed on your machine and you don't want it to start automatically after the installation, just prepend
DD_INSTALL_ONLY=true
to the above script before running it.If you have an existing agent configuration file, those values will be retained during the update.
Otherwise, you can configure some of the agent options during the initial install process. For more information check the install_script configuration options .
Manual Step by Step Instructions
1Set up apt so that it can download through https and install curl
and gnupg
:
sudo apt-get update
sudo apt-get install apt-transport-https curl gnupg
2Set up the Datadog deb repo on your system and create a Datadog archive keyring:
sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg] https://apt.datadoghq.com/ stable 7' > /etc/apt/sources.list.d/datadog.list"
sudo touch /usr/share/keyrings/datadog-archive-keyring.gpg
sudo chmod a+r /usr/share/keyrings/datadog-archive-keyring.gpg
curl https://keys.datadoghq.com/DATADOG_APT_KEY_CURRENT.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
curl https://keys.datadoghq.com/DATADOG_APT_KEY_C0962C7D.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
curl https://keys.datadoghq.com/DATADOG_APT_KEY_F14F620E.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
curl https://keys.datadoghq.com/DATADOG_APT_KEY_382E94DE.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
3If running Ubuntu 14 or earlier, copy the keyring to /etc/apt/trusted.gpg.d
:
sudo cp -a /usr/share/keyrings/datadog-archive-keyring.gpg /etc/apt/trusted.gpg.d/
4Update your local apt repo and install the Agent:
sudo apt-get update
sudo apt-get install datadog-agent datadog-signing-keys
5Optionally import existing Agent 5 configuration if upgrading from Agent 5 (5.17+ only)
sudo -u dd-agent -- datadog-agent import /etc/dd-agent /etc/datadog-agent
5Alternatively, copy the example config into place and plug in your API key
sudo sh -c "sed 's/api_key:.*/api_key: 721fb15b3ffb0bba810abc5695f4d2aa/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
6Configure your Datadog region:
sudo sh -c "sed -i 's/# site:.*/site: us5.datadoghq.com/' /etc/datadog-agent/datadog.yaml"
7Ensure permissions are correct:
sudo sh -c "chown dd-agent:dd-agent /etc/datadog-agent/datadog.yaml && chmod 640 /etc/datadog-agent/datadog.yaml"
8Start the Agent with Ubuntu 16.04 and higher:
sudo systemctl restart datadog-agent.service
8Start the Agent with Ubuntu 14.04:
sudo initctl start datadog-agent
Subscribe to my newsletter
Read articles from Sarthak Tyagi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by