Skip to content

[Self-hosted] APP_NAME not available error in Docker Compose setup #1572

@cccAdam

Description

@cccAdam

Describe the bug

When starting supabase-realtime in a self-hosted Docker Compose environment, the service crashes immediately with APP_NAME not available error. This occurs despite APP_NAME being explicitly defined in the docker-compose.yml environment section.

The error is raised in config/runtime.exs which checks if APP_NAME is empty and raises an error. However, even though the variable is set in Docker's environment, it appears the Elixir release cannot access it at startup time.

To Reproduce

  1. Set up self-hosted Supabase with Docker Compose
  2. Include this configuration in docker-compose.yml:
supabase-realtime:
  image: supabase/realtime:v2.25.35
  container_name: supabase-realtime
  depends_on:
    supabase-db:
      condition: service_healthy
  environment:
    APP_NAME: realtime
    STORAGE_BACKEND: file
    DB_HOST: supabase-db
    DB_PORT: 5432
    DB_NAME: postgres
    DB_SSL: "false"
    PORT: 4000
    REPLICATION_MODE: RLS
    REPLICATION_POLL_INTERVAL: 100
    SECURE_CHANNELS: "true"
    SLOT_NAME: supabase_realtime_rls
    TEMPORARY_SLOT: "true"
    DB_USER: supabase_admin
    DB_PASSWORD: postgres_password
    JWT_SECRET: jwt_secret_value
    SECRET_KEY_BASE: jwt_secret_value
  ports:
    - "4000:4000"
  1. Run docker compose up supabase-realtime
  2. Observe immediate crash

Expected behavior

The Realtime service should start successfully and listen on port 4000.

Actual behavior

Container crashes with:

ERROR! Config provider Config.Reader failed with:
** (RuntimeError) APP_NAME not available
    /app/releases/2.25.35/runtime.exs:23: (file)

The error persists even though:

  • docker compose config shows APP_NAME correctly injected
  • All other Supabase services (auth, storage, postgrest) work normally
  • The variable is defined in the environment section

Screenshots

N/A (console error only)

System information

  • OS: Ubuntu 20.04 / VPS
  • Docker: Latest
  • Docker Compose: Latest
  • Realtime version tested: v2.25.35, v2.29.32, latest main branch
  • Elixir: 1.14.3 (in image)
  • PostgreSQL: 15.1.0

Additional context

The error originates from this code in config/runtime.exs:

app_name = System.get_env("APP_NAME", "")
if app_name == "", do: raise("APP_NAME not available")

Even though APP_NAME is set to "realtime" in docker-compose.yml, System.get_env("APP_NAME") appears to return empty string or nil when the release starts.

Investigation done:

  • Verified APP_NAME is in docker-compose.yml environment section
  • Confirmed docker compose config shows the variable correctly
  • Tested with multiple Realtime versions - issue persists
  • Attempted to modify source code and rebuild locally - issue still occurs
  • This appears to affect self-hosted deployments specifically

The issue blocks self-hosted Realtime deployments entirely. Other Supabase components work fine in the same stack.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions