{
  "manifest_version": "1.0.0",
  "template": {
    "id": "8eddea7c-2669-4d75-a53a-cb3137a0dc50",
    "slug": "livebook",
    "name": "Livebook",
    "description": "Interactive notebooks for Elixir code, data and charts",
    "url": "https://railway.com/deploy/livebook",
    "upstream": {
      "image": "caddy:2-alpine"
    }
  },
  "services": [
    {
      "name": "iframe",
      "source": {
        "image": "caddy:2-alpine"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "livebook",
      "source": {
        "image": "ghcr.io/livebook-dev/livebook:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "iframe",
      "description": "Port Caddy binds and Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "CADDY_CONFIG",
      "service": "iframe",
      "description": "Caddy JSON: /healthz plus a proxy to Livebook's frame endpoint",
      "secret": false,
      "strategy": "default",
      "default": "{\"apps\":{\"http\":{\"servers\":{\"iframe\":{\"listen\":[\":{env.PORT}\"],\"routes\":[{\"match\":[{\"path\":[\"/healthz\"]}],\"handle\":[{\"handler\":\"static_response\",\"status_code\":200,\"body\":\"ok\"}]},{\"handle\":[{\"handler\":\"reverse_proxy\",\"upstreams\":[{\"dial\":\"livebook.railway.internal:8081\"}]}]}]}}}}}"
    },
    {
      "key": "PORT",
      "service": "livebook",
      "description": "Port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "HEX_HOME",
      "service": "livebook",
      "description": "Hex registry and package cache",
      "secret": false,
      "strategy": "default",
      "default": "/data/hex"
    },
    {
      "key": "AWS_REGION",
      "service": "livebook",
      "description": "Bucket placement region",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "LIVEBOOK_HOME",
      "service": "livebook",
      "description": "Notebook browser root, on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/data/notebooks"
    },
    {
      "key": "LIVEBOOK_PORT",
      "service": "livebook",
      "description": "Port Livebook binds; keep equal to PORT",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "S3_BUCKET_URL",
      "service": "livebook",
      "description": "Paste into File Storages; unread by Livebook",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "LIVEBOOK_COOKIE",
      "service": "livebook",
      "description": "Erlang distribution cookie",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MIX_INSTALL_DIR",
      "service": "livebook",
      "description": "Compiled notebook dependency cache",
      "secret": false,
      "strategy": "default",
      "default": "/data/mix-install"
    },
    {
      "key": "AWS_ACCESS_KEY_ID",
      "service": "livebook",
      "description": "Bucket access key",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "LIVEBOOK_PASSWORD",
      "service": "livebook",
      "description": "Instance password, minimum 12 characters",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "IFRAME_PUBLIC_HOST",
      "service": "livebook",
      "description": "Origin serving the output sandbox frame",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "LIVEBOOK_DATA_PATH",
      "service": "livebook",
      "description": "Settings, secrets and autosaves",
      "secret": false,
      "strategy": "default",
      "default": "/data/livebook"
    },
    {
      "key": "LIVEBOOK_LOG_LEVEL",
      "service": "livebook",
      "description": "Log verbosity; upstream default is warning",
      "secret": false,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "AWS_SECRET_ACCESS_KEY",
      "service": "livebook",
      "description": "Bucket secret key",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "LIVEBOOK_APP_SERVICE_URL",
      "service": "livebook",
      "description": "Manage-instance link in the UI",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "LIVEBOOK_AWS_CREDENTIALS",
      "service": "livebook",
      "description": "Read bucket keys from the environment",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "LIVEBOOK_SECRET_KEY_BASE",
      "service": "livebook",
      "description": "Session cookie signing key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "LIVEBOOK_APP_SERVICE_NAME",
      "service": "livebook",
      "description": "Instance label shown in the UI",
      "secret": false,
      "strategy": "default",
      "default": "Livebook on Railway"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "livebook",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "livebook"
      }
    },
    "cli": "railway deploy --template livebook",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "8eddea7c-2669-4d75-a53a-cb3137a0dc50",
            "serializedConfig": {
              "buckets": {
                "a43d1175-e2e5-4b80-97d3-33e39227d1ca": {
                  "name": "livebook-storage"
                }
              },
              "services": {
                "1639c827-55b7-4773-9028-19ba852d6d7e": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/caddy.svg",
                  "name": "iframe",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'printf %s \"$CADDY_CONFIG\" > /etc/caddy/config.json; caddy validate --config /etc/caddy/config.json || exit 1; exec caddy run --config /etc/caddy/config.json'",
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "caddy:2-alpine"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Caddy binds and Railway health-checks",
                      "defaultValue": "8080"
                    },
                    "CADDY_CONFIG": {
                      "isOptional": false,
                      "description": "Caddy JSON: /healthz plus a proxy to Livebook's frame endpoint",
                      "defaultValue": "{\"apps\":{\"http\":{\"servers\":{\"iframe\":{\"listen\":[\":{env.PORT}\"],\"routes\":[{\"match\":[{\"path\":[\"/healthz\"]}],\"handle\":[{\"handler\":\"static_response\",\"status_code\":200,\"body\":\"ok\"}]},{\"handle\":[{\"handler\":\"reverse_proxy\",\"upstreams\":[{\"dial\":\"livebook.railway.internal:8081\"}]}]}]}}}}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                },
                "2d69f8e1-db6e-4eda-8d19-ae0efdd048cd": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/livebook.svg",
                  "name": "livebook",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'for d in \"$LIVEBOOK_HOME\" \"$LIVEBOOK_DATA_PATH\" \"$MIX_INSTALL_DIR\" \"$HEX_HOME\"; do [ -n \"$d\" ] && mkdir -p \"$d\"; done; C=/sys/fs/cgroup/cpu.max; if [ -r \"$C\" ]; then Q=$(cut -d\" \" -f1 \"$C\"); P=$(cut -d\" \" -f2 \"$C\"); if [ \"$Q\" != \"max\" ] && [ \"$P\" -gt 0 ]; then N=$(( Q / P )); [ \"$N\" -lt 1 ] && N=1; export ERL_AFLAGS=\"+S $N:$N +SDcpu $N:$N +SDio $N $ERL_AFLAGS\"; fi; fi; if [ -z \"$LIVEBOOK_IFRAME_URL\" ] && [ -n \"$IFRAME_PUBLIC_HOST\" ]; then V=$(gzip -cd /app/lib/livebook-*/priv/static/assets/*.js.gz 2>/dev/null | grep -ho \"iframe/v[0-9]*.html\" | head -1); if [ -n \"$V\" ]; then export LIVEBOOK_IFRAME_URL=\"https://$IFRAME_PUBLIC_HOST/$V\"; fi; fi; echo \"livebook-boot: ERL_AFLAGS=[$ERL_AFLAGS] LIVEBOOK_IFRAME_URL=[$LIVEBOOK_IFRAME_URL] MIX_INSTALL_DIR=[$MIX_INSTALL_DIR]\"; exec /app/bin/server'",
                    "healthcheckPath": "/public/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/livebook-dev/livebook:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway health-checks",
                      "defaultValue": "8080"
                    },
                    "HEX_HOME": {
                      "isOptional": false,
                      "description": "Hex registry and package cache",
                      "defaultValue": "/data/hex"
                    },
                    "AWS_REGION": {
                      "isOptional": false,
                      "description": "Bucket placement region",
                      "defaultValue": "${{livebook-storage.REGION}}"
                    },
                    "LIVEBOOK_HOME": {
                      "isOptional": false,
                      "description": "Notebook browser root, on the volume",
                      "defaultValue": "/data/notebooks"
                    },
                    "LIVEBOOK_PORT": {
                      "isOptional": false,
                      "description": "Port Livebook binds; keep equal to PORT",
                      "defaultValue": "8080"
                    },
                    "S3_BUCKET_URL": {
                      "isOptional": true,
                      "description": "Paste into File Storages; unread by Livebook",
                      "defaultValue": "${{livebook-storage.ENDPOINT}}/${{livebook-storage.BUCKET}}"
                    },
                    "LIVEBOOK_COOKIE": {
                      "isOptional": false,
                      "description": "Erlang distribution cookie",
                      "defaultValue": "{{LIVEBOOK_COOKIE}}"
                    },
                    "MIX_INSTALL_DIR": {
                      "isOptional": false,
                      "description": "Compiled notebook dependency cache",
                      "defaultValue": "/data/mix-install"
                    },
                    "AWS_ACCESS_KEY_ID": {
                      "isOptional": false,
                      "description": "Bucket access key",
                      "defaultValue": "${{livebook-storage.ACCESS_KEY_ID}}"
                    },
                    "LIVEBOOK_PASSWORD": {
                      "isOptional": false,
                      "description": "Instance password, minimum 12 characters",
                      "defaultValue": "{{LIVEBOOK_PASSWORD}}"
                    },
                    "IFRAME_PUBLIC_HOST": {
                      "isOptional": false,
                      "description": "Origin serving the output sandbox frame",
                      "defaultValue": "${{iframe.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "LIVEBOOK_DATA_PATH": {
                      "isOptional": false,
                      "description": "Settings, secrets and autosaves",
                      "defaultValue": "/data/livebook"
                    },
                    "LIVEBOOK_LOG_LEVEL": {
                      "isOptional": true,
                      "description": "Log verbosity; upstream default is warning",
                      "defaultValue": "info"
                    },
                    "AWS_SECRET_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Bucket secret key",
                      "defaultValue": "${{livebook-storage.SECRET_ACCESS_KEY}}"
                    },
                    "LIVEBOOK_APP_SERVICE_URL": {
                      "isOptional": true,
                      "description": "Manage-instance link in the UI",
                      "defaultValue": "https://railway.com/project/${{RAILWAY_PROJECT_ID}}"
                    },
                    "LIVEBOOK_AWS_CREDENTIALS": {
                      "isOptional": false,
                      "description": "Read bucket keys from the environment",
                      "defaultValue": "true"
                    },
                    "LIVEBOOK_SECRET_KEY_BASE": {
                      "isOptional": false,
                      "description": "Session cookie signing key",
                      "defaultValue": "{{LIVEBOOK_SECRET_KEY_BASE}}"
                    },
                    "LIVEBOOK_APP_SERVICE_NAME": {
                      "isOptional": true,
                      "description": "Instance label shown in the UI",
                      "defaultValue": "Livebook on Railway"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Clean shutdown window",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "2d69f8e1-db6e-4eda-8d19-ae0efdd048cd": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "iframe",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-04T17:54:19.363Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-04T18:07:54.183Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_343a7579ffaa4534b03e",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "FAILED,SUCCESS"
      }
    ]
  }
}
