DockerSelf-Hosting

Nomad with Docker: A Simple Scheduler for a Few Home Servers, with ACLs and Traefik (Linux, Windows, Mac)

Before you start

  • 28 min read

Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#

Nomad is one program from HashiCorp that decides which of your machines runs each Docker container: you describe a job in a small text file, and Nomad starts it where there is room, restarts it when it dies, and publishes it as a service that Traefik can route to.

Nomad official logo

Logo: the official Nomad project docs (github.com/hashicorp/web-unified-docs, file logo-text.svg), BUSL-1.1. Nomad is a trademark of HashiCorp. This guide is not affiliated with HashiCorp.

We build a small cluster: one machine that is server and client, plus one or two that only run jobs. We start a Docker job, turn on access control (ACLs) and let Traefik read the job's tags to give it an HTTPS address.

WhatValue (official sources, read 5 December 2026)
Current versionNomad 2.1.1, released 29 October 2026 (previous: 2.1.0, 28 October 2026)
Package to pinnomad=2.1.1-1 from the HashiCorp apt repository (checked in its package index)
Time neededAbout 90 minutes for three machines (our estimate)
Size and RAMNo official lab minimum; we measured none
Ports4646 web UI and API, 4647 internal RPC, 4648 server gossip; jobs get 20000-32000
LicenceBUSL-1.1 (see below)
Official docsdeveloper.hashicorp.com/nomad

At a glance:

  • What it is: a scheduler. You say "run this container twice", it picks the machines.
  • How it runs: one binary. A machine is a server (the brain), a client (runs containers) or both.
  • Service discovery: built in (provider = "nomad"). No Consul needed.
  • Not included: Compose files (Nomad has its own HCL format) and automatic HTTPS. Traefik does that.
  • Linux runs the jobs. Windows and Mac are your control desk.

The licence. Nomad 1.7.0 and later use the Business Source License. The LICENSE file at the v2.1.1 tag has this "Additional Use Grant":

"You may make production use of the Licensed Work, provided Your use does not include offering the Licensed Work to third parties on a hosted or embedded basis in order to compete with IBM Corp's paid version(s) of the Licensed Work."

It adds: "Hosting or using the Licensed Work(s) for internal purposes within an organization is not considered a competitive offering." Running your own home servers is neither. Each version turns into MPL 2.0 four years after publication. BUSL is source-available, not an OSI open-source licence. This is our reading, not legal advice. The file points to HashiCorp's licence FAQ for binding guidance; it answered "429" when we tried.

How it fits together#

You send a job to the Nomad server with a token, the server picks a client, the client starts the container and registers it as a tagged service, and Traefik reads that list to send visitors to the right machine and port.

Nomad flow: you send a job with a token to the Nomad server, which places it on clients; each client starts a whoami container on a dynamic port and registers it as a tagged service; Traefik reads that list and forwards visitors' HTTPS requests to the container

Drawn for this guide. Dashed parts are optional.

A job is your wish ("run this image"), an allocation is one running copy, a client is a machine that runs allocations.

Before you start#

Note: every address, domain, token and e-mail here is a dummy (192.0.2.x is reserved for examples, example.com, <your-...>). Replace each with your own and keep real tokens out of Git.

ItemWhat to have
MachinesTwo or three Linux machines (Ubuntu or Debian in our commands) with Docker Engine running, on one network
Machine 1Server, client and Traefik: 192.0.2.11
Machines 2, 3Clients only: 192.0.2.12, 192.0.2.13
Your PCWindows or Mac (PowerShell or Terminal; SSH is built in)
For HTTPSA domain with an A record such as whoami.example.com, and ports 80 and 443 reaching machine 1. Home-only: skip Step 6

On every Linux machine:

Run in terminalbash
docker --version
sudo docker info

Checklist:

  • [ ] Docker answers on every machine that will run jobs
  • [ ] The machines reach each other on ports 4646-4648
  • [ ] You know your LAN range, here 192.0.2.0/24
  • [ ] A password manager for the tokens
  • [ ] Old Nomad config files are backed up, if any

Tested by DIY Lab Hub: not yet. Commands come from the official docs, the package files at v2.1.1 and the issues in Sources, read on 5 December 2026. We did not run them on a real machine.

Tip: Install and start Docker before Nomad. If Docker arrives later, jobs fail with missing drivers until you restart Nomad.

LLM Guide: let your AI assistant set it up#

Prefer to let an AI do the typing? Copy the block below into ChatGPT, Claude, Gemini or a local model. It first asks about your setup (machines, Docker, domain, reverse proxy), then follows only the path that fits you. It uses the same pinned versions as this guide. You still read each command before you run it.

