{
  "manifest_version": "1.0.0",
  "template": {
    "id": "00329d5e-5df7-4ec7-b202-7f488834f756",
    "slug": "paperless-ngx-3",
    "name": "Paperless-ngx",
    "description": "Paperless-ngx — document management with OCR and full-text search",
    "url": "https://railway.com/deploy/paperless-ngx-3",
    "upstream": {
      "repo_url": "https://github.com/INAPP-Mobile/paperless-ngx-railway"
    }
  },
  "services": [
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2.1"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "paperless-ngx",
      "source": {
        "repo": "https://github.com/INAPP-Mobile/paperless-ngx-railway"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Redis/Valkey connection URL with password. Auto-shared with the Paperless service as PAPERLESS_REDIS.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Redis password. Auto-generated. Used in REDIS_URL for auth.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Postgres data directory. Must be a subdirectory of the volume mount path (/var/lib/postgresql) so lost+found stays outside PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Postgres internal hostname (Railway private domain). Shared with Paperless-ngx via companion-mapping.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Postgres port. Shared with Paperless-ngx via companion-mapping.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Postgres username for Paperless-ngx. Shares the POSTGRES_USER value. Shared with Paperless-ngx via companion-mapping.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Postgres database name. Shares the POSTGRES_DB value. Shared with Paperless-ngx via companion-mapping.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Postgres password for Paperless-ngx. Shares the POSTGRES_PASSWORD value. Shared with Paperless-ngx via companion-mapping.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Initial database created on first boot. Also used as PGDATABASE for Paperless-ngx.",
      "secret": false,
      "strategy": "default",
      "default": "paperless"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Postgres superuser name. Also used by Paperless-ngx to connect (PGUSER).",
      "secret": false,
      "strategy": "default",
      "default": "paperless"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Postgres password. Auto-generated. Also used by Paperless-ngx to connect (PGPASSWORD).",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "paperless-ngx",
      "description": "Port for the Paperless-ngx web server.",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "PAPERLESS_URL",
      "service": "paperless-ngx",
      "description": "Public URL for Paperless-ngx. Auto-configured via Railway public domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PAPERLESS_REDIS",
      "service": "paperless-ngx",
      "description": "Redis connection string for Celery broker. Auto-detected from the Redis companion service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBHOST",
      "service": "paperless-ngx",
      "description": "PostgreSQL host. Auto-detected from the Postgres companion service (PGHOST).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBNAME",
      "service": "paperless-ngx",
      "description": "PostgreSQL database name. Auto-detected from the Postgres companion service (PGDATABASE).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBPASS",
      "service": "paperless-ngx",
      "description": "PostgreSQL password. Auto-detected from the Postgres companion service (PGPASSWORD).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBPORT",
      "service": "paperless-ngx",
      "description": "PostgreSQL port. Auto-detected from the Postgres companion service (PGPORT).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBUSER",
      "service": "paperless-ngx",
      "description": "PostgreSQL username. Auto-detected from the Postgres companion service (PGUSER).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBENGINE",
      "service": "paperless-ngx",
      "description": "Database engine to use.",
      "secret": false,
      "strategy": "default",
      "default": "postgresql"
    },
    {
      "key": "PAPERLESS_TIME_ZONE",
      "service": "paperless-ngx",
      "description": "Timezone for Paperless-ngx operations.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "PAPERLESS_DB_OPTIONS",
      "service": "paperless-ngx",
      "description": "PostgreSQL connection options (JSON). Sets SSL mode to prefer.",
      "secret": false,
      "strategy": "default",
      "default": "{\"sslmode\": \"prefer\"}"
    },
    {
      "key": "PAPERLESS_SECRET_KEY",
      "service": "paperless-ngx",
      "description": "Secret key for session tokens and signing. Auto-generated on first deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PAPERLESS_OCR_LANGUAGE",
      "service": "paperless-ngx",
      "description": "Default language for OCR. Set to the language most of your documents are written in.",
      "secret": false,
      "strategy": "default",
      "default": "eng"
    },
    {
      "key": "PAPERLESS_OCR_LANGUAGES",
      "service": "paperless-ngx",
      "description": "Additional OCR languages to install, space-separated.",
      "secret": false,
      "strategy": "default",
      "default": "eng"
    },
    {
      "key": "PAPERLESS_CONSUMER_RECURSIVE",
      "service": "paperless-ngx",
      "description": "Whether the document consumer recursively scans subdirectories.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "PAPERLESS_CONSUMER_POLLING_INTERVAL",
      "service": "paperless-ngx",
      "description": "Polling interval (seconds) for the consumer. 0 = event-driven (recommended).",
      "secret": false,
      "strategy": "default",
      "default": "0"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "paperless-ngx-3"
      }
    },
    "cli": "railway deploy --template paperless-ngx-3",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "00329d5e-5df7-4ec7-b202-7f488834f756",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "58538287-2119-45c6-ad6a-fb0086657247": {
                  "icon": "https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2.1"
                  },
                  "variables": {
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Redis/Valkey connection URL with password. Auto-shared with the Paperless service as PAPERLESS_REDIS.",
                      "defaultValue": "redis://:${{REDIS_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:6379"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Redis password. Auto-generated. Used in REDIS_URL for auth.",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "58538287-2119-45c6-ad6a-fb0086657247": {
                      "mountPath": "/data"
                    }
                  },
                  "haTemplateCode": "redis-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxies",
                      "options": [
                        1,
                        2
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "HAProxy instances routing writes to the primary",
                      "defaultValue": 2
                    },
                    "replica": {
                      "label": "Redis Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "Redis",
                      "description": "Nodes running Redis + colocated Sentinel",
                      "defaultValue": 2
                    },
                    "internal": null,
                    "description": "This will convert your Redis instance to an HA cluster with Sentinel failover and HAProxy routing to the primary."
                  }
                },
                "5b692bea-2510-46c7-83a1-7d3b06292d0c": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Postgres data directory. Must be a subdirectory of the volume mount path (/var/lib/postgresql) so lost+found stays outside PGDATA.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Postgres internal hostname (Railway private domain). Shared with Paperless-ngx via companion-mapping.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Postgres port. Shared with Paperless-ngx via companion-mapping.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Postgres username for Paperless-ngx. Shares the POSTGRES_USER value. Shared with Paperless-ngx via companion-mapping.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Postgres database name. Shares the POSTGRES_DB value. Shared with Paperless-ngx via companion-mapping.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password for Paperless-ngx. Shares the POSTGRES_PASSWORD value. Shared with Paperless-ngx via companion-mapping.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Initial database created on first boot. Also used as PGDATABASE for Paperless-ngx.",
                      "defaultValue": "paperless"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Postgres superuser name. Also used by Paperless-ngx to connect (PGUSER).",
                      "defaultValue": "paperless"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password. Auto-generated. Also used by Paperless-ngx to connect (PGPASSWORD).",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "5b692bea-2510-46c7-83a1-7d3b06292d0c": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                },
                "c7f63fe3-645e-4244-a933-657749b20ea7": {
                  "icon": null,
                  "name": "paperless-ngx",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/INAPP-Mobile/paperless-ngx-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port for the Paperless-ngx web server.",
                      "defaultValue": "8000"
                    },
                    "PAPERLESS_URL": {
                      "isOptional": false,
                      "description": "Public URL for Paperless-ngx. Auto-configured via Railway public domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PAPERLESS_REDIS": {
                      "isOptional": false,
                      "description": "Redis connection string for Celery broker. Auto-detected from the Redis companion service.",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "PAPERLESS_DBHOST": {
                      "isOptional": false,
                      "description": "PostgreSQL host. Auto-detected from the Postgres companion service (PGHOST).",
                      "defaultValue": "${{Postgres.PGHOST}}"
                    },
                    "PAPERLESS_DBNAME": {
                      "isOptional": false,
                      "description": "PostgreSQL database name. Auto-detected from the Postgres companion service (PGDATABASE).",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "PAPERLESS_DBPASS": {
                      "isOptional": false,
                      "description": "PostgreSQL password. Auto-detected from the Postgres companion service (PGPASSWORD).",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "PAPERLESS_DBPORT": {
                      "isOptional": false,
                      "description": "PostgreSQL port. Auto-detected from the Postgres companion service (PGPORT).",
                      "defaultValue": "${{Postgres.PGPORT}}"
                    },
                    "PAPERLESS_DBUSER": {
                      "isOptional": false,
                      "description": "PostgreSQL username. Auto-detected from the Postgres companion service (PGUSER).",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "PAPERLESS_DBENGINE": {
                      "isOptional": false,
                      "description": "Database engine to use.",
                      "defaultValue": "postgresql"
                    },
                    "PAPERLESS_TIME_ZONE": {
                      "isOptional": false,
                      "description": "Timezone for Paperless-ngx operations.",
                      "defaultValue": "UTC"
                    },
                    "PAPERLESS_DB_OPTIONS": {
                      "isOptional": false,
                      "description": "PostgreSQL connection options (JSON). Sets SSL mode to prefer.",
                      "defaultValue": "{\"sslmode\": \"prefer\"}"
                    },
                    "PAPERLESS_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Secret key for session tokens and signing. Auto-generated on first deploy.",
                      "defaultValue": "{{PAPERLESS_SECRET_KEY}}"
                    },
                    "PAPERLESS_OCR_LANGUAGE": {
                      "isOptional": false,
                      "description": "Default language for OCR. Set to the language most of your documents are written in.",
                      "defaultValue": "eng"
                    },
                    "PAPERLESS_OCR_LANGUAGES": {
                      "description": "Additional OCR languages to install, space-separated.",
                      "defaultValue": "eng"
                    },
                    "PAPERLESS_CONSUMER_RECURSIVE": {
                      "isOptional": false,
                      "description": "Whether the document consumer recursively scans subdirectories.",
                      "defaultValue": "true"
                    },
                    "PAPERLESS_CONSUMER_POLLING_INTERVAL": {
                      "isOptional": false,
                      "description": "Polling interval (seconds) for the consumer. 0 = event-driven (recommended).",
                      "defaultValue": "0"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-09T19:33:37.214Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-08T19:28:30.395Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_7be73b9aa15845aabb4f",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 143,
    "typical_build_seconds": 71,
    "typical_start_seconds": 20,
    "slowest_service": "paperless-ngx"
  }
}
