{
  "slug": "cost-per-sandbox-hour-hetzner-vs-aws",
  "question": "Is a Space-hour cheaper on Hetzner or AWS?",
  "answer": "Packed onto one machine with at least 25 idle Spaces of 1 vCPU and 512 MiB, a Space-hour cost at most $0.0016/Space-hour on a Hetzner cax31 and $0.0116/Space-hour on an AWS c7g.2xlarge at list prices (3 runs each, 2026-10-25). The account plan's 25-session limit stopped both, so both are upper bounds.",
  "status": "measured",
  "url": "https://cua.ai/benchmarks/cost-per-sandbox-hour-hetzner-vs-aws",
  "csv": "https://cua.ai/benchmarks/cost-per-sandbox-hour-hetzner-vs-aws.csv",
  "markdown": "https://cua.ai/benchmarks/cost-per-sandbox-hour-hetzner-vs-aws.md",
  "group": "Cost",
  "series": [
    {
      "label": "Hetzner cax31",
      "run": {
        "run": "2026-10-25/result-hetzner",
        "schema": "cua.bench-result/v1",
        "bench": "elastic-pack.hetzner",
        "slug": "cost-per-sandbox-hour-hetzner-vs-aws",
        "metric": "usd_per_space_hour",
        "value": 0.0016,
        "unit": "USD/Space-hour",
        "stat": "max",
        "n": 3,
        "percentiles": {
          "min": 0.0016,
          "max": 0.0016
        },
        "extra": {
          "usd_per_hour_instance_list": 0.04,
          "spaces_per_host_min": 25,
          "spaces_per_host_max": 25,
          "usd_per_space_hour_incl_public_ipv4": 0.00164,
          "public_ipv4_usd_per_hour": 0.001,
          "run_hz1g1_1GiB_spaces": 15,
          "run_hz1g2_1GiB_spaces": 16,
          "run_hz1g3_1GiB_spaces": 15
        },
        "samples_csv": "samples-hetzner.csv",
        "measured_at": "2026-10-25T01:39:05Z",
        "build": {
          "cua": "0.9.0",
          "app": "0.15.0",
          "source": "cua CLI bundled in Cua Spaces 0.15.0 DMG (GitHub release cua-spaces-v0.15.0, published 2026-10-24T19:42Z), `cua --version` = cua 0.9.0",
          "published": true
        },
        "host": {
          "name": "Mac Studio (the client)",
          "model": "Mac14,13",
          "chip": "Apple M2 Max",
          "cpus": 12,
          "memory_gb": 96,
          "os": "macOS 26.6.2",
          "where": "client in California, home network"
        },
        "environment": {
          "kind": "container (gVisor) on one elastic pool host",
          "cloud": "hetzner",
          "machine_type": "cax31 (8 vCPU Ampere arm64, 16 GB)",
          "space_shape": "ghcr.io/trycua/linux:24.04-slim, 1 vCPU / 512 MiB booked each",
          "autoscale": "on, $0.40/h cap (blocks a 2nd host), host pinned via `cua cloud hosts add`"
        },
        "method": "Released cua 0.9.0 elastic pool. One pinned cax31 (8 vCPU Ampere arm64, 16 GB) host (`cua cloud hosts add`). Each run asks for 32 Spaces at once (16 concurrent `cua spaces create ghcr.io/trycua/linux:24.04-slim --on hetzner --instance-type cax31 --cpus 1 --memory-mb 512`), runs `cua sb exec <ref> -- echo ok` in every created Space, counts the Spaces that answer on that one host, then deletes them all. n=3 runs. $/Space-hour = the instance's on-demand list price / Spaces held at once (Hetzner Cloud API server_types cax31 fsn1 price_hourly gross $0.0400, read 2026-10-25).",
        "reproduce": "# Cua Spaces 0.15.0 from cua.ai/download (its cua CLI is cua 0.9.0)\ncurl -fLO https://cua.ai/benchmarks/cost-per-sandbox-hour-hetzner-vs-aws/files/pack.py\ncua auth login && cua cloud connect hetzner --token-stdin --region fsn1 < token\ncua daemon start --foreground &\ncua cloud budget --autoscale on --max-per-hour 0.40 --monthly 20\ncua cloud hosts add --provider hetzner --type cax31 --region fsn1 --ttl-hours 2\nfor r in 1 2 3; do python3 pack.py hetzner cax31 32 16 run$r --cpus 1 --memory-mb 512; done\ncua cloud hosts rm <host> && cua cloud sweep --all --delete",
        "caveats": [
          "The ceiling of 25 Spaces per machine is the account plan's live-session limit, not the machine's: further creates were refused with 'Your plan allows 25 live sessions'. So the cost per Space-hour is an upper bound.",
          "Price is the instance's on-demand list price only; extra.usd_per_space_hour_incl_public_ipv4 adds its public IPv4. Disk and traffic are not included.",
          "Spaces were idle apart from the exec check: booked-shape density, not a CPU-bound load.",
          "Hetzner bills each started hour."
        ],
        "sources": [],
        "status": "measured"
      }
    },
    {
      "label": "AWS c7g.2xlarge",
      "run": {
        "run": "2026-10-25/result-aws",
        "schema": "cua.bench-result/v1",
        "bench": "elastic-pack.aws",
        "slug": "cost-per-sandbox-hour-hetzner-vs-aws",
        "metric": "usd_per_space_hour",
        "value": 0.0116,
        "unit": "USD/Space-hour",
        "stat": "max",
        "n": 3,
        "percentiles": {
          "min": 0.0116,
          "max": 0.0116
        },
        "extra": {
          "usd_per_hour_instance_list": 0.29,
          "spaces_per_host_min": 25,
          "spaces_per_host_max": 25,
          "usd_per_space_hour_incl_public_ipv4": 0.0118,
          "public_ipv4_usd_per_hour": 0.005
        },
        "samples_csv": "samples-aws.csv",
        "measured_at": "2026-10-25T01:16:57Z",
        "build": {
          "cua": "0.9.0",
          "app": "0.15.0",
          "source": "cua CLI bundled in Cua Spaces 0.15.0 DMG (GitHub release cua-spaces-v0.15.0, published 2026-10-24T19:42Z), `cua --version` = cua 0.9.0",
          "published": true
        },
        "host": {
          "name": "Mac Studio (the client)",
          "model": "Mac14,13",
          "chip": "Apple M2 Max",
          "cpus": 12,
          "memory_gb": 96,
          "os": "macOS 26.6.2",
          "where": "client in California, home network"
        },
        "environment": {
          "kind": "container (gVisor) on one elastic pool host",
          "cloud": "aws",
          "machine_type": "c7g.2xlarge (8 vCPU Graviton3, 16 GiB)",
          "space_shape": "ghcr.io/trycua/linux:24.04-slim, 1 vCPU / 512 MiB booked each",
          "autoscale": "on, $0.40/h cap (blocks a 2nd host), host pinned via `cua cloud hosts add`"
        },
        "method": "Released cua 0.9.0 elastic pool. One pinned c7g.2xlarge (8 vCPU Graviton3, 16 GiB) host (`cua cloud hosts add`). Each run asks for 32 Spaces at once (16 concurrent `cua spaces create ghcr.io/trycua/linux:24.04-slim --on aws --instance-type c7g.2xlarge --cpus 1 --memory-mb 512`), runs `cua sb exec <ref> -- echo ok` in every created Space, counts the Spaces that answer on that one host, then deletes them all. n=3 runs. $/Space-hour = the instance's on-demand list price / Spaces held at once (AWS Price List API, c7g.2xlarge Linux on-demand us-west-2 $0.29/h).",
        "reproduce": "# Cua Spaces 0.15.0 from cua.ai/download (its cua CLI is cua 0.9.0)\ncurl -fLO https://cua.ai/benchmarks/cost-per-sandbox-hour-hetzner-vs-aws/files/pack.py\ncua auth login && cua cloud connect aws --profile <aws-profile> --region us-west-2\ncua daemon start --foreground &\ncua cloud budget --autoscale on --max-per-hour 0.40 --monthly 20\ncua cloud hosts add --provider aws --type c7g.2xlarge --ttl-hours 2\nfor r in 1 2 3; do python3 pack.py aws c7g.2xlarge 32 16 run$r --cpus 1 --memory-mb 512; done\ncua cloud hosts rm <host> && cua cloud sweep --all --delete",
        "caveats": [
          "The ceiling of 25 Spaces per machine is the account plan's live-session limit, not the machine's: further creates were refused with 'Your plan allows 25 live sessions'. So the cost per Space-hour is an upper bound.",
          "Price is the instance's on-demand list price only; extra.usd_per_space_hour_incl_public_ipv4 adds its public IPv4. Disk and traffic are not included.",
          "Spaces were idle apart from the exec check: booked-shape density, not a CPU-bound load."
        ],
        "sources": [],
        "status": "measured"
      }
    }
  ]
}
