{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f69db776-c35f-45cd-bee8-c86fe0407614",
    "slug": "electricsql-postgres-18-or-just-updated-",
    "name": "ElectricSQL + Postgres 18 | (Just Updated) Real-Time Sync Engine, Database Included, Write From Anywhere",
    "description": "Electric sync engine + Postgres 18, logical replication on, public psql URL",
    "url": "https://railway.com/deploy/electricsql-postgres-18-or-just-updated-",
    "upstream": {
      "image": "electricsql/electric:latest"
    }
  },
  "services": [
    {
      "name": "electric",
      "source": {
        "image": "electricsql/electric:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/electric/persistent",
      "http": true
    },
    {
      "name": "postgres",
      "source": {
        "image": "postgres:18.6@sha256:74935e72241653ca55e0414067e6d8763aceb8a810eb51b452253ec3dcfc4336"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "tcp_ports": [
        5432
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "DATABASE_URL",
      "service": "electric",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "ELECTRIC_SECRET",
      "service": "electric",
      "description": "Provide a value for ELECTRIC_SECRET.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DATABASE_URL",
      "service": "postgres",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "postgres",
      "description": "Provide a value for DATABASE_PUBLIC_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "electricsql-postgres-18-or-just-updated-"
      }
    },
    "cli": "railway deploy --template electricsql-postgres-18-or-just-updated-",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f69db776-c35f-45cd-bee8-c86fe0407614",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "62626d57-ed9c-4328-b5f1-3c4b49843a15": {
                  "icon": null,
                  "name": "electric",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'export ELECTRIC_PORT=\"${PORT:-3000}\" ELECTRIC_LISTEN_ON_IPV6=true ELECTRIC_DATABASE_USE_IPV6=true ELECTRIC_STORAGE_DIR=/var/lib/electric/persistent; exec /app/bin/entrypoint start'",
                    "healthcheckPath": "/v1/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "electricsql/electric:latest"
                  },
                  "variables": {
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://postgres:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/postgres?sslmode=disable"
                    },
                    "ELECTRIC_SECRET": {
                      "isOptional": false,
                      "defaultValue": "{{ELECTRIC_SECRET}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "62626d57-ed9c-4328-b5f1-3c4b49843a15": {
                      "mountPath": "/var/lib/electric/persistent"
                    }
                  }
                },
                "93a8e595-7adc-43f1-a7ce-0bf9632252c1": {
                  "icon": null,
                  "name": "postgres",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'D=/var/lib/postgresql/ssl; if [ ! -s \"$D/server.key\" ]; then mkdir -p \"$D\" && openssl req -new -x509 -days 3650 -nodes -subj /CN=postgres -keyout \"$D/server.key\" -out \"$D/server.crt\" 2>/dev/null && chown -R postgres:postgres \"$D\" && chmod 600 \"$D/server.key\"; fi; exec docker-entrypoint.sh postgres -c wal_level=logical -c max_wal_senders=10 -c max_replication_slots=10 -c ssl=on -c ssl_cert_file=\"$D/server.crt\" -c ssl_key_file=\"$D/server.key\"'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:18.6@sha256:74935e72241653ca55e0414067e6d8763aceb8a810eb51b452253ec3dcfc4336"
                  },
                  "variables": {
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://postgres:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://postgres:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/postgres?sslmode=require"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    }
                  },
                  "volumeMounts": {
                    "93a8e595-7adc-43f1-a7ce-0bf9632252c1": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "electric",
      "method": "GET",
      "path": "/v1/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-14T16:14:49.737Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-14T14:39:21.301Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_11c94c7b5359464fba2b",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 37,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "electric"
  }
}
