{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0a97bf5f-3d76-4f07-a10c-ba6f0e313f54",
    "slug": "postgresql-18-1",
    "name": "PostgreSQL 18",
    "description": "Deploy and host PostgreSQL 18 on Railway",
    "url": "https://railway.com/deploy/postgresql-18-1",
    "upstream": {
      "repo_url": "https://github.com/castab/postgres-18-ssl"
    }
  },
  "services": [
    {
      "name": "postgres-18-ssl",
      "source": {
        "repo": "https://github.com/castab/postgres-18-ssl"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "tcp_ports": [
        5432
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "postgres-18-ssl",
      "description": "Postgres 18's data directory path (version-specific, relative to the mounted volume).",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/18/docker"
    },
    {
      "key": "PGHOST",
      "service": "postgres-18-ssl",
      "description": "Internal hostname for connecting to Postgres over Railway's private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "postgres-18-ssl",
      "description": "Port Postgres listens on.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "postgres-18-ssl",
      "description": "Connecting user, mirrors POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "postgres-18-ssl",
      "description": "Database to connect to, mirrors POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "postgres-18-ssl",
      "description": "Connecting user's password, mirrors POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres-18-ssl",
      "description": "Name of the default database created on first init.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "postgres-18-ssl",
      "description": "Full connection string for internal access from other services in the same Railway project.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres-18-ssl",
      "description": "Superuser account created on first init.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "postgres-18-ssl",
      "description": "Validity period, in days, for the self-signed SSL certs generated at init.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_VERSION",
      "service": "postgres-18-ssl",
      "description": "Postgres image tag to build (must stay within the 18.x line - see Dockerfile 18). Build time only, unlike the other vars here which are read at container time.",
      "secret": false,
      "strategy": "default",
      "default": "18.6"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres-18-ssl",
      "description": "Auto-generated random password for POSTGRES_USER.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "postgres-18-ssl",
      "description": "Full connection string for external access via Railway's public TCP proxy.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "postgres-18-ssl",
      "description": "Grace period between SIGTERM and SIGKILL for the old deployment during a rollout, letting in-flight connections finish.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "postgresql-18-1"
      }
    },
    "cli": "railway deploy --template postgresql-18-1",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0a97bf5f-3d76-4f07-a10c-ba6f0e313f54",
            "serializedConfig": {
              "services": {
                "c46e0642-b92e-44f5-ab08-d63d46f665e2": {
                  "icon": "https://www.postgresql.org/media/img/about/press/elephant64.png",
                  "name": "postgres-18-ssl",
                  "source": {
                    "repo": "castab/postgres-18-ssl",
                    "branch": null,
                    "rootDirectory": null
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": true,
                      "description": "Postgres 18's data directory path (version-specific, relative to the mounted volume).",
                      "defaultValue": "/var/lib/postgresql/18/docker"
                    },
                    "PGHOST": {
                      "isOptional": true,
                      "description": "Internal hostname for connecting to Postgres over Railway's private network.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": true,
                      "description": "Port Postgres listens on.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": true,
                      "description": "Connecting user, mirrors POSTGRES_USER.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": true,
                      "description": "Database to connect to, mirrors POSTGRES_DB.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": true,
                      "description": "Connecting user's password, mirrors POSTGRES_PASSWORD.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": true,
                      "description": "Name of the default database created on first init.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": true,
                      "description": "Full connection string for internal access from other services in the same Railway project.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:${{PGPORT}}/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": true,
                      "description": "Superuser account created on first init.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "Validity period, in days, for the self-signed SSL certs generated at init.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_VERSION": {
                      "isOptional": true,
                      "description": "Postgres image tag to build (must stay within the 18.x line - see Dockerfile 18). Build time only, unlike the other vars here which are read at container time.",
                      "defaultValue": "18.6"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": true,
                      "description": "Auto-generated random password for POSTGRES_USER.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": true,
                      "description": "Full connection string for external access via Railway's public TCP proxy.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Grace period between SIGTERM and SIGKILL for the old deployment during a rollout, letting in-flight connections finish.",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    }
                  },
                  "volumeMounts": {
                    "c46e0642-b92e-44f5-ab08-d63d46f665e2": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-13T22:14:35.692Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-14T02:14:51.747Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_e8f374cca3bc4b539110",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 132,
    "typical_build_seconds": 31,
    "typical_start_seconds": 10,
    "slowest_service": "postgres-18-ssl"
  }
}
