How to run a Local Nomad Cluster
July 3, 2025 · View on GitHub
- Pre-requisties
- Start Nomad Agent
- Start Consul Agent
- Submit a Job
- Common Issues
- Nomad doesn’t reference local docker image
port_map' cannot map group network ports, use 'ports' insteadConstraint ${attr.consul.version} semver >= 1.8.0 filtered 1 node- Nomad can’t connect to docker daemon - docker driver missing from nomad agent stats (MacOS)
- API Error - (500) Permission Denied
mkdir /host_mnt/private/tmp/ permission denied nomad(MacOS)
- Tips
Pre-requisties
- Start Docker Daemon if not already running.
- Check if you have the following commands accessible.
- Nomad (
nomad --version) - Consul (
consul --version)
- Nomad (
Start Nomad Agent
sudo nomad agent -dev \
-bind 0.0.0.0 \
-network-interface='{{ GetDefaultInterfaces | attr "name" }}'
Check Nomad Agent Status
In a separate terminal, check agenet status
export NOMAD_ADDR=http://localhost:4646
nomad node status
or verbose version with detailed breakdown
nomad node status -self -verbose
Check Web UI for more info: http://localhost:4646/ui
Start Consul Agent
In a separate terminal, start consul.
consul agent -dev
Submit a Job
nomad job run -address=http://localhost:4646 deploy.nomad
Common Issues
Nomad doesn’t reference local docker image
- The tag for the image should be local.
- Ref: How can I make a nomad job use a local docker image?
port_map' cannot map group network ports, use 'ports' instead
Use the new ports approach like this
group "app" {
network {
port "http" {
to = 8080
}
}
task "example" {
driver = "docker"
config {
ports = ["http"]
}
}
}
Constraint ${attr.consul.version} semver >= 1.8.0 filtered 1 node
- Make sure the consul agent is running. Start it by consul agent -dev.
- Follow these steps in case of above issue
consul agent -dev -bind 0.0.0.0 -log-level INFOsudo nomad agent -dev -bind 0.0.0.0 -log-level INFOnomad job run example.nomad
- Ref: https://github.com/hashicorp/waypoint/issues/3376
Nomad can’t connect to docker daemon - docker driver missing from nomad agent stats (MacOS)
- Enable default docker socket
- Ref: https://stackoverflow.com/a/76219883
- Make sure the following command runs successfully. If not disable the socket access on Docker Dashboard & re-nable it again (forces socket file creation)
ls /var/run/docker.sock
API Error - (500) Permission Denied mkdir /host_mnt/private/tmp/ permission denied nomad (MacOS)
- Change virtualization framework from VirtioFS to gRPC Fuse in Docker Desktop
- Ref: https://stackoverflow.com/a/78276263
Tips
- When accessing processes on host computer, use
host.docker.internal