{
  "manifest_version": "1.0.0",
  "template": {
    "id": "480e30f5-9369-4d57-8be9-ca92c8639843",
    "slug": "postgresql-server",
    "name": "PostgreSQL Server",
    "description": "Production-ready PostgreSQL with persistent storage and TCP access.",
    "url": "https://railway.com/deploy/postgresql-server",
    "upstream": {
      "image": "postgres:latest"
    }
  },
  "services": [
    {
      "name": "postgres",
      "source": {
        "image": "postgres:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "tcp_ports": [
        5432
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "postgres",
      "description": "PostgreSQL data directory inside the Railway volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "postgres",
      "description": "Private Railway hostname for internal connections",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "postgres",
      "description": "Internal PostgreSQL TCP port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "postgres",
      "description": "PostgreSQL username used by client applications",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "postgres",
      "description": "Default database used by PostgreSQL clients",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "postgres",
      "description": "PostgreSQL password used by client applications",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres",
      "description": "Default database created on first initialization",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "DATABASE_URL",
      "service": "postgres",
      "description": "Private PostgreSQL connection URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres",
      "description": "Initial PostgreSQL administrator username",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "postgres",
      "description": "Run as root to ensure Railway volume write permissions",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Initial PostgreSQL administrator password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "postgres",
      "description": "Public PostgreSQL connection URL via TCP Proxy",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "postgresql-server"
      }
    },
    "cli": "railway deploy --template postgresql-server",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "480e30f5-9369-4d57-8be9-ca92c8639843",
            "serializedConfig": {
              "services": {
                "a21703a2-1951-42bc-92b2-68236ae93030": {
                  "icon": "https://devicons.railway.com/i/postgresql.svg",
                  "name": "postgres",
                  "source": {
                    "image": "postgres:latest"
                  },
                  "variables": {
                    "PGDATA": {
                      "description": "PostgreSQL data directory inside the Railway volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "description": "Private Railway hostname for internal connections",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "description": "Internal PostgreSQL TCP port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "description": "PostgreSQL username used by client applications",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "description": "Default database used by PostgreSQL clients",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "description": "PostgreSQL password used by client applications",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "description": "Default database created on first initialization",
                      "defaultValue": "postgres"
                    },
                    "DATABASE_URL": {
                      "description": "Private PostgreSQL connection URL",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "description": "Initial PostgreSQL administrator username",
                      "defaultValue": "postgres"
                    },
                    "RAILWAY_RUN_UID": {
                      "description": "Run as root to ensure Railway volume write permissions",
                      "defaultValue": "0"
                    },
                    "POSTGRES_PASSWORD": {
                      "description": "Initial PostgreSQL administrator password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "Public PostgreSQL connection URL via TCP Proxy",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{POSTGRES_DB}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    }
                  },
                  "volumeMounts": {
                    "a21703a2-1951-42bc-92b2-68236ae93030": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-19T13:25:19.233Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_de71411241a7446697bb",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 64,
    "typical_build_seconds": 0,
    "typical_start_seconds": 0,
    "slowest_service": "postgres"
  }
}
