{
  "manifest_version": "1.0.0",
  "template": {
    "id": "98a33020-1cd4-440f-8059-9132c4cea111",
    "slug": "paperless-ngx-self-hosted-document-manag",
    "name": "Paperless-ngx (Self-Hosted Document Management)bountiful-forgiveness",
    "description": "Self-hosted document management with OCR — scan, index, archive.",
    "url": "https://railway.com/deploy/paperless-ngx-self-hosted-document-manag",
    "upstream": {
      "image": "ghcr.io/paperless-ngx/paperless-ngx:2.20.15"
    }
  },
  "services": [
    {
      "name": "gotenberg",
      "source": {
        "image": "gotenberg/gotenberg:8.34"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "paperless-ngx",
      "source": {
        "image": "ghcr.io/paperless-ngx/paperless-ngx:2.20.15"
      },
      "needs_volume": true,
      "volume_mount_path": "/usr/src/paperless/media",
      "http": true
    },
    {
      "name": "tika",
      "source": {
        "image": "apache/tika:3.3.1.0-full"
      },
      "needs_volume": false,
      "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": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PAPERLESS_URL",
      "service": "paperless-ngx",
      "description": "Public URL of your Paperless instance; sets allowed hosts and CSRF.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PAPERLESS_PORT",
      "service": "paperless-ngx",
      "description": "Internal port Paperless listens on.",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "PAPERLESS_REDIS",
      "service": "paperless-ngx",
      "description": "Redis broker connection URL used for the async task queue.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBHOST",
      "service": "paperless-ngx",
      "description": "Private hostname of the Postgres service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBNAME",
      "service": "paperless-ngx",
      "description": "Postgres database name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBPASS",
      "service": "paperless-ngx",
      "description": "Postgres password.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBPORT",
      "service": "paperless-ngx",
      "description": "Postgres port.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBUSER",
      "service": "paperless-ngx",
      "description": "Postgres username.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAPERLESS_DBENGINE",
      "service": "paperless-ngx",
      "description": "Database backend; use PostgreSQL for production.",
      "secret": false,
      "strategy": "default",
      "default": "postgresql"
    },
    {
      "key": "PAPERLESS_TIME_ZONE",
      "service": "paperless-ngx",
      "description": "Time zone used for dates and scheduling.",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "PAPERLESS_ADMIN_USER",
      "service": "paperless-ngx",
      "description": "Username of the initial admin account, created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "PAPERLESS_SECRET_KEY",
      "service": "paperless-ngx",
      "description": "Django secret key for sessions and signing; auto-generated.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PAPERLESS_OCR_LANGUAGE",
      "service": "paperless-ngx",
      "description": "Default OCR language for document text recognition.",
      "secret": false,
      "strategy": "default",
      "default": "eng"
    },
    {
      "key": "PAPERLESS_TIKA_ENABLED",
      "service": "paperless-ngx",
      "description": "Enable Apache Tika to parse office and email documents.",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "PAPERLESS_TIKA_ENDPOINT",
      "service": "paperless-ngx",
      "description": "Private URL of the Tika service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PAPERLESS_ADMIN_PASSWORD",
      "service": "paperless-ngx",
      "description": "Password of the initial admin account; auto-generated, change after first login.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PAPERLESS_CSRF_TRUSTED_ORIGINS",
      "service": "paperless-ngx",
      "description": "Trusted origin for CSRF protection behind Railway's TLS proxy.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PAPERLESS_TIKA_GOTENBERG_ENDPOINT",
      "service": "paperless-ngx",
      "description": "Private URL of the Gotenberg conversion service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Postgres data directory; a subdirectory avoids volume-root init errors.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private hostname of this Postgres service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Postgres port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Postgres username.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Postgres database name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Postgres password.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Name of the default database created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Full Postgres connection string for clients.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser name created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity period in days for the auto-generated SSL certificate.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password, auto-generated (alphanumeric for safe connection strings).",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Grace period in seconds for draining connections during a redeploy.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Private hostname of this Redis service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Redis port.",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Redis username.",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Full Redis connection string for clients.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Redis password.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Redis password, auto-generated (alphanumeric for safe connection strings).",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "paperless-ngx-self-hosted-document-manag"
      }
    },
    "cli": "railway deploy --template paperless-ngx-self-hosted-document-manag",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "98a33020-1cd4-440f-8059-9132c4cea111",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "21848af9-c58d-44b6-a8b2-bd305ed58ee8": {
                  "icon": null,
                  "name": "gotenberg",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "gotenberg/gotenberg:8.34"
                  },
                  "variables": {}
                },
                "28588b55-7022-460f-b2cf-431c7f3af400": {
                  "icon": null,
                  "name": "paperless-ngx",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/paperless-ngx/paperless-ngx:2.20.15"
                  },
                  "variables": {
                    "PAPERLESS_URL": {
                      "isOptional": false,
                      "description": "Public URL of your Paperless instance; sets allowed hosts and CSRF.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PAPERLESS_PORT": {
                      "isOptional": false,
                      "description": "Internal port Paperless listens on.",
                      "defaultValue": "8000"
                    },
                    "PAPERLESS_REDIS": {
                      "isOptional": false,
                      "description": "Redis broker connection URL used for the async task queue.",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "PAPERLESS_DBHOST": {
                      "isOptional": false,
                      "description": "Private hostname of the Postgres service.",
                      "defaultValue": "${{Postgres.PGHOST}}"
                    },
                    "PAPERLESS_DBNAME": {
                      "isOptional": false,
                      "description": "Postgres database name.",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "PAPERLESS_DBPASS": {
                      "isOptional": false,
                      "description": "Postgres password.",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "PAPERLESS_DBPORT": {
                      "isOptional": false,
                      "description": "Postgres port.",
                      "defaultValue": "${{Postgres.PGPORT}}"
                    },
                    "PAPERLESS_DBUSER": {
                      "isOptional": false,
                      "description": "Postgres username.",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "PAPERLESS_DBENGINE": {
                      "isOptional": false,
                      "description": "Database backend; use PostgreSQL for production.",
                      "defaultValue": "postgresql"
                    },
                    "PAPERLESS_TIME_ZONE": {
                      "isOptional": false,
                      "description": "Time zone used for dates and scheduling.",
                      "defaultValue": "UTC"
                    },
                    "PAPERLESS_ADMIN_USER": {
                      "isOptional": false,
                      "description": "Username of the initial admin account, created on first boot.",
                      "defaultValue": "admin"
                    },
                    "PAPERLESS_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Django secret key for sessions and signing; auto-generated.",
                      "defaultValue": "{{PAPERLESS_SECRET_KEY}}"
                    },
                    "PAPERLESS_OCR_LANGUAGE": {
                      "isOptional": false,
                      "description": "Default OCR language for document text recognition.",
                      "defaultValue": "eng"
                    },
                    "PAPERLESS_TIKA_ENABLED": {
                      "isOptional": false,
                      "description": "Enable Apache Tika to parse office and email documents.",
                      "defaultValue": "1"
                    },
                    "PAPERLESS_TIKA_ENDPOINT": {
                      "isOptional": false,
                      "description": "Private URL of the Tika service.",
                      "defaultValue": "http://${{tika.RAILWAY_PRIVATE_DOMAIN}}:9998"
                    },
                    "PAPERLESS_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Password of the initial admin account; auto-generated, change after first login.",
                      "defaultValue": "{{PAPERLESS_ADMIN_PASSWORD}}"
                    },
                    "PAPERLESS_CSRF_TRUSTED_ORIGINS": {
                      "isOptional": false,
                      "description": "Trusted origin for CSRF protection behind Railway's TLS proxy.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "PAPERLESS_TIKA_GOTENBERG_ENDPOINT": {
                      "isOptional": false,
                      "description": "Private URL of the Gotenberg conversion service.",
                      "defaultValue": "http://${{gotenberg.RAILWAY_PRIVATE_DOMAIN}}:3000"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8000": {
                        "port": 8000
                      }
                    }
                  },
                  "volumeMounts": {
                    "28588b55-7022-460f-b2cf-431c7f3af400": {
                      "mountPath": "/usr/src/paperless/media"
                    }
                  }
                },
                "b69c8d0c-5cf9-458b-bdd8-fc602da309d2": {
                  "icon": null,
                  "name": "tika",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "apache/tika:3.3.1.0-full"
                  },
                  "variables": {}
                },
                "ea90e4f1-591d-4ae6-920b-7864f7461d13": {
                  "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; a subdirectory avoids volume-root init errors.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private hostname of this Postgres service.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Postgres port.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Postgres username.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Postgres database name.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Name of the default database created on first boot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Full Postgres connection string for clients.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser name created on first boot.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity period in days for the auto-generated SSL certificate.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, auto-generated (alphanumeric for safe connection strings).",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period in seconds for draining connections during a redeploy.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "ea90e4f1-591d-4ae6-920b-7864f7461d13": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "fae27146-a0e5-481b-a169-c4d18b36a0cc": {
                  "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"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Private hostname of this Redis service.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Redis port.",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Redis username.",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Full Redis connection string for clients.",
                      "defaultValue": "redis://${{REDISUSER}}:${{REDIS_PASSWORD}}@${{REDISHOST}}:${{REDISPORT}}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Redis password.",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Redis password, auto-generated (alphanumeric for safe connection strings).",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "fae27146-a0e5-481b-a169-c4d18b36a0cc": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 5,
    "needs_volume": true
  },
  "generated_at": "2026-09-09T00:02:40.379Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-04T06:54:20.240Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_910991780377474ab183",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 72,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "paperless-ngx"
  }
}
