{
  "manifest_version": "1.0.0",
  "template": {
    "id": "8c91987c-762f-4e06-bf93-94b913ef9f39",
    "slug": "medusa-commerce",
    "name": "Medusa v2 | Headless Commerce (Server + Worker)",
    "description": "Medusa 2.20: server + worker, Postgres, Redis. Admin user created on boot.",
    "url": "https://railway.com/deploy/medusa-commerce",
    "upstream": {
      "repo_url": "https://github.com/nomideusz/medusa-railway"
    }
  },
  "services": [
    {
      "name": "server",
      "source": {
        "repo": "https://github.com/nomideusz/medusa-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/static",
      "http": true
    },
    {
      "name": "redis",
      "source": {
        "repo": "https://github.com/nomideusz/medusa-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "postgres",
      "source": {
        "repo": "https://github.com/nomideusz/medusa-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "worker",
      "source": {
        "repo": "https://github.com/nomideusz/medusa-railway"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "server",
      "description": "Medusa HTTP port. Do not change.",
      "secret": false,
      "strategy": "default",
      "default": "9000"
    },
    {
      "key": "AUTH_CORS",
      "service": "server",
      "description": "Origins allowed to call the auth API. Add your storefront URL here too.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "REDIS_URL",
      "service": "server",
      "description": "Redis connection for cache, events, workflows and locks (shared with the worker).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "ADMIN_CORS",
      "service": "server",
      "description": "Origins allowed to call the admin API. Comma-separated.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "JWT_SECRET",
      "service": "server",
      "description": "Signs auth tokens (generated). The worker reuses it.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "STORE_CORS",
      "service": "server",
      "description": "Origins allowed to call the store API. Set this to your storefront URL.",
      "secret": false,
      "strategy": "default",
      "default": "http://localhost:8000"
    },
    {
      "key": "DATABASE_URL",
      "service": "server",
      "description": "Postgres connection (private network, no TLS).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "COOKIE_SECRET",
      "service": "server",
      "description": "Signs session cookies (generated). The worker reuses it.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MEDUSA_ADMIN_EMAIL",
      "service": "server",
      "description": "First admin user, created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "MEDUSA_BACKEND_URL",
      "service": "server",
      "description": "Public URL of this server.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "MEDUSA_WORKER_MODE",
      "service": "server",
      "description": "This instance serves the API and admin; the worker service runs background jobs.",
      "secret": false,
      "strategy": "default",
      "default": "server"
    },
    {
      "key": "DISABLE_MEDUSA_ADMIN",
      "service": "server",
      "description": "Serve the admin dashboard at /app.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "MEDUSA_ADMIN_PASSWORD",
      "service": "server",
      "description": "Password for the first admin user (generated). Change it after logging in.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "redis",
      "description": "Redis password (generated).",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Postgres superuser password (generated).",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "worker",
      "description": "Internal port. Do not change.",
      "secret": false,
      "strategy": "default",
      "default": "9000"
    },
    {
      "key": "REDIS_URL",
      "service": "worker",
      "description": "Same Redis as the server.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "JWT_SECRET",
      "service": "worker",
      "description": "Shared with the server.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "worker",
      "description": "Same database as the server.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "COOKIE_SECRET",
      "service": "worker",
      "description": "Shared with the server.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MEDUSA_WORKER_MODE",
      "service": "worker",
      "description": "Runs scheduled jobs, subscribers and workflow executions.",
      "secret": false,
      "strategy": "default",
      "default": "worker"
    },
    {
      "key": "DISABLE_MEDUSA_ADMIN",
      "service": "worker",
      "description": "The worker never serves the admin.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "medusa-commerce"
      }
    },
    "cli": "railway deploy --template medusa-commerce",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "8c91987c-762f-4e06-bf93-94b913ef9f39",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "1bc12691-f573-479b-b252-2a09a6ebf5da": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/medusa-light.svg",
                  "name": "server",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/medusa-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Medusa HTTP port. Do not change.",
                      "defaultValue": "9000"
                    },
                    "AUTH_CORS": {
                      "isOptional": false,
                      "description": "Origins allowed to call the auth API. Add your storefront URL here too.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Redis connection for cache, events, workflows and locks (shared with the worker).",
                      "defaultValue": "redis://:${{redis.REDIS_PASSWORD}}@${{redis.RAILWAY_PRIVATE_DOMAIN}}:6379?family=0"
                    },
                    "ADMIN_CORS": {
                      "isOptional": false,
                      "description": "Origins allowed to call the admin API. Comma-separated.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "Signs auth tokens (generated). The worker reuses it.",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "STORE_CORS": {
                      "isOptional": false,
                      "description": "Origins allowed to call the store API. Set this to your storefront URL.",
                      "defaultValue": "http://localhost:8000"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection (private network, no TLS).",
                      "defaultValue": "postgres://postgres:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/medusa"
                    },
                    "COOKIE_SECRET": {
                      "isOptional": false,
                      "description": "Signs session cookies (generated). The worker reuses it.",
                      "defaultValue": "{{COOKIE_SECRET}}"
                    },
                    "MEDUSA_ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "First admin user, created on first boot.",
                      "defaultValue": "admin@example.com"
                    },
                    "MEDUSA_BACKEND_URL": {
                      "isOptional": false,
                      "description": "Public URL of this server.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "MEDUSA_WORKER_MODE": {
                      "isOptional": false,
                      "description": "This instance serves the API and admin; the worker service runs background jobs.",
                      "defaultValue": "server"
                    },
                    "DISABLE_MEDUSA_ADMIN": {
                      "isOptional": false,
                      "description": "Serve the admin dashboard at /app.",
                      "defaultValue": "false"
                    },
                    "MEDUSA_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the first admin user (generated). Change it after logging in.",
                      "defaultValue": "{{MEDUSA_ADMIN_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:9000": {
                        "port": 9000
                      }
                    }
                  },
                  "volumeMounts": {
                    "1bc12691-f573-479b-b252-2a09a6ebf5da": {
                      "mountPath": "/app/static"
                    }
                  }
                },
                "9b8c5bd5-a268-47a3-9abe-52e41316f10f": {
                  "icon": "https://devicons.railway.com/i/redis.svg",
                  "name": "redis",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/medusa-railway",
                    "rootDirectory": "/redis"
                  },
                  "variables": {
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Redis password (generated).",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "9b8c5bd5-a268-47a3-9abe-52e41316f10f": {
                      "mountPath": "/data"
                    }
                  }
                },
                "ba86679f-c922-4f84-b73f-4b7854687778": {
                  "icon": "https://devicons.railway.com/i/postgresql.svg",
                  "name": "postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/medusa-railway",
                    "rootDirectory": "/postgres"
                  },
                  "variables": {
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Postgres superuser password (generated).",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "ba86679f-c922-4f84-b73f-4b7854687778": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "fbd1b067-1b96-421c-b9b1-1f7e345d7814": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/medusa-light.svg",
                  "name": "worker",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/medusa-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Internal port. Do not change.",
                      "defaultValue": "9000"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Same Redis as the server.",
                      "defaultValue": "redis://:${{redis.REDIS_PASSWORD}}@${{redis.RAILWAY_PRIVATE_DOMAIN}}:6379?family=0"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "Shared with the server.",
                      "defaultValue": "${{server.JWT_SECRET}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Same database as the server.",
                      "defaultValue": "postgres://postgres:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/medusa"
                    },
                    "COOKIE_SECRET": {
                      "isOptional": false,
                      "description": "Shared with the server.",
                      "defaultValue": "${{server.COOKIE_SECRET}}"
                    },
                    "MEDUSA_WORKER_MODE": {
                      "isOptional": false,
                      "description": "Runs scheduled jobs, subscribers and workflow executions.",
                      "defaultValue": "worker"
                    },
                    "DISABLE_MEDUSA_ADMIN": {
                      "isOptional": false,
                      "description": "The worker never serves the admin.",
                      "defaultValue": "true"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "server",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-07T23:54:17.958Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-08T00:04:13.121Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_62e5032063eb471681bc",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 215,
    "typical_build_seconds": 101,
    "typical_start_seconds": 20,
    "slowest_service": "worker"
  }
}
