NewCode CLOUD — 20% off your first month on all cloud VPSClaim

HashiCorp Nomad on Hong Kong VPS: Simpler Container Orchestration (2026)

· 4 min read

Kubernetes is powerful but operationally complex — Nomad offers 80% of the same workload scheduling capability with a fraction of the setup complexity. A single Nomad binary acts as both server and client, schedules Docker containers and raw binaries, integrates natively with Consul for service discovery and Vault for secrets, and runs comfortably on a modest Hong Kong VPS. For teams that find K3s still too heavy, Nomad is the pragmatic container orchestrator.


Nomad vs Kubernetes: Honest Comparison

Factor Nomad Kubernetes (K3s)
Learning curve Low — HCL jobs, simple concepts High — many abstractions
Binary size Single ~90 MB binary K3s ~70 MB + many components
RAM (idle, 1 node) ~100–200 MB ~300–500 MB
Workload types Docker, VMs, Java JARs, binaries Containers only
Service mesh Consul (optional) Built-in (complex)
Secrets Vault (native integration) Kubernetes Secrets (weaker)
Ecosystem Smaller Massive
Best for Small-medium teams, mixed workloads Large teams, pure containers

Step 1: Install Nomad

<code">apt update && apt install -y docker.io wget unzip gnupg

# Install Nomad from HashiCorp
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/hashicorp.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
  > /etc/apt/sources.list.d/hashicorp.list
apt update && apt install -y nomad

nomad version   # 1.8+

Step 2: Configure Nomad (Single Node Dev/Prod)

<code">mkdir -p /opt/nomad/data

cat > /etc/nomad.d/nomad.hcl << 'EOF'
# Single-node: acts as both server and client
server {
  enabled          = true
  bootstrap_expect = 1     # Single server
}

client {
  enabled = true
  options {
    "driver.raw_exec.enable" = "1"    # Allow running raw binaries
  }
}

data_dir = "/opt/nomad/data"

bind_addr = "0.0.0.0"

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

# Disable UI in production or protect with Nginx
ui {
  enabled = true
}
EOF

systemctl enable --now nomad
sleep 5
nomad server members   # Should show your node

Step 3: Your First Job — Node.js API

<code"># jobs/api.nomad.hcl
job "api" {
  datacenters = ["dc1"]
  type        = "service"

  group "api" {
    count = 2    # Run 2 instances

    network {
      port "http" {
        to = 3000    # Map random host port to container port 3000
      }
    }

    task "api" {
      driver = "docker"

      config {
        image = "your-registry/myapp:latest"
        ports = ["http"]
      }

      env {
        NODE_ENV = "production"
        PORT     = "${NOMAD_PORT_http}"
      }

      template {
        data        = <

Step 4: Deploy a Full Stack

<code"># jobs/stack.nomad.hcl — deploy multiple services in one job
job "myapp-stack" {
  datacenters = ["dc1"]

  # PostgreSQL
  group "database" {
    count = 1

    volume "pg-data" {
      type   = "host"
      source = "pg-data"
    }

    task "postgres" {
      driver = "docker"
      config {
        image   = "postgres:16-alpine"
        volumes = ["pg-data:/var/lib/postgresql/data"]
      }
      env {
        POSTGRES_DB       = "myapp"
        POSTGRES_USER     = "myapp_user"
        POSTGRES_PASSWORD = "DbPass!"
      }
      resources { cpu = 500; memory = 512 }
    }
  }

  # Redis
  group "cache" {
    count = 1
    task "redis" {
      driver = "docker"
      config { image = "redis:7-alpine" }
      resources { cpu = 200; memory = 128 }
    }
  }

  # Application (2 replicas)
  group "web" {
    count = 2

    network {
      port "http" { to = 3000 }
    }

    task "app" {
      driver = "docker"
      config {
        image = "your-registry/myapp:latest"
        ports = ["http"]
      }
      resources { cpu = 500; memory = 256 }
    }
  }
}

Step 5: Nginx Load Balancing via Consul

<code"># If using Consul for service discovery, generate Nginx upstream dynamically
# /etc/nginx/conf.d/api-upstream.conf.ctmpl (Consul Template)

upstream api {
{{range service "api"}}
  server {{.Address}}:{{.Port}};
{{end}}
  keepalive 32;
}

server {
  listen 443 ssl http2;
  server_name api.yourdomain.com;
  ssl_certificate /etc/letsencrypt/live/api.yourdomain.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/api.yourdomain.com/privkey.pem;

  location / {
    proxy_pass http://api;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
  }
}

# Without Consul — manual Nginx with all instance ports
upstream api {
  server 127.0.0.1:21500;    # Nomad assigns these ports dynamically
  server 127.0.0.1:21501;    # Check with: nomad alloc status JOB-ALLOC-ID
}

Step 6: Job Lifecycle Operations

<code"># Common Nomad operations
nomad job list                        # List all jobs
nomad job status api                  # Detailed job status
nomad job scale api web 3             # Scale web group to 3 instances
nomad job stop api                    # Stop a job
nomad job restart api                 # Restart all allocations

# Rolling update (zero downtime)
# In the job file — add update block:
update {
  max_parallel     = 1         # Update one instance at a time
  min_healthy_time = "30s"     # Wait 30s after health check passes
  healthy_deadline = "5m"      # Fail if not healthy within 5 minutes
  auto_revert      = true      # Revert if update fails
  canary           = 1         # Deploy 1 canary first, then the rest
}

# Deploy the update
nomad job run -check-index $(nomad job inspect api | jq .Job.ModifyIndex) jobs/api.nomad.hcl

# View logs for an allocation
nomad logs -job api -task api -stderr

Nomad UI (Web Dashboard)

<code"># Protect Nomad UI with Nginx basic auth
apt install -y apache2-utils
htpasswd -c /etc/nginx/.nomad_htpasswd admin

cat > /etc/nginx/sites-available/nomad << 'EOF'
server {
    listen 443 ssl http2;
    server_name nomad.yourdomain.com;
    ssl_certificate /etc/letsencrypt/live/nomad.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/nomad.yourdomain.com/privkey.pem;
    allow YOUR_OFFICE_IP;
    deny all;

    location / {
        auth_basic "Nomad";
        auth_basic_user_file /etc/nginx/.nomad_htpasswd;
        proxy_pass http://127.0.0.1:4646;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
EOF

Conclusion

HashiCorp Nomad on a Hong Kong VPS offers a practical middle ground between raw Docker Compose and full Kubernetes — job files in readable HCL, zero-downtime rolling updates, automatic restarts on failure, and resource limits without the complexity of K8s YAML manifests and cluster components. For teams deploying 5–50 services on 1–5 VPS nodes in Asia-Pacific, Nomad hits the sweet spot of capability and operational simplicity.

Orchestrate your services: Browse Server.HK Hong Kong VPS plans — Nomad runs on any plan; a 4 GB VPS handles 10–20 containerised services alongside the Nomad server process.

Related articles

More in VPS & ServersServer setup guides