{
  "manifest_version": "1.0.0",
  "template": {
    "id": "4416347a-ac44-44ae-9eee-69b8ed84ddfb",
    "slug": "pgbouncer",
    "name": "PgBouncer",
    "description": "A simple PostgreSQL pooler to reduce database connection overhead.",
    "url": "https://railway.com/deploy/pgbouncer",
    "upstream": {
      "image": "ghcr.io/cloudnative-pg/pgbouncer:1.25.2"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "pgbouncer",
      "source": {
        "image": "ghcr.io/cloudnative-pg/pgbouncer:1.25.2"
      },
      "needs_volume": false,
      "tcp_ports": [
        6432
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "POOL_MODE",
      "service": "pgbouncer",
      "description": "Pooling mode: session, transaction, or statement",
      "secret": false,
      "strategy": "default",
      "default": "transaction"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "pgbouncer",
      "description": "Hostname of the upstream PostgreSQL server",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "POSTGRES_PORT",
      "service": "pgbouncer",
      "description": "Port of the upstream PostgreSQL server",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_USER",
      "service": "pgbouncer",
      "description": "Username PgBouncer uses to connect to PostgreSQL",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGBOUNCER_PORT",
      "service": "pgbouncer",
      "description": "TCP port PgBouncer listens on for PostgreSQL connections",
      "secret": false,
      "strategy": "default",
      "default": "6432"
    },
    {
      "key": "PGBOUNCER_USER",
      "service": "pgbouncer",
      "description": "Username clients use when connecting through PgBouncer",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAX_CLIENT_CONN",
      "service": "pgbouncer",
      "description": "Maximum simultaneous client connections accepted by PgBouncer",
      "secret": false,
      "strategy": "default",
      "default": "100"
    },
    {
      "key": "DEFAULT_POOL_SIZE",
      "service": "pgbouncer",
      "description": "Maximum backend PostgreSQL connections per database/user pool",
      "secret": false,
      "strategy": "default",
      "default": "20"
    },
    {
      "key": "POSTGRES_DATABASE",
      "service": "pgbouncer",
      "description": "Actual database name on the upstream PostgreSQL server",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "pgbouncer",
      "description": "Password PgBouncer uses to connect to PostgreSQL",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PGBOUNCER_DATABASE",
      "service": "pgbouncer",
      "description": "Virtual database name exposed by PgBouncer",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGBOUNCER_PASSWORD",
      "service": "pgbouncer",
      "description": "Password clients use when connecting through PgBouncer",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "pgbouncer"
      }
    },
    "cli": "railway deploy --template pgbouncer",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "4416347a-ac44-44ae-9eee-69b8ed84ddfb",
            "serializedConfig": {
              "services": {
                "6a558241-8e7f-4d5e-b4bf-0daf4c4d882c": {
                  "icon": "https://devicons.railway.app/post",
                  "name": "pgbouncer",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'printf \"%s\\n\" \"[databases]\" \"${PGBOUNCER_DATABASE} = host=${POSTGRES_HOST} port=${POSTGRES_PORT} dbname=${POSTGRES_DATABASE} user=${POSTGRES_USER} password=${POSTGRES_PASSWORD}\" \"\" \"[pgbouncer]\" \"listen_addr = 0.0.0.0\" \"listen_port = ${PGBOUNCER_PORT}\" \"auth_type = plain\" \"auth_file = /tmp/userlist.txt\" \"pool_mode = ${POOL_MODE}\" \"default_pool_size = ${DEFAULT_POOL_SIZE}\" \"max_client_conn = ${MAX_CLIENT_CONN}\" > /tmp/pgbouncer.ini && printf \"\\\"%s\\\" \\\"%s\\\"\\n\" \"${PGBOUNCER_USER}\" \"${PGBOUNCER_PASSWORD}\" > /tmp/userlist.txt && exec pgbouncer /tmp/pgbouncer.ini'"
                  },
                  "source": {
                    "image": "ghcr.io/cloudnative-pg/pgbouncer:1.25.2"
                  },
                  "variables": {
                    "POOL_MODE": {
                      "description": "Pooling mode: session, transaction, or statement",
                      "defaultValue": "transaction"
                    },
                    "POSTGRES_HOST": {
                      "description": "Hostname of the upstream PostgreSQL server",
                      "defaultValue": "{{POSTGRES_HOST}}"
                    },
                    "POSTGRES_PORT": {
                      "description": "Port of the upstream PostgreSQL server",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_USER": {
                      "description": "Username PgBouncer uses to connect to PostgreSQL",
                      "defaultValue": "{{POSTGRES_USER}}"
                    },
                    "PGBOUNCER_PORT": {
                      "description": "TCP port PgBouncer listens on for PostgreSQL connections",
                      "defaultValue": "6432"
                    },
                    "PGBOUNCER_USER": {
                      "description": "Username clients use when connecting through PgBouncer",
                      "defaultValue": "{{PGBOUNCER_USER}}"
                    },
                    "MAX_CLIENT_CONN": {
                      "description": "Maximum simultaneous client connections accepted by PgBouncer",
                      "defaultValue": "100"
                    },
                    "DEFAULT_POOL_SIZE": {
                      "description": "Maximum backend PostgreSQL connections per database/user pool",
                      "defaultValue": "20"
                    },
                    "POSTGRES_DATABASE": {
                      "description": "Actual database name on the upstream PostgreSQL server",
                      "defaultValue": "{{POSTGRES_DATABASE}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "description": "Password PgBouncer uses to connect to PostgreSQL",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "PGBOUNCER_DATABASE": {
                      "description": "Virtual database name exposed by PgBouncer",
                      "defaultValue": "{{PGBOUNCER_DATABASE}}"
                    },
                    "PGBOUNCER_PASSWORD": {
                      "description": "Password clients use when connecting through PgBouncer",
                      "defaultValue": "{{PGBOUNCER_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "6432": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": false
  },
  "generated_at": "2026-09-22T10:14:47.278Z",
  "generator_version": "0.1.0"
}
