{
  "manifest_version": "1.0.0",
  "template": {
    "id": "33d850cf-0d53-40d2-8422-4fc2b8648d09",
    "slug": "pgvector-or-just-updated-postgres-18-vec",
    "name": "pgvector | (Just Updated) Postgres 18 Vector DB Where HNSW Indexes Actually Build",
    "description": "Postgres 18 + pgvector, tuned per plan, HNSW indexes that actually build",
    "url": "https://railway.com/deploy/pgvector-or-just-updated-postgres-18-vec",
    "upstream": {
      "image": "pgvector/pgvector@sha256:78bf48b801e792f99e3ac62b5036fd3876e9be48afda16c1e331af1c75ceb2ff"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "pgvector",
      "source": {
        "image": "pgvector/pgvector@sha256:78bf48b801e792f99e3ac62b5036fd3876e9be48afda16c1e331af1c75ceb2ff"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "tcp_ports": [
        5432
      ],
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGHOST",
      "service": "pgvector",
      "description": "Provide a value for PGHOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGUSER",
      "service": "pgvector",
      "description": "Provide a value for PGUSER.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGDATABASE",
      "service": "pgvector",
      "description": "Provide a value for PGDATABASE.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGPASSWORD",
      "service": "pgvector",
      "description": "Provide a value for PGPASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "pgvector",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "DATABASE_URL",
      "service": "pgvector",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_USER",
      "service": "pgvector",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "pgvector",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PRIVATE_URL",
      "service": "pgvector",
      "description": "Provide a value for DATABASE_PRIVATE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "pgvector-or-just-updated-postgres-18-vec"
      }
    },
    "cli": "railway deploy --template pgvector-or-just-updated-postgres-18-vec",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "33d850cf-0d53-40d2-8422-4fc2b8648d09",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "6f9a27bd-caee-405b-a36a-dafb3aab1b5b": {
                  "icon": null,
                  "name": "pgvector",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'unset PGHOST PGPORT PGUSER PGPASSWORD PGDATABASE;M=$(cat /sys/fs/cgroup/memory.max 2>/dev/null); M=${M:-max}; [ \"$M\" = max ] && M=2147483648;MB=$((M/1048576));SB=$((MB/4)); [ \"$SB\" -lt 128 ] && SB=128;EC=$((MB*3/5)); [ \"$EC\" -lt 256 ] && EC=256;MW=$((MB/5)); [ \"$MW\" -lt 64 ] && MW=64; [ \"$MW\" -gt 2048 ] && MW=2048;WM=$((MB/64)); [ \"$WM\" -lt 4 ] && WM=4; [ \"$WM\" -gt 64 ] && WM=64;set -- $(cat /sys/fs/cgroup/cpu.max 2>/dev/null); Q=${1:-max}; P=${2:-100000};if [ \"$Q\" = max ]; then C=2; else C=$((Q/P)); fi;[ \"$C\" -lt 1 ] && C=1;PM=$((C/2)); [ \"$PM\" -lt 1 ] && PM=1; [ \"$PM\" -gt 4 ] && PM=4;mkdir -p /docker-entrypoint-initdb.d;printf \"%s\\n\" \"CREATE EXTENSION IF NOT EXISTS vector;\" \"\\\\c template1\" \"CREATE EXTENSION IF NOT EXISTS vector;\" > /docker-entrypoint-initdb.d/10-vector.sql;echo \"[railway] mem=${MB}MB cpu=$C shared_buffers=${SB}MB effective_cache_size=${EC}MB maintenance_work_mem=${MW}MB work_mem=${WM}MB dsm=mmap\"; exec docker-entrypoint.sh postgres -c dynamic_shared_memory_type=mmap -c shared_buffers=${SB}MB -c effective_cache_size=${EC}MB -c maintenance_work_mem=${MW}MB -c work_mem=${WM}MB -c max_worker_processes=$C -c max_parallel_workers=$C -c max_parallel_workers_per_gather=$PM -c max_parallel_maintenance_workers=$PM'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgvector/pgvector@sha256:78bf48b801e792f99e3ac62b5036fd3876e9be48afda16c1e331af1c75ceb2ff"
                  },
                  "variables": {
                    "PGHOST": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "defaultValue": "{{PGUSER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "defaultValue": "{{PGDATABASE}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_DB}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://postgres:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/railway"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_USER}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PRIVATE_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://postgres:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/railway"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    }
                  },
                  "volumeMounts": {
                    "6f9a27bd-caee-405b-a36a-dafb3aab1b5b": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": true
  },
  "generated_at": "2026-09-07T17:54:24.783Z",
  "generator_version": "0.1.0"
}
