{
  "manifest_version": "1.0.0",
  "template": {
    "id": "69a044b4-c668-4eaf-921e-3b9b70093e71",
    "slug": "timescaledb-postgis-pg14",
    "name": "TimescaleDB + PostGIS (PG14)",
    "description": "Deploy and Host TimescaleDB + PostGIS (PG14) with Railway",
    "url": "https://railway.com/deploy/timescaledb-postgis-pg14",
    "upstream": {
      "image": "ghcr.io/railwayapp-templates/timescale-postgis-ssl:pg14-ts2.12"
    }
  },
  "services": [
    {
      "name": "TimescaleDB",
      "source": {
        "image": "ghcr.io/railwayapp-templates/timescale-postgis-ssl:pg14-ts2.12"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "tcp_ports": [
        5432
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "TimescaleDB",
      "description": "Location where the database will be initialized",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "TimescaleDB",
      "description": "Railway TCP Proxy Domain",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPORT",
      "service": "TimescaleDB",
      "description": "Port on which to listen for connections",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGUSER",
      "service": "TimescaleDB",
      "description": "Required variable for Data panel",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NO_TS_TUNE",
      "service": "TimescaleDB",
      "description": "Do not run `timescaledb-tune` at Startup. This improves memory usage of the database.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PGDATABASE",
      "service": "TimescaleDB",
      "description": "Required variable for the data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "TimescaleDB",
      "description": "Required variable for Data panel",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "TimescaleDB",
      "description": "Default database created when image is started.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "TimescaleDB",
      "description": "URL to connect to Postgres database over private networking",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "TimescaleDB",
      "description": "User to connect to Postgres DB",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "TimescaleDB",
      "description": "SSL certificate expiry in days.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "TimescaleDB",
      "description": "Run as root to enable permissions to the volume",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "TimescaleDB",
      "description": "Password to connect to DB",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "TimescaleDB",
      "description": "URL to connect to Postgres database over public networking",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "timescaledb-postgis-pg14"
      }
    },
    "cli": "railway deploy --template timescaledb-postgis-pg14",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "69a044b4-c668-4eaf-921e-3b9b70093e71",
            "serializedConfig": {
              "services": {
                "cd9e7fcd-f4eb-4fd8-b537-7a8273c9f4eb": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "TimescaleDB",
                  "build": {},
                  "deploy": {
                    "requiredMountPath": "/var/lib/postgresql/data"
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/timescale-postgis-ssl:pg14-ts2.12"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Location where the database will be initialized",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Railway TCP Proxy Domain",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port on which to listen for connections",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_PORT}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "NO_TS_TUNE": {
                      "isOptional": true,
                      "description": "Do not run `timescaledb-tune` at Startup. This improves memory usage of the database.",
                      "defaultValue": "true"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Required variable for the data panel.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created when image is started.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "URL to connect to Postgres database over private networking",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "User to connect to Postgres DB",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry in days.",
                      "defaultValue": "820"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Run as root to enable permissions to the volume",
                      "defaultValue": "0"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password to connect to DB",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "URL to connect to Postgres database over public networking",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{POSTGRES_DB}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    },
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "cd9e7fcd-f4eb-4fd8-b537-7a8273c9f4eb": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T10:14:37.339Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T14:25:52.561Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_5498a33597cd43cabc93",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 107,
    "typical_build_seconds": 0,
    "typical_start_seconds": 23,
    "slowest_service": "TimescaleDB"
  }
}
