config/config.yaml. This file controls all aspects of the control server including networking, database connections, DNS, and policy management.
Configuration File Location
The configuration file is mounted at/etc/headscale/config.yaml inside the Headscale container.
Server Configuration
The public URL of your Headscale server. This URL is provided to clients when they connect.Development:
http://localhost:8000Production: https://your-domain.comThe address and port that Headscale listens on for HTTP connections.
The address and port for Prometheus metrics endpoint.Access metrics at
http://localhost:9090/metricsgRPC Configuration
The address and port for gRPC API connections.
Whether to allow insecure gRPC connections. Should be
false in production.Encryption Keys
Path to the server’s private key file. This is automatically generated on first startup.
Path to the Noise protocol private key for encrypted control plane communication.
IP Address Allocation
IPv4 CGNAT range for the Tailscale network.
IPv6 Unique Local Address (ULA) range for the network.
DERP Configuration
DERP (Designated Encrypted Relay for Packets) servers facilitate NAT traversal when direct connections aren’t possible.
Enable embedded DERP server in Headscale.
List of DERP map URLs. By default, uses Tailscale’s public DERP servers.
Automatically update DERP map from configured URLs.
Database Configuration
Database backend type. Use
postgres for production deployments.Options: sqlite, postgresPostgreSQL server hostname. Use the Docker service name for container deployments.
Database name.
Database user.
Database password.
Maximum number of open connections to the database.
DNS Configuration
Enable MagicDNS for automatic hostname resolution within the network.
Base domain for MagicDNS hostnames. Nodes will be accessible at
<nodename>.headscale.net.Global DNS nameservers for external domain resolution.
Unix Socket
Path to Unix socket for local CLI communication.
Logging
Log output format.Options:
text, jsonLogging verbosity level.Options:
trace, debug, info, warn, errorPolicy Configuration
ACL policy storage mode.Options:
file: Read-only policy from filedatabase: Editable policy via API/GUI (recommended)
Node Management
Time before inactive ephemeral nodes are automatically removed.
Interval for checking node status updates.
Miscellaneous
Disable automatic checking for Headscale updates.
Randomize client UDP port for better NAT traversal.
Complete Example
config/config.yaml
