{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0d76a6d9-b80f-4c5a-b07b-0dab40319f27",
    "slug": "portr",
    "name": "portr",
    "description": "Self-hosted ngrok alternative with request inspection and replay",
    "url": "https://railway.com/deploy/portr",
    "upstream": {
      "repo_url": "https://github.com/amalshaji/portr"
    }
  },
  "services": [
    {
      "name": "portr",
      "source": {
        "repo": "https://github.com/amalshaji/portr"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORTR_DB_URL",
      "service": "portr",
      "description": "Postgres connection string, wired to the bundled Postgres database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORTR_DOMAIN",
      "service": "portr",
      "description": "Domain tunnels are served on. Keep the Railway domain to start; change after adding a wildcard custom domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PORTR_WS_URL",
      "service": "portr",
      "description": "WebSocket endpoint tunnel clients connect to; must reach port 8001. If clients cannot connect, set to the domain targeting port 8001.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PORTR_TRANSPORT",
      "service": "portr",
      "description": "Tunnel transport. Keep websocket on Railway; the ssh transport needs a raw TCP port.",
      "secret": false,
      "strategy": "default",
      "default": "websocket"
    },
    {
      "key": "PORTR_ADMIN_PORT",
      "service": "portr",
      "description": "Port the admin dashboard and API listen on.",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "PORTR_PROXY_PORT",
      "service": "portr",
      "description": "Port the tunnel proxy and WebSocket endpoint listen on.",
      "secret": false,
      "strategy": "default",
      "default": "8001"
    },
    {
      "key": "PORTR_SERVER_URL",
      "service": "portr",
      "description": "Public URL of the admin dashboard. Update if you move it to a custom domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PORTR_RESERVED_SUBDOMAIN_LIMIT",
      "service": "portr",
      "description": "Maximum reserved subdomains per team member. 0 disables new reservations.",
      "secret": false,
      "strategy": "default",
      "default": "3"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Postgres data directory inside the attached volume.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private-network hostname of the database, provided by Railway.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Port Postgres listens on.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Connection user, mirrors POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Connection database, mirrors POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Connection password, mirrors POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Name of the database created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Full connection string other services reference, e.g. portr's PORTR_DB_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity in days of the self-signed SSL certificate generated at deploy.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password, generated randomly at deploy time.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Grace period before the old deployment stops during redeploys.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "portr"
      }
    },
    "cli": "railway deploy --template portr",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0d76a6d9-b80f-4c5a-b07b-0dab40319f27",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "5b777a48-5fd4-482b-9b3c-e94782c28a3f": {
                  "icon": null,
                  "name": "portr",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/amalshaji/portr",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORTR_DB_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string, wired to the bundled Postgres database.",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "PORTR_DOMAIN": {
                      "isOptional": false,
                      "description": "Domain tunnels are served on. Keep the Railway domain to start; change after adding a wildcard custom domain.",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PORTR_WS_URL": {
                      "isOptional": false,
                      "description": "WebSocket endpoint tunnel clients connect to; must reach port 8001. If clients cannot connect, set to the domain targeting port 8001.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PORTR_TRANSPORT": {
                      "isOptional": false,
                      "description": "Tunnel transport. Keep websocket on Railway; the ssh transport needs a raw TCP port.",
                      "defaultValue": "websocket"
                    },
                    "PORTR_ADMIN_PORT": {
                      "isOptional": false,
                      "description": "Port the admin dashboard and API listen on.",
                      "defaultValue": "8000"
                    },
                    "PORTR_PROXY_PORT": {
                      "isOptional": false,
                      "description": "Port the tunnel proxy and WebSocket endpoint listen on.",
                      "defaultValue": "8001"
                    },
                    "PORTR_SERVER_URL": {
                      "isOptional": false,
                      "description": "Public URL of the admin dashboard. Update if you move it to a custom domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PORTR_RESERVED_SUBDOMAIN_LIMIT": {
                      "isOptional": false,
                      "description": "Maximum reserved subdomains per team member. 0 disables new reservations.",
                      "defaultValue": "3"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8000": {
                        "port": 8000
                      },
                      "<hasDomain>:8001": {
                        "port": 8001
                      }
                    }
                  }
                },
                "d537aff2-32eb-4077-b0b3-d69e05140f6b": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Postgres data directory inside the attached volume.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private-network hostname of the database, provided by Railway.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port Postgres listens on.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Connection user, mirrors POSTGRES_USER.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Connection database, mirrors POSTGRES_DB.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Connection password, mirrors POSTGRES_PASSWORD.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Name of the database created on first boot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Full connection string other services reference, e.g. portr's PORTR_DB_URL.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity in days of the self-signed SSL certificate generated at deploy.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, generated randomly at deploy time.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period before the old deployment stops during redeploys.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "d537aff2-32eb-4077-b0b3-d69e05140f6b": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-10T17:37:04.902Z",
  "success_rate_30d": 0.5,
  "validation": {
    "last_run_id": "run_ab659ef37786493781e5",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 199,
    "typical_build_seconds": 152,
    "typical_start_seconds": 20,
    "slowest_service": "portr"
  }
}