Instructions for your AI assistantllm
You are my assistant for installing Nomad 2.1.1 (HashiCorp's scheduler that decides which of my Linux machines runs each Docker container) on two or three home servers, with ACLs on and Traefik HTTPS in front of a first Docker job.
Follow the DIY Lab Hub guide https://diylabhub.com/nomad/ (checked 5 December 2026).
Work one step at a time. Before each command, say in one line what it does. Wait for my OK before anything that deletes data, stops or restarts a service, changes the firewall, or opens a port.

STEP 0 - FIND OUT MY SETUP. Ask me these questions (or have me run the read-only checks) before you do anything else:
1. How many Linux machines (Ubuntu or Debian in the guide's commands) do I have on one LAN, and what are their IP addresses and my LAN range? Machine 1 = server + client (+ Traefik); machines 2 and 3 = clients only. Windows and Mac are only my control desk (ssh and the nomad command); they do not run jobs.
2. Is Docker Engine running on every machine that will run jobs? Check: docker --version and sudo docker info. Docker must be installed and started BEFORE Nomad, or jobs fail with "missing drivers".
3. Can the machines reach each other on ports 4646-4648? Do I use ufw?
4. Do I want HTTPS for my jobs: do I have a domain with an A record (for example whoami.example.com) and ports 80 and 443 reaching machine 1? Home only = skip the Traefik step.
5. Reverse proxy already running on machine 1: Traefik, Caddy, nginx / Nginx Proxy Manager, or none?
6. Do I have a password manager for three tokens (bootstrap, daily, traefik)?

THEN FOLLOW THE MATCHING PATH:
- Install (Linux, every machine): HashiCorp's apt repository, then sudo apt-get install -y nomad=2.1.1-1, sudo apt-mark hold nomad, nomad version (first line Nomad v2.1.1). The guide's Step 1 has the exact repository lines. Windows: zip from releases.hashicorp.com/nomad/2.1.1 with the SHA256 check. Mac: brew install hashicorp/tap/nomad.
- Machine 1 (server + client), /etc/nomad.d/nomad.hcl (write the whole file, ACLs on from the first start):
    data_dir  = "/opt/nomad/data"
    bind_addr = "0.0.0.0"
    advertise { http = "<machine-1-ip>" rpc = "<machine-1-ip>" serf = "<machine-1-ip>" }
    server { enabled = true  bootstrap_expect = 1 }
    client { enabled = true  servers = ["<machine-1-ip>"] }
    acl { enabled = true }
  Then nomad config validate /etc/nomad.d, sudo ufw allow from <my-lan-range> to any port 4646:4648 proto tcp, sudo ufw allow from <my-lan-range> to any port 4648 proto udp, sudo systemctl enable --now nomad, and curl -s http://127.0.0.1:4646/v1/status/leader (prints the server address).
- Bootstrap ACLs once: unset NOMAD_TOKEN, then nomad acl bootstrap. The Secret ID is the password: I save it in my password manager; never print it again or ask me to paste it here. Create two policies in ~/docker_volumes/nomad/policies: traefik-read (namespace "default" capabilities ["read-job"]) and daily (namespace "default" policy "write", node policy "read", agent policy "read"), apply them with nomad acl policy apply, and create tokens named traefik and daily with nomad acl token create. Use the daily token for everything after that.
- Machines 2 and 3 (clients only): write the whole nomad.hcl again with their own advertise IP, a client block with servers = ["<machine-1-ip>"] and acl { enabled = true }, no server block. Validate, ufw allow port 4646 from my LAN, enable --now nomad. Check: nomad node status lists every node as ready, and nomad server members lists ONE server.
- First job, ~/docker_volumes/nomad/jobs/whoami.nomad.hcl: job "whoami", datacenters ["dc1"], group "web" with count = 2, constraint distinct_hosts = true, network { port "http" {} }, a service block with provider = "nomad" (never Consul) and port "http", an http check on /health every 10s, and a docker task with image traefik/whoami:v1.12.0, ports ["http"], env WHOAMI_PORT_NUMBER = "${NOMAD_PORT_http}", resources cpu 100 memory 64. Run: nomad job validate, nomad job plan (exit code 1 is normal), nomad job run, nomad service info whoami.
- Plain HTTP at home: stop here; the job answers on the address and port from nomad service info.
- Traefik for HTTPS (guide's Step 6): on machine 1, add these tags to the whoami service block (the domain is an example):
    traefik.enable=true
    traefik.http.routers.whoami.rule=Host(`whoami.example.com`)
    traefik.http.routers.whoami.entrypoints=https
    traefik.http.routers.whoami.tls=true
    traefik.http.routers.whoami.tls.certresolver=le
  Then run Traefik as a Compose service (pinned image line:
    image: traefik:v3.8.0
  ) in ~/docker_volumes/traefik-nomad (ports 80 and 443, ./data:/letsencrypt, .env at chmod 600 holding ACME_EMAIL, ACME_CA_SERVER and the traefik token). Flags: --providers.nomad=true, --providers.nomad.exposedbydefault=false, --providers.nomad.endpoint.address=http://<machine-1-ip>:4646 (never 127.0.0.1: inside the container that is the container itself), --providers.nomad.endpoint.token from .env, entrypoints http (:80, permanent redirect to https) and https (:443), and certificatesresolvers.le with the ACME email, caserver, storage /letsencrypt/acme.json and httpchallenge on entrypoint http. Start with the Let's Encrypt STAGING server, then switch to production when it works.
- Caddy instead of Traefik for Nomad's own web UI (port 4646): caddy:2.11.9 on ports 80 and 443 with: nomad.example.com { reverse_proxy <machine-1-ip>:4646 { flush_interval -1 } }. Public domain = automatic Let's Encrypt. Home only = add "tls internal" and trust Caddy's root certificate on each device. Not on a machine where Traefik already holds ports 80 and 443.
- nginx / Nginx Proxy Manager: the guide has no recipe. Tell me so and offer Traefik or Caddy.

CHECK IT WORKED: nomad node status with the daily token lists my machines as ready; without a token it answers 403 (Permission denied). nomad service info whoami lists two rows with different addresses. curl http://<machine-2-ip>:<port>/ prints Hostname: and IP: lines. With Traefik, curl -k https://whoami.example.com/ several times shows the Hostname: line changing between the two containers (-k only because staging certificates are not trusted; Windows: curl.exe).

RULES FOR YOU:
- Use only Nomad 2.1.1, traefik/whoami:v1.12.0, traefik:v3.8.0 and caddy:2.11.9, no :latest, and no invented options. Do not use retry_join or start_join in server {} (removed in 2.1.0) or nomad agent -dev for real use. If a step fails, show me the exact error (journalctl -u nomad -n 30 --no-pager) and read https://developer.hashicorp.com/nomad/docs before guessing.
- Ports 4646-4648 stay on my trusted LAN or VPN; never forward them on the router. ACLs do not encrypt, and the guide does not set up TLS between agents. Docker's published ports skip ufw.
- The daily token can start any container on my machines: treat it like an SSH key. Never run nomad acl bootstrap twice or lose the bootstrap token.
- Values like <machine-1-ip>, whoami.example.com and <your-email> are examples; ask me for mine.
- Never ask me to paste passwords, tokens or keys into this chat.

Step 1: Install Nomad on every machine#

Linux gets HashiCorp's apt repository and the pinned package. Windows and Mac only need the nomad command.

Linux#

Run in terminalbash
sudo apt-get update
sudo apt-get install -y wget gpg lsb-release
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update
sudo apt-get install -y nomad=2.1.1-1
sudo apt-mark hold nomad
nomad version

These lines follow HashiCorp's install page (which also covers Fedora, RHEL and Amazon Linux). apt-mark hold stops a routine upgrade from moving the scheduler unread.

Windows (PowerShell)#

Codepowershell
$v = "2.1.1"
Invoke-WebRequest "https://releases.hashicorp.com/nomad/$v/nomad_${v}_windows_amd64.zip" -OutFile "$HOME\nomad.zip"
Invoke-WebRequest "https://releases.hashicorp.com/nomad/$v/nomad_${v}_SHA256SUMS" -OutFile "$HOME\nomad_SHA256SUMS"
$want = (Select-String "windows_amd64" "$HOME\nomad_SHA256SUMS").Line.Split(" ")[0]
$got = (Get-FileHash "$HOME\nomad.zip" -Algorithm SHA256).Hash.ToLower()
if ($want -eq $got) { "checksum OK" } else { "checksum DIFFERENT - do not use this file" }
Expand-Archive "$HOME\nomad.zip" -DestinationPath "$HOME\nomad" -Force
[Environment]::SetEnvironmentVariable("Path", "$([Environment]::GetEnvironmentVariable('Path','User'));$HOME\nomad", "User")

Open a new PowerShell window, then run nomad version.

Mac (Terminal)#

Run in terminalbash
brew tap hashicorp/tap
brew install hashicorp/tap/nomad
nomad version

Homebrew installs the current release. For a pinned file, use the darwin_arm64 or darwin_amd64 zip and its checksum file.

Check it worked. nomad version prints a first line Nomad v2.1.1. The revision starts with d0f2104, the commit of the v2.1.1 tag (also shown in issue 28760).

Step 2: Start machine 1 as server and client, with ACLs on#

The package's sample /etc/nomad.d/nomad.hcl enables server and client and binds 0.0.0.0, so the API listens on every network. We replace it and turn ACLs on from the first start, so the cluster is never open. We also set advertise by hand: Nomad ties a server to its IP address, and a wrong guess breaks it later.

Linux#

Run this on machine 1:

Run in terminalbash
sudo tee /etc/nomad.d/nomad.hcl > /dev/null << 'EOF'
data_dir  = "/opt/nomad/data"
bind_addr = "0.0.0.0"

advertise {
  http = "192.0.2.11"
  rpc  = "192.0.2.11"
  serf = "192.0.2.11"
}

server {
  enabled          = true
  bootstrap_expect = 1
}

client {
  enabled = true
  servers = ["192.0.2.11"]
}

acl {
  enabled = true
}
EOF
nomad config validate /etc/nomad.d
sudo ufw allow from 192.0.2.0/24 to any port 4646:4648 proto tcp
sudo ufw allow from 192.0.2.0/24 to any port 4648 proto udp
sudo systemctl enable --now nomad
sleep 10
curl -s http://127.0.0.1:4646/v1/status/leader

Replace the dummy addresses with your own. The package's service runs Nomad as root, as a client needs. bootstrap_expect = 1 means one server: simple, no spare (the docs advise 3 or 5 for production).

Windows (PowerShell)#

Servers and Docker clients run on Linux here. Use Windows' built-in SSH client and run the Linux commands there:

Run in terminalpowershell
ssh <your-user>@192.0.2.11

To look around on this PC, start Docker Desktop and run the development agent (no ACLs; the docs say not to use it in production):

Run in terminalpowershell
nomad agent -dev

In a second window nomad node status lists your PC. Docker Desktop limits host networking (official FAQ). We did not run dev mode.

Mac (Terminal)#

Same as Windows: ssh <your-user>@192.0.2.11, then the Linux commands. For a look around, start Docker Desktop and run nomad agent -dev.

Check it worked. The last command prints the server's address in quotes, such as "192.0.2.11:4647" (the docs show "127.0.0.1:4647"). That endpoint needs no token. If it is empty, wait ten seconds, then read journalctl -u nomad -n 30 --no-pager.

Tip: Docker's published ports skip ufw rules (Docker's docs). The rules above protect Nomad's ports, not your jobs' ports: keep the machines on a trusted LAN.

Step 3: Bootstrap ACLs and make tokens#

With ACLs on, Nomad denies everything until you create the first management token, once. We then make two small tokens, so the big one stays in your password manager.

Linux#

Run on machine 1:

Run in terminalbash
unset NOMAD_TOKEN
nomad acl bootstrap

Expected output (from the official docs; these IDs are dummies, yours differ):

Codetext
Accessor ID  = 5b7fd453-d3f7-6814-81dc-fcfe6daedea5
Secret ID    = 9184ec35-65d4-9258-61e3-0c066d0a45c5
Name         = Bootstrap Token
Type         = management
Global       = true

The Secret ID is the password. Save it, then create policies and tokens:

Run in terminalbash
mkdir -p ~/docker_volumes/nomad/{jobs,policies,backups}
cd ~/docker_volumes/nomad/policies
cat > traefik-read.policy.hcl << 'EOF'
namespace "default" {
  capabilities = ["read-job"]
}
EOF
cat > daily.policy.hcl << 'EOF'
namespace "default" {
  policy = "write"
}
node {
  policy = "read"
}
agent {
  policy = "read"
}
EOF
export NOMAD_TOKEN='<your-bootstrap-secret-id>'
nomad acl policy apply -description "Traefik reads services" traefik-read traefik-read.policy.hcl
nomad acl policy apply -description "Daily use" daily daily.policy.hcl
nomad acl token create -name="traefik" -policy=traefik-read
nomad acl token create -name="daily" -policy=daily
export NOMAD_TOKEN='<your-daily-secret-id>'

<your-bootstrap-secret-id> and <your-daily-secret-id> are dummies: paste the Secret IDs Nomad printed and keep all three in a password manager. The traefik token only reads jobs and services (Traefik's docs name read-job). The daily token can start and stop jobs, close to root on your machines: guard it like an SSH key.

Windows (PowerShell)#

Use nomad from your PC against machine 1. The policy files come from here-strings:

Codepowershell
$env:NOMAD_ADDR = "http://192.0.2.11:4646"
$env:NOMAD_TOKEN = $null
nomad acl bootstrap
New-Item -ItemType Directory -Force "$HOME\docker_volumes\nomad\policies" | Out-Null
Set-Location "$HOME\docker_volumes\nomad\policies"
@'
namespace "default" {
  capabilities = ["read-job"]
}
'@ | Set-Content -Encoding ascii traefik-read.policy.hcl
@'
namespace "default" {
  policy = "write"
}
node {
  policy = "read"
}
agent {
  policy = "read"
}
'@ | Set-Content -Encoding ascii daily.policy.hcl
$env:NOMAD_TOKEN = '<your-bootstrap-secret-id>'
nomad acl policy apply -description "Traefik reads services" traefik-read traefik-read.policy.hcl
nomad acl policy apply -description "Daily use" daily daily.policy.hcl
nomad acl token create -name="traefik" -policy=traefik-read
nomad acl token create -name="daily" -policy=daily
$env:NOMAD_TOKEN = '<your-daily-secret-id>'

Run nomad acl bootstrap, copy the Secret ID, then run the rest. The variables last for this window only.

Mac (Terminal)#

Same commands as Linux, with export NOMAD_ADDR=http://192.0.2.11:4646 first.

Check it worked. nomad node status with the daily token lists machine 1 as ready. Without a token the docs show Error querying jobs: Unexpected response code: 403 (Permission denied). In the browser open http://192.0.2.11:4646/ui/settings/tokens and paste the daily Secret ID.

Tip: Run unset NOMAD_TOKEN before nomad acl bootstrap. A leftover old token makes bootstrap fail with 403 (Permission denied) (issue 16098).

Step 4: Join machine 2 (and 3) as clients#

A client needs only a server's address. Write the whole file again: the package sample would make this machine a second server.

Linux#

On machine 2 (use 192.0.2.13 on machine 3):

Run in terminalbash
sudo tee /etc/nomad.d/nomad.hcl > /dev/null << 'EOF'
data_dir  = "/opt/nomad/data"
bind_addr = "0.0.0.0"

advertise {
  http = "192.0.2.12"
  rpc  = "192.0.2.12"
  serf = "192.0.2.12"
}

client {
  enabled = true
  servers = ["192.0.2.11"]
}

acl {
  enabled = true
}
EOF
nomad config validate /etc/nomad.d
sudo ufw allow from 192.0.2.0/24 to any port 4646 proto tcp
sudo systemctl enable --now nomad

Windows (PowerShell)#

Log in with ssh <your-user>@192.0.2.12 and run the Linux commands there. Then check from your PC (with NOMAD_ADDR and the daily token set, as in Step 3):

Run in terminalpowershell
nomad node status

Mac (Terminal)#

Same as Windows: ssh <your-user>@192.0.2.12, the Linux commands, then nomad node status.

Check it worked. nomad node status lists two (or three) nodes as ready. Output of this shape, from the docs:

Codetext
ID        Node Pool  DC   Name   Class   Drain  Eligibility  Status
a72dfba2  default    dc1  node1  <none>  false  eligible     ready

nomad server members still lists one server. Keep the ACL setting the same on every machine, as the docs say.

Step 5: Run your first Docker job#

We use traefik/whoami, a tiny web server that prints which container answered. The job asks for two copies on different machines, registers them in Nomad's own service catalog and adds Traefik tags. We skip to = 80: the docs say it works by default only in bridge mode, so the container gets the dynamic port as an environment variable.

Linux#

Run in terminalbash
cd ~/docker_volumes/nomad/jobs
cat > whoami.nomad.hcl << 'EOF'
job "whoami" {
  datacenters = ["dc1"]
  type        = "service"

  group "web" {
    count = 2

    constraint {
      operator = "distinct_hosts"
      value    = "true"
    }

    network {
      port "http" {}
    }

    service {
      name     = "whoami"
      provider = "nomad"
      port     = "http"

      tags = [
        "traefik.enable=true",
        "traefik.http.routers.whoami.rule=Host(`whoami.example.com`)",
        "traefik.http.routers.whoami.entrypoints=https",
        "traefik.http.routers.whoami.tls=true",
        "traefik.http.routers.whoami.tls.certresolver=le",
      ]

      check {
        type     = "http"
        path     = "/health"
        interval = "10s"
        timeout  = "2s"
      }
    }

    task "whoami" {
      driver = "docker"

      config {
        image = "traefik/whoami:v1.12.0"
        ports = ["http"]
      }

      env {
        WHOAMI_PORT_NUMBER = "${NOMAD_PORT_http}"
      }

      resources {
        cpu    = 100
        memory = 64
      }
    }
  }
}
EOF
nomad job validate whoami.nomad.hcl
nomad job plan whoami.nomad.hcl
nomad job run whoami.nomad.hcl
nomad job status whoami
nomad service info whoami

Replace whoami.example.com (a dummy) with your domain. nomad job plan exits with code 1 when it would create something; that is normal. Without distinct_hosts both copies may land on one machine; with one client the second cannot be placed.

Windows (PowerShell)#

Save the job file, then run the commands from your PC:

Codepowershell
New-Item -ItemType Directory -Force "$HOME\docker_volumes\nomad\jobs" | Out-Null
Set-Location "$HOME\docker_volumes\nomad\jobs"
notepad whoami.nomad.hcl

Paste the HCL from the Linux section into Notepad, save as plain text, then:

Run in terminalpowershell
nomad job validate whoami.nomad.hcl
nomad job plan whoami.nomad.hcl
nomad job run whoami.nomad.hcl
nomad service info whoami

Mac (Terminal)#

Same commands as Linux, against the same cluster.

Check it worked. nomad job run ends with the evaluation complete. nomad service info whoami lists two rows with different addresses. The docs show this shape:

Codetext
Job ID   Address          Tags        Node ID   Alloc ID
example  127.0.0.1:22686  [db,cache]  7406e90b  5f0730ca

Then curl http://192.0.2.12:<port>/, with an address and port from that list, prints lines such as Hostname: and IP:. To change the number of copies, edit count and run nomad job run again.

Tip: Without provider = "nomad" the service goes to Consul, which you do not run, and the job fails with Constraint ${attr.consul.version} semver >= 1.7.0 filtered 1 node (issue 12958). The version number in the message changes.

Step 6: Give the job an HTTPS address with Traefik#

This step is for a server with a domain. Traefik runs as a normal Compose service on machine 1; its Nomad provider asks the server for services and reads their tags, so it needs no Docker socket. Our Traefik guide explains the certificate settings, and we reuse its names: entrypoints http and https, resolver le.

Linux#

Run in terminalbash
mkdir -p ~/docker_volumes/traefik-nomad/data
cd ~/docker_volumes/traefik-nomad
cat > .env << 'EOF'
ACME_EMAIL=<your-email>
ACME_CA_SERVER=https://acme-staging-v02.api.letsencrypt.org/directory
NOMAD_API_URL=http://192.0.2.11:4646
NOMAD_TRAEFIK_TOKEN=<your-traefik-secret-id>
EOF
chmod 600 .env
cat > docker-compose.yml << 'EOF'
services:
  traefik:
    image: traefik:v3.8.0
    container_name: traefik-nomad
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    command:
      - "--global.checknewversion=false"
      - "--global.sendanonymoususage=false"
      - "--log.level=INFO"
      - "--providers.nomad=true"
      - "--providers.nomad.exposedbydefault=false"
      - "--providers.nomad.endpoint.address=${NOMAD_API_URL}"
      - "--providers.nomad.endpoint.token=${NOMAD_TRAEFIK_TOKEN:?Set NOMAD_TRAEFIK_TOKEN in .env}"
      - "--entrypoints.http.address=:80"
      - "--entrypoints.http.http.redirections.entrypoint.to=https"
      - "--entrypoints.http.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.http.http.redirections.entrypoint.permanent=true"
      - "--entrypoints.https.address=:443"
      - "--certificatesresolvers.le.acme.email=${ACME_EMAIL:?Set ACME_EMAIL in .env}"
      - "--certificatesresolvers.le.acme.caserver=${ACME_CA_SERVER}"
      - "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
      - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=http"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./data:/letsencrypt
EOF
docker compose config -q && docker compose up -d
docker compose logs --tail=30 traefik

Replace <your-email> and <your-traefik-secret-id> (dummies; use the traefik token from Step 3). Staging gives untrusted test certificates first, as in our Traefik guide; switch ACME_CA_SERVER to Let's Encrypt's production address when it works.

Windows (PowerShell)#

Run Traefik on machine 1 over SSH with the Linux commands. Docker Desktop on your PC is not a place for ports 80 and 443 behind a home router; we did not test that route.

Mac (Terminal)#

Same as Windows: use the Linux commands on machine 1.

Check it worked. The log has no ERR lines. Run curl -k https://whoami.example.com/ several times (Windows: curl.exe): the Hostname: line changes between the two containers. -k skips the trust check on purpose, because staging certificates are not trusted.

Tip: Traefik in a container must not use 127.0.0.1:4646, the provider's default: that is the container itself. Use the LAN address, as in NOMAD_API_URL.

Put it behind HTTPS (with or without Traefik)#

Step 6 gave your jobs HTTPS. This section covers Nomad's own web UI and API on port 4646, plain HTTP in our setup, for a server with a domain. The official reverse-proxy page asks for long connections (the UI holds requests open about five minutes), unbuffered log streaming, and, for the exec terminal, WebSockets with a rewritten Origin header. We did not test exec through Traefik or Caddy.

With Traefik#

Add a file provider to the Traefik service (--providers.file.directory=/dynamic and a ./dynamic:/dynamic:ro volume) and save this as dynamic/nomad-ui.yml:

File contentyaml
http:
  routers:
    nomad-ui:
      rule: "Host(`nomad.example.com`)"
      entryPoints: ["https"]
      service: nomad-ui
      tls:
        certResolver: le
  services:
    nomad-ui:
      loadBalancer:
        servers:
          - url: "http://192.0.2.11:4646"

Without Traefik: Caddy#

Choose this if you have no Traefik. Caddy gets and renews its own certificates: Let's Encrypt for a public domain, tls internal for a local one at home. Not on a machine where Traefik holds ports 80 and 443. caddy:2.11.9 is the latest release we read (checked 5 December 2026). See our Caddy guide.

Run in terminalbash
mkdir -p ~/docker_volumes/caddy/{conf,data,config}
cd ~/docker_volumes/caddy
cat > docker-compose.yml << 'EOF'
services:
  caddy:
    image: caddy:2.11.9
    container_name: caddy
    restart: unless-stopped
    ports:
      - "80:80/tcp"
      - "443:443/tcp"
      - "443:443/udp"
    volumes:
      - ./conf:/etc/caddy
      - ./data:/data
      - ./config:/config
EOF

Save as conf/Caddyfile for a public domain:

File contenttext
nomad.example.com {
    reverse_proxy 192.0.2.11:4646 {
        flush_interval -1
    }
}

Home-only, with Caddy's own certificate:

File contenttext
nomad.home.arpa {
    tls internal
    reverse_proxy 192.0.2.11:4646 {
        flush_interval -1
    }
}

Run docker compose up -d. For tls internal, trust Caddy's root on devices you own:

Run in terminalbash
cd ~/docker_volumes/caddy
docker compose cp caddy:/data/caddy/pki/authorities/local/root.crt /tmp/caddy-root.crt
sudo cp /tmp/caddy-root.crt /usr/local/share/ca-certificates/caddy-local-root.crt && sudo update-ca-certificates

Windows (administrator PowerShell): certutil -addstore -f "ROOT" "$env:TEMP\caddy-root.crt". Mac: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/caddy-root.crt.

Check it worked. curl -I https://nomad.example.com/ui/ returns a status line over HTTPS (Windows: curl.exe). Sign in with the daily token.

Security and testing#

ControlHow
ACLsOn for every agent (Steps 2 and 4); bootstrap token locked away; small daily and Traefik tokens
Who can start containersAnyone with submit-job can run any image on your machines. Treat the daily token like SSH access
Host foldersDocker host-path volumes are off by default (docker.volumes.enabled) and allow_privileged defaults to false. Leave both
EncryptionACLs do not encrypt. The docs describe mutual TLS and call it required for production; we did not set it up. Keep ports 4646-4648 on a trusted LAN or VPN, or follow the TLS page
FirewallOnly your LAN to 4646-4648; Docker bypasses ufw for published ports
Traefik tokenRead-only, in .env with chmod 600; anyone with Docker access sees it in docker inspect
Phone-homeNomad contacts HashiCorp's Checkpoint service; the FAQ says disable_update_check = true and disable_anonymous_signature = true switch it off

Quick tests:

Run in terminalbash
nomad server members
nomad node status
nomad job status whoami
nomad service list

Nomad, Docker Swarm or Kubernetes?#

HashiCorp's own comparison calls Kubernetes "operationally complex to setup" and Nomad a single binary that only does cluster management and scheduling; that is a vendor's view. Docker's docs say Swarm mode is built into Docker Engine. Our reading for a home lab:

NomadDocker SwarmKubernetes
InstallOne binary per machineAlready in Docker EngineSeveral parts
Job formatHCL job filesCompose-style stack filesYAML manifests
Good forA few machines, mixed workloadsLeast new software if you use DockerThe industry standard, larger setups
Our guideThis oneSwarmpitRancher

For one machine, stay with Docker Compose; for a dashboard over several Compose hosts, see Komodo.

Common mistakes#

These come from real GitHub issues, the official docs and common AI answers.

MistakeWhy it happensDo this instead
Constraint "missing drivers" filtered 1 nodes (issue 696)Docker is missing, stopped, installed after Nomad, or Nomad cannot read its socket. A typo in driver gives the same text (issue 9437)Start Docker, restart Nomad, check that nomad node status <id> shows docker true true, and spell driver = "docker" right
service block without provider = "nomad" (issue 12958)Consul is the default providerAdd provider = "nomad" to every service
Bootstrap fails with 403 (Permission denied) (issue 16098)An old NOMAD_TOKEN is still setunset NOMAD_TOKEN (PowerShell: $env:NOMAD_TOKEN = $null) first
ACL bootstrap already done (reset index: 7) (official docs)Bootstrap works once; the token was lostKeep the token. To reset, follow the docs: write the index into acl-bootstrap-reset in the leader's data folder
A client starts its own clusterThe package sample keeps server { enabled = true }Overwrite the whole file (Step 4); nomad server members must list one server
nomad.raft: not part of stable configuration, aborting election (issue 10179)Nomad picked the Docker bridge address 172.17.0.1 after a restartSet advertise by hand (Step 2), as the maintainer advised
volumes are not enabled; cannot mount host paths: "/alloc/data/repo:/app/" (issue 9901)docker.volumes.enabled defaults to falseUse relative paths or template, or enable it deliberately in the Docker plugin settings
failed to find plugin "bridge" in path [/opt/cni/bin] (issue 6319)mode = "bridge" needs CNI plugins; the default is hostKeep the default, or install the CNI plugins the docs name
Dimension network: reserved port collision www=80 exhausted on 1 nodes (issue 18064)static = 80 reserves that host port on the machineUse dynamic ports, as in Step 5
AI assistants: "Nomad needs Consul for Traefik"HashiCorp's own Traefik page still says "You must configure your Nomad installation to use Consul"provider = "nomad" and Traefik's Nomad provider, as here
AI assistants: to = 80 in a plain port block, or traefik.* Docker labels in the jobOld tutorials. to works by default only in bridge mode; the Nomad provider reads service tagsThe port from NOMAD_PORT_http, and tags on service
AI assistants: retry_join or start_join inside server {}, or nomad agent -dev for good2.1.0 removed those server fields; the docs say not to use -dev in productionThe server_join block, and a config file with a service

Tip: After a config change run nomad config validate /etc/nomad.d before restarting Nomad.

Tip: Keep job files in Git. They are your record of what runs where, and nomad job run applies them again on a fresh cluster.

Troubleshooting#

ProblemSolution
Job stays pendingnomad job status whoami, then nomad alloc status <alloc-id>; read the placement failures
Everything answers 403Is NOMAD_TOKEN set in this window? nomad acl token self shows who you are
A client is not listedjournalctl -u nomad -n 50 --no-pager on it; check servers, and nc -zv 192.0.2.11 4647
Traefik answers 404Host name in the tag, DNS record or traefik.enable=true is missing; docker compose logs traefik
Traefik answers 502 or times outIt cannot reach the address and port from nomad service info: check firewalls
Docker Desktop job cannot reach the hostBind the client to a non-loopback interface (official FAQ)
Traefik cannot find NomadIn a container 127.0.0.1 is the container: use the LAN address in NOMAD_API_URL

Exact error texts#

  • Error querying jobs: Unexpected response code: 403 (Permission denied): no token (official docs).
  • Driver docker is not detected, with docker false false in nomad node status <id>: Docker was not found when Nomad started (official docs example).
  • dial unix /var/run/docker.sock: connect: no such file or directory (issue 16709): the Docker socket is elsewhere, for example rootless Docker. That report was a regression in 1.4.6 and 1.5.x; set the plugin's endpoint if your socket is not the default.

Known bugs (open, December 2026)#

Issue 28813: one report that 2.1.1 runs an HTTP service check (provider = "nomad") far more often than its interval; not reproduced on a small job. Issue 28760: relative volume paths fail on Windows clients. Issue 28762: tasks with a user fail on macOS; our job sets none. Issue 28645: the UI floods the server when a time-limited token expires, so avoid -ttl for UI tokens. None stops this guide's setup.

Updates and backups#

Update Nomad. Read the release notes first: 2.1.0 removed the old server retry_join fields and requires agent:write to join servers. The docs say upgrade servers first, one at a time, then clients:

Run in terminalbash
sudo apt-mark unhold nomad
sudo apt-get update
sudo apt-get install -y nomad=<new-version>
sudo apt-mark hold nomad
sudo systemctl restart nomad
nomad server members
nomad node status

Update a job's image. Change the pinned tag and run nomad job run again. For news of new tags, see our Diun guide.

What to back up. A server snapshot (jobs, nodes, ACLs and the keyring, so keep it private), /etc/nomad.d, your job files, and Traefik's .env and data. The snapshot command needs a management-level token; we use the bootstrap one in a file only you can read.

Linux and Mac#

Save as ~/docker_volumes/nomad/backup.sh and put NOMAD_ADDR=... and NOMAD_TOKEN=... (the management token) in ~/docker_volumes/nomad/backup.env with chmod 600:

File contentbash
#!/usr/bin/env bash
set -euo pipefail
umask 077
base="$HOME/docker_volumes/nomad"
set -a; . "$base/backup.env"; set +a
day="$(date +%F)"
nomad operator snapshot save "$base/backups/nomad-$day.snap"
tar -czf "$base/backups/nomad-files-$day.tar.gz" -C "$HOME/docker_volumes" nomad/jobs nomad/policies traefik-nomad/.env traefik-nomad/data

Run chmod 700 on it and add 0 3 * * * /home/<your-user>/docker_volumes/nomad/backup.sh with crontab -e. Copy the root-owned /etc/nomad.d with sudo into the same folder.

Windows (PowerShell)#

The snapshot also works from your PC, because the command talks to the API:

Codepowershell
$env:NOMAD_ADDR = "http://192.0.2.11:4646"
$env:NOMAD_TOKEN = '<your-management-secret-id>'
nomad operator snapshot save "$HOME\docker_volumes\nomad\backups\nomad-$(Get-Date -Format yyyy-MM-dd).snap"

Run it daily at 03:00 with Task Scheduler (powershell.exe -NoProfile -File <full-path-to-script>).

Restore test#

nomad operator snapshot inspect <file> shows when the snapshot was made and what it holds. A real restore is risky: the docs say it is meant for a fresh server cluster after a disaster, so try it on a spare machine, never the live server. We did not test a restore.

Performance and resources#

The docs give no lab minimum and we measured none; run top or docker stats on your machines. The cpu (MHz) and memory (MB) lines in a job are what the scheduler reserves, not measured use. The docs' server advice (4-8 cores, 16-32 GB, fast disk) targets large production clusters, far above a home lab. Servers expect under 10 ms between them.

FAQ#

Do I need Consul? No. Use provider = "nomad" and Traefik's Nomad provider. Consul adds DNS and a mesh if you want them later.

Is Nomad free for my home lab? Under the Additional Use Grant we quoted, yes: only offering Nomad to others as a competing hosted or embedded product is excluded. Re-read it for your version.

Can I use my Compose files? Not directly: Nomad has its own job format, and we know no official converter.

How many servers? The docs recommend 3 or 5 for production. One is simple but a single point of failure; we did not test what happens to running containers while it is down.

Can Windows or Mac run jobs? The docs say Nomad supports macOS, Windows and Linux, with Docker Desktop caveats. We use Linux clients.

Sources#

Checked against the official docs on 2026-12-05. Nothing was run on a real machine by DIY Lab Hub; commands come from the docs, the package files and the issues above.

Try one of these