{
  "manifest_version": "1.0.0",
  "template": {
    "id": "827eda4a-9da3-4cc6-bf7a-b2145e19dbbc",
    "slug": "mage-ai",
    "name": "Mage AI | Open Source Airflow Alternative for Data Pipelines",
    "description": "Open-source Airflow alternative for data pipelines, auth on by default",
    "url": "https://railway.com/deploy/mage-ai",
    "upstream": {
      "image": "mageai/mageai:0.9.79"
    }
  },
  "services": [
    {
      "name": "Mage",
      "source": {
        "image": "mageai/mageai:0.9.79"
      },
      "needs_volume": true,
      "volume_mount_path": "/home/src",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "postgres:18.6-alpine"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Mage",
      "description": "Port Mage listens on. `mage start` takes it from its own default rather than from this variable, so changing it here only changes where Railway routes.",
      "secret": false,
      "strategy": "default",
      "default": "6789"
    },
    {
      "key": "JWT_SECRET",
      "service": "Mage",
      "description": "Signs the session cookie. Upstream ships the literal default \"materia\", which means anyone can mint a valid session against a deployment that never set it.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MAGE_DATA_DIR",
      "service": "Mage",
      "description": "Where Mage writes each block's output variables and each run's logs. Also on the volume, and the directory that grows — `mage clean-variables` and `mage clean-logs` are what reclaim it.",
      "secret": false,
      "strategy": "default",
      "default": "/home/src/mage_data"
    },
    {
      "key": "USER_CODE_PATH",
      "service": "Mage",
      "description": "Directory holding your Mage project — pipelines, blocks, dbt models and requirements.txt. It is on the volume, so your code survives redeploys. Rename the last path segment to rename the project; keep it under /home/src.",
      "secret": false,
      "strategy": "default",
      "default": "/home/src/railway_pipeline"
    },
    {
      "key": "MAGE_PUBLIC_HOST",
      "service": "Mage",
      "description": "Public URL of this deployment. Mage builds the API-trigger examples and notification links from it.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DEFAULT_OWNER_EMAIL",
      "service": "Mage",
      "description": "Email of the owner account created on the first boot — this is what you log in with. Change it to your own address before deploying.",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "JWT_DOWNLOAD_SECRET",
      "service": "Mage",
      "description": "Signs file-download links. Left unset, Mage generates a new one per process, so every restart invalidates outstanding download links.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PREINSTALL_PACKAGES",
      "service": "Mage",
      "description": "Installed with pip before the server starts. It is here for one reason: every published mageai image, `latest` included, carries a numpy that mis-registers its ufuncs on this hardware, so scipy fails on import and Mage dies before binding a port (upstream issue #6103). Reinstalling the same version from PyPI fixes it. Empty this once an upstream image boots on its own.",
      "secret": false,
      "strategy": "default",
      "default": "numpy==1.26.4"
    },
    {
      "key": "DEFAULT_OWNER_PASSWORD",
      "service": "Mage",
      "description": "Password for the owner account, generated once. Change it from inside Mage after the first login; editing it here only affects a fresh deployment.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DEFAULT_OWNER_USERNAME",
      "service": "Mage",
      "description": "Username of that owner account.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "DISABLE_AUTO_BROWSER_OPEN",
      "service": "Mage",
      "description": "Stops Mage trying to open a desktop browser tab at boot, which makes no sense in a container.",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "REQUIRE_USER_AUTHENTICATION",
      "service": "Mage",
      "description": "Keeps the login screen on. This UI executes arbitrary Python, SQL and shell commands and has a built-in terminal, so on a public domain turning this off hands all of that to anyone who finds the URL.",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "MAGE_DATABASE_CONNECTION_URL",
      "service": "Mage",
      "description": "Metadata database: pipeline runs, schedules, users and tokens. Without it Mage falls back to SQLite inside the container and loses all of that on every deploy.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PORT",
      "service": "Postgres",
      "description": "Port Postgres listens on.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database the image creates on the first boot. Mage runs its migrations here.",
      "secret": false,
      "strategy": "default",
      "default": "mage"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser Mage connects as.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated once and read by Mage over the private network. The alphabet is alphanumeric on purpose: the default character set can emit `/` or `@`, either of which breaks the connection URL this password is substituted into.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mage-ai"
      }
    },
    "cli": "railway deploy --template mage-ai",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "827eda4a-9da3-4cc6-bf7a-b2145e19dbbc",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "8452f543-6000-4093-9b83-ba4e4264567a": {
                  "icon": "https://cdn.jsdelivr.net/gh/mage-ai/mage-ai@ebec68aa016e575a4a79d13ebc69a3e9c0205a42/docs/favicons/m1.svg",
                  "name": "Mage",
                  "deploy": {
                    "startCommand": "sh -c 'if [ -n \"$PREINSTALL_PACKAGES\" ]; then pip install --no-cache-dir -q --force-reinstall --no-deps $PREINSTALL_PACKAGES; fi; exec /app/run_app.sh'",
                    "healthcheckPath": "/api/status",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 2
                  },
                  "source": {
                    "image": "mageai/mageai:0.9.79"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Mage listens on. `mage start` takes it from its own default rather than from this variable, so changing it here only changes where Railway routes.",
                      "defaultValue": "6789"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "Signs the session cookie. Upstream ships the literal default \"materia\", which means anyone can mint a valid session against a deployment that never set it.",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "MAGE_DATA_DIR": {
                      "isOptional": false,
                      "description": "Where Mage writes each block's output variables and each run's logs. Also on the volume, and the directory that grows — `mage clean-variables` and `mage clean-logs` are what reclaim it.",
                      "defaultValue": "/home/src/mage_data"
                    },
                    "USER_CODE_PATH": {
                      "isOptional": false,
                      "description": "Directory holding your Mage project — pipelines, blocks, dbt models and requirements.txt. It is on the volume, so your code survives redeploys. Rename the last path segment to rename the project; keep it under /home/src.",
                      "defaultValue": "/home/src/railway_pipeline"
                    },
                    "MAGE_PUBLIC_HOST": {
                      "isOptional": false,
                      "description": "Public URL of this deployment. Mage builds the API-trigger examples and notification links from it.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DEFAULT_OWNER_EMAIL": {
                      "isOptional": false,
                      "description": "Email of the owner account created on the first boot — this is what you log in with. Change it to your own address before deploying.",
                      "defaultValue": "admin@example.com"
                    },
                    "JWT_DOWNLOAD_SECRET": {
                      "isOptional": false,
                      "description": "Signs file-download links. Left unset, Mage generates a new one per process, so every restart invalidates outstanding download links.",
                      "defaultValue": "{{JWT_DOWNLOAD_SECRET}}"
                    },
                    "PREINSTALL_PACKAGES": {
                      "isOptional": false,
                      "description": "Installed with pip before the server starts. It is here for one reason: every published mageai image, `latest` included, carries a numpy that mis-registers its ufuncs on this hardware, so scipy fails on import and Mage dies before binding a port (upstream issue #6103). Reinstalling the same version from PyPI fixes it. Empty this once an upstream image boots on its own.",
                      "defaultValue": "numpy==1.26.4"
                    },
                    "DEFAULT_OWNER_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the owner account, generated once. Change it from inside Mage after the first login; editing it here only affects a fresh deployment.",
                      "defaultValue": "{{DEFAULT_OWNER_PASSWORD}}"
                    },
                    "DEFAULT_OWNER_USERNAME": {
                      "isOptional": false,
                      "description": "Username of that owner account.",
                      "defaultValue": "admin"
                    },
                    "DISABLE_AUTO_BROWSER_OPEN": {
                      "isOptional": false,
                      "description": "Stops Mage trying to open a desktop browser tab at boot, which makes no sense in a container.",
                      "defaultValue": "1"
                    },
                    "REQUIRE_USER_AUTHENTICATION": {
                      "isOptional": false,
                      "description": "Keeps the login screen on. This UI executes arbitrary Python, SQL and shell commands and has a built-in terminal, so on a public domain turning this off hands all of that to anyone who finds the URL.",
                      "defaultValue": "1"
                    },
                    "MAGE_DATABASE_CONNECTION_URL": {
                      "isOptional": false,
                      "description": "Metadata database: pipeline runs, schedules, users and tokens. Without it Mage falls back to SQLite inside the container and loses all of that on every deploy.",
                      "defaultValue": "postgresql://postgres:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/mage"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:6789": {
                        "port": 6789
                      }
                    }
                  },
                  "volumeMounts": {
                    "8452f543-6000-4093-9b83-ba4e4264567a": {
                      "mountPath": "/home/src"
                    }
                  }
                },
                "d5bb27a4-a936-4711-97eb-cf6a62634899": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 2
                  },
                  "source": {
                    "image": "postgres:18.6-alpine"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Postgres listens on.",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database the image creates on the first boot. Mage runs its migrations here.",
                      "defaultValue": "mage"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser Mage connects as.",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated once and read by Mage over the private network. The alphabet is alphanumeric on purpose: the default character set can emit `/` or `@`, either of which breaks the connection URL this password is substituted into.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "d5bb27a4-a936-4711-97eb-cf6a62634899": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Mage",
      "method": "GET",
      "path": "/api/status",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-19T04:14:37.968Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-17T10:05:58.816Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_a854e025177f440bb42b",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 113,
    "typical_build_seconds": 0,
    "typical_start_seconds": 37,
    "slowest_service": "Mage"
  }
}
