How it works
The metadata service runs on a link-local IP address (169.254.169.254) that is only reachable from within the server itself. Before querying metadata, you request a short-lived session token. You can then retrieve all metadata as a single JSON object or query individual fields by path.
Quick start
Get a session token
Request a session token with a TTL (time-to-live) in seconds. The token is returned in the response body.
The metadata service is only accessible from within the server. It cannot be reached from the public internet or from other servers.
Available fields
| Field | Description |
|---|---|
instance_id | Unique server identifier |
hostname | Server hostname |
local_ipv4 | Private IPv4 address |
public_ipv4 | Public IPv4 address |
public_ipv6 | Public IPv6 address |
region | Region code (e.g., SAO, DAL) |
plan | Server plan slug |
operating_system | Operating system slug |
userdata | User data script content |
tags | Tags attached to the server |
network | Network interfaces and DNS configuration (see full schema) |
storage | Disk information (see full schema) |
ssh_keys | SSH public keys deployed to the server |
vendor | Vendor-specific metadata such as project and team IDs (see full schema) |
Common use cases
- Network configuration — read interface details and IPs to configure networking at boot
- Dynamic inventory — register the server in Ansible, Consul, or other inventory systems using its own metadata
- Cloud-init scripts — combine with user data to build dynamic configuration scripts that adapt to the server’s environment
- Application configuration — inject region, hostname, or tags into your application’s runtime config