{
  "manifest_version": "1.0.0",
  "template": {
    "id": "589d1b07-6622-43dd-aa8d-e72ee15ad016",
    "slug": "apache-superset-postgresredis",
    "name": "Apache Superset + Postgres/Redis",
    "description": "Apache Superset BI with Postgres, Redis, and persistent volumes.",
    "url": "https://railway.com/deploy/apache-superset-postgresredis",
    "upstream": {
      "image": "apache/superset:5.0.0-dev"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "superset",
      "source": {
        "image": "apache/superset:5.0.0-dev"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/superset_home",
      "http": true
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "postgres",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGHOST",
      "service": "postgres",
      "description": "Provide a value for PGHOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "postgres",
      "description": "Provide a value for PGPORT.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGUSER",
      "service": "postgres",
      "description": "Provide a value for PGUSER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "postgres",
      "description": "Provide a value for PGDATABASE.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "postgres",
      "description": "Provide a value for PGPASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "DATABASE_URL",
      "service": "postgres",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "postgres",
      "description": "Provide a value for SSL_CERT_DAYS.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "postgres",
      "description": "Provide a value for RAILWAY_DEPLOYMENT_DRAINING_SECONDS.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "REDIS_HOST",
      "service": "superset",
      "description": "Provide a value for REDIS_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DATABASE_DB",
      "service": "superset",
      "description": "Provide a value for DATABASE_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_HOST",
      "service": "superset",
      "description": "Provide a value for DATABASE_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DATABASE_USER",
      "service": "superset",
      "description": "Provide a value for DATABASE_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "superset",
      "description": "Provide a value for REDIS_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "superset",
      "description": "Provide a value for RAILWAY_RUN_UID.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "DATABASE_PASSWORD",
      "service": "superset",
      "description": "Provide a value for DATABASE_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SUPERSET_SECRET_KEY",
      "service": "superset",
      "description": "Provide a value for SUPERSET_SECRET_KEY.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SUPERSET_ADMIN_PASSWORD",
      "service": "superset",
      "description": "Provide a value for SUPERSET_ADMIN_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Provide a value for REDIS_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "apache-superset-postgresredis"
      }
    },
    "cli": "railway deploy --template apache-superset-postgresredis",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "589d1b07-6622-43dd-aa8d-e72ee15ad016",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "3cebd6a7-7fc3-4fd1-bdb3-24ede2dd58c9": {
                  "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,
                      "defaultValue": "{{PGDATA}}"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "defaultValue": "{{PGPORT}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_DB}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_USER}}"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "defaultValue": "{{SSL_CERT_DAYS}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "defaultValue": "{{RAILWAY_DEPLOYMENT_DRAINING_SECONDS}}"
                    }
                  },
                  "volumeMounts": {
                    "3cebd6a7-7fc3-4fd1-bdb3-24ede2dd58c9": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "407762b2-d031-4f79-8299-174d708140b7": {
                  "icon": null,
                  "name": "superset",
                  "deploy": {
                    "startCommand": "/bin/sh -lc '\nset -eu\nmkdir -p /app/superset_home\nexport DATABASE_USER=\"${DATABASE_USER:-superset}\"\nexport DATABASE_DB=\"${DATABASE_DB:-superset}\"\nexport DATABASE_PORT=\"${DATABASE_PORT:-5432}\"\nexport DATABASE_DIALECT=\"${DATABASE_DIALECT:-postgresql+psycopg2}\"\nexport REDIS_PORT=\"${REDIS_PORT:-6379}\"\nexport REDIS_CACHE_DB=\"${REDIS_CACHE_DB:-2}\"\nexport REDIS_CELERY_DB=\"${REDIS_CELERY_DB:-0}\"\nexport REDIS_RESULTS_DB=\"${REDIS_RESULTS_DB:-1}\"\nexport SUPERSET_ADMIN_USERNAME=\"${SUPERSET_ADMIN_USERNAME:-admin}\"\nexport SUPERSET_ADMIN_FIRSTNAME=\"${SUPERSET_ADMIN_FIRSTNAME:-Superset}\"\nexport SUPERSET_ADMIN_LASTNAME=\"${SUPERSET_ADMIN_LASTNAME:-Admin}\"\nexport SUPERSET_ADMIN_EMAIL=\"${SUPERSET_ADMIN_EMAIL:-admin@example.com}\"\nexport SUPERSET_SECRET_KEY=\"${SUPERSET_SECRET_KEY:-$DATABASE_PASSWORD}\"\nexport SUPERSET_ADMIN_PASSWORD=\"${SUPERSET_ADMIN_PASSWORD:-$DATABASE_PASSWORD}\"\nexport SUPERSET_WEBSERVER_WORKERS=\"${SUPERSET_WEBSERVER_WORKERS:-2}\"\nexport SUPERSET_WEBSERVER_TIMEOUT=\"${SUPERSET_WEBSERVER_TIMEOUT:-120}\"\ncat >/app/superset_home/superset_config.py <<PY\nimport os\ndatabase_dialect = os.environ.get(\"DATABASE_DIALECT\", \"postgresql+psycopg2\")\ndatabase_user = os.environ.get(\"DATABASE_USER\", \"superset\")\ndatabase_password = os.environ[\"DATABASE_PASSWORD\"]\ndatabase_host = os.environ[\"DATABASE_HOST\"]\ndatabase_port = os.environ.get(\"DATABASE_PORT\", \"5432\")\ndatabase_db = os.environ.get(\"DATABASE_DB\", \"superset\")\nSQLALCHEMY_DATABASE_URI = f\"{database_dialect}://{database_user}:{database_password}@{database_host}:{database_port}/{database_db}\"\nSECRET_KEY = os.environ[\"SUPERSET_SECRET_KEY\"]\nENABLE_PROXY_FIX = True\nPREFERRED_URL_SCHEME = \"https\"\nredis_host = os.environ[\"REDIS_HOST\"]\nredis_port = os.environ.get(\"REDIS_PORT\", \"6379\")\nredis_password = os.environ[\"REDIS_PASSWORD\"]\nredis_cache_db = int(os.environ.get(\"REDIS_CACHE_DB\", \"2\"))\nredis_celery_db = os.environ.get(\"REDIS_CELERY_DB\", \"0\")\nredis_results_db = os.environ.get(\"REDIS_RESULTS_DB\", \"1\")\nCACHE_CONFIG = {\"CACHE_TYPE\": \"RedisCache\", \"CACHE_DEFAULT_TIMEOUT\": 300, \"CACHE_KEY_PREFIX\": \"superset_\", \"CACHE_REDIS_HOST\": redis_host, \"CACHE_REDIS_PORT\": int(redis_port), \"CACHE_REDIS_PASSWORD\": redis_password, \"CACHE_REDIS_DB\": redis_cache_db}\nDATA_CACHE_CONFIG = CACHE_CONFIG\nFILTER_STATE_CACHE_CONFIG = CACHE_CONFIG\nEXPLORE_FORM_DATA_CACHE_CONFIG = CACHE_CONFIG\nclass CeleryConfig:\n    broker_url = f\"redis://:{redis_password}@{redis_host}:{redis_port}/{redis_celery_db}\"\n    result_backend = f\"redis://:{redis_password}@{redis_host}:{redis_port}/{redis_results_db}\"\nCELERY_CONFIG = CeleryConfig\nPY\nexport SUPERSET_CONFIG_PATH=/app/superset_home/superset_config.py\n/app/.venv/bin/superset db upgrade\n/app/.venv/bin/superset fab create-admin --username \"$SUPERSET_ADMIN_USERNAME\" --firstname \"$SUPERSET_ADMIN_FIRSTNAME\" --lastname \"$SUPERSET_ADMIN_LASTNAME\" --email \"$SUPERSET_ADMIN_EMAIL\" --password \"$SUPERSET_ADMIN_PASSWORD\" || true\n/app/.venv/bin/superset init\nexec /app/.venv/bin/gunicorn --bind \"0.0.0.0:${PORT:-8088}\" --workers \"$SUPERSET_WEBSERVER_WORKERS\" --timeout \"$SUPERSET_WEBSERVER_TIMEOUT\" \"superset.app:create_app()\"\n'",
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "apache/superset:5.0.0-dev"
                  },
                  "variables": {
                    "REDIS_HOST": {
                      "isOptional": false,
                      "defaultValue": "${{Redis.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "DATABASE_DB": {
                      "isOptional": false,
                      "defaultValue": "${{postgres.POSTGRES_DB}}"
                    },
                    "DATABASE_HOST": {
                      "isOptional": false,
                      "defaultValue": "${{postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "DATABASE_USER": {
                      "isOptional": false,
                      "defaultValue": "${{postgres.POSTGRES_USER}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{Redis.REDIS_PASSWORD}}"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "defaultValue": "{{RAILWAY_RUN_UID}}"
                    },
                    "DATABASE_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{postgres.POSTGRES_PASSWORD}}"
                    },
                    "SUPERSET_SECRET_KEY": {
                      "isOptional": false,
                      "defaultValue": "${{Redis.REDIS_PASSWORD}}"
                    },
                    "SUPERSET_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{postgres.POSTGRES_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "407762b2-d031-4f79-8299-174d708140b7": {
                      "mountPath": "/app/superset_home"
                    }
                  }
                },
                "4b15421c-b3c6-4926-80d2-09bc78a7ef86": {
                  "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": {
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "4b15421c-b3c6-4926-80d2-09bc78a7ef86": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "superset",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T10:14:45.332Z",
  "generator_version": "0.1.0"
}
