This guide provides detailed instructions for installing a data agent on an Ubuntu 24.04 LTS (Noble Numbat) EC2 instance, incorporating the latest Ubuntu features and best practices.
Prerequisites
EC2 instance running Ubuntu 24.04 LTS
SSH access to your instance
Appropriate IAM roles configured
Sudo access on the instance
Step 1: Initial Server Setup
Connect to your Ubuntu 24.04 EC2 instance:
ssh -i your-key.pem ubuntu@your-instance-ip
Update the package manager to use the new Ubuntu 24.04 repositories:
sudo apt update && sudo apt full-upgrade -y
Enable automatic security updates (recommended for production):
sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
Step 2: Install Dependencies
Install required packages (note: Ubuntu 24.04 comes with Python 3.12 by default):
sudo apt install -y \
curl \
wget \
systemd \
python3-pip \
python3-venv \
software-properties-common
Step 3: Install the Data Agent
Create required directories:
sudo mkdir -p /opt/dataagent
cd /opt/dataagent
Download and install the agent (using the new deb format for Ubuntu 24.04):
# Import the repository GPG key
curl -fsSL https://downloads.dataagent.com/gpg/key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/dataagent-archive-keyring.gpg
# Add the repository
echo "deb [signed-by=/usr/share/keyrings/dataagent-archive-keyring.gpg] https://downloads.dataagent.com/apt noble main" | \
sudo tee /etc/apt/sources.list.d/dataagent.list
# Update package list and install
sudo apt update
sudo apt install -y dataagent
Step 4: Configure the Agent
Create and secure the configuration directory:
sudo mkdir -p /etc/dataagent
sudo chmod 750 /etc/dataagent
Create the configuration file using the new YAML format:
sudo nano /etc/dataagent/config.yaml
Add the following configuration (updated for Ubuntu 24.04):
agent:
id: "ec2-agent-{{INSTANCE_ID}}"
api_key: "YOUR_API_KEY"
collection:
interval: 60
metrics_format: "opentelemetry" # New in 24.04
endpoints:
api: "https://api.dataagent.com"
metrics: "https://metrics.dataagent.com"
traces: "https://traces.dataagent.com" # New in 24.04
logging:
level: info
path: /var/log/dataagent
max_size: 100M
max_files: 5
format: "json" # New in 24.04
security:
tls:
min_version: "TLS1.3" # Required in 24.04
verify_cert: true
Step 5: Configure Systemd Service
The service file is now managed by systemd generator in Ubuntu 24.04. Create an override:
sudo mkdir -p /etc/systemd/system/dataagent.service.d
sudo nano /etc/systemd/system/dataagent.service.d/override.conf
Add the following content:
[Service]
# Security enhancements for Ubuntu 24.04
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictNamespaces=yes
LockPersonality=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
# Resource limits
LimitNOFILE=65536
LimitNPROC=4096
# Environment
Environment=LANG=C.UTF-8
Step 7: Start and Enable Services
Reload and start services:
sudo systemctl daemon-reload
sudo systemctl start dataagent
sudo systemctl enable dataagent
Troubleshooting
Ubuntu 24.04-specific troubleshooting:
- Check systemd service status:
sudo systemctl status dataagent
- View structured logs:
journalctl -u dataagent -o json-pretty