HashiCorp Configuration Language (HCL) is a declarative way to write configuration: you state the settings you want rather than a sequence of commands to produce them. Nomad uses HCL instead of YAML. Its syntax is closer to JSON, and the language is also used by Terraform and Vault. section 9.2
A first practical use is configuring a Nomad server. In /etc/nomad.d/nomad.hcl, assignments set values such as the data directory and bind address; blocks group related settings such as server and client behavior. The example enables one server and disables its client role. section 9.2.3
Listing 9.6 Nomad server configuration
See how assignments and nested blocks combine in a server configuration. Replace the example’s advertised address with the server’s private IP address when configuring your cluster. section 9.2.3
To run a container, write a Nomad job in HCL. A job contains groups, and a group contains tasks. Each task can declare a Docker driver and the container image to run. Paste a job into the Nomad UI, select Plan to inspect what it intends to do, then select Run. section 9.2.5
Listing 9.8 Nomad job definition
job "a_unique_job_name" {
group "unique_group_per_job" {
task "unique_task_per_group" {
driver = "docker"
config {
image = "codingforentrepreneurs/rk8s-py"
}
}
}
}
Start with this small job definition to see the job → group → task structure and the Docker image declaration. section 9.2.5
The same structure can grow to run Python and Node.js containers in one group. Further declarations add network port mappings and service definitions. Those additions address a practical next problem: making running applications reachable. section 9.2.5


