Environment variables

The standard Docker Compose file includes sane defaults for getting started quickly.

You can configure Sequin by setting environment variables.

To see the file that loads and uses these environment variables, see config/runtime.exs.

General configuration

  • SERVER_PORT: Server port number (default: 7376)
    • This is the port that Sequin will listen on for incoming connections. It’s the port for both the web console as well as the API.
  • SERVER_HOST: Host name for the server
    • If you’re hosting Sequin at a custom domain, you should set this to that domain.

Configuration file

You can provide a YAML configuration file to Sequin. This configuration file will upsert databases, sinks, and other resources on boot.

  • CONFIG_FILE_PATH: Path to configuration file
  • CONFIG_FILE_YAML: YAML configuration content (base64 encoded)
    • If it’s easier, you can provide the YAML directly as an environment variable. The YAML file must be base64 encoded.

Postgres configuration

  • PG_URL: Complete Postgres connection URL (alternative to individual PG_* variables below)
    • (e.g. postgres://sequin:password@localhost:5432/sequin)
  • PG_PORT: Postgres port number (default: 5432)
  • PG_HOSTNAME: Postgres host address
  • PG_DATABASE: Database name
  • PG_USERNAME: Database user
  • PG_PASSWORD: Database password
  • PG_IPV6: Enable IPv6 support (default: false)
  • PG_SSL: Enable SSL for Postgres connection (default: false)
  • PG_POOL_SIZE: Database connection pool size (default: 10)

PG_POOL_SIZE

The PG_POOL_SIZE variable controls the maximum number of concurrent connections that Sequin will maintain to Postgres. For higher throughput on larger Postgres instances, you should increase this value.

Runtime configuration

  • BACKFILL_MAX_PENDING_MESSAGES: When backfilling, the maximum number of pending messages to accumulate in the sink’s outbox before pausing the backfill. When messages start draining to the sink, the backfill will automatically resume. The default is 1M messages.

Redis configuration

  • REDIS_URL: Redis connection URL (required)
    • Format: redis://localhost:6379 or rediss://localhost:6379
    • Using rediss:// automatically enables SSL
  • REDIS_SSL: Enable SSL for Redis connection (optional)
    • Valid values: "true", "1"
    • Default: disabled
  • REDIS_IPV6: Enable IPv6 support (optional)
    • Valid values: "true" or "1" to enable
    • Default: disabled

SSL Configuration

SSL can be enabled in two ways:

  1. Using a rediss:// URL scheme in REDIS_URL
  2. Setting REDIS_SSL to one of the enabling values

Security configuration

  • SECRET_KEY_BASE: Base secret key for encryption
  • VAULT_KEY: Vault encryption key

See secret generation for how to generate these values.

Feature configuration

  • FEATURE_ACCOUNT_SELF_SIGNUP: Enable account self-signup (default: enabled)
    • If disabled, users must be invited to the Sequin instance by an admin. Turn this setting off if you’ll be hosting Sequin at a public URL.
  • FEATURE_PROVISION_DEFAULT_USER: Enable default user provisioning (default: enabled)
    • By default, Sequin provisions a default user on startup if one doesn’t exist. This is a convenience feature to get started quickly. If you’re hosting Sequin at a public URL, you should consider either changing the password for this user or disabling this feature.
  • SEQUIN_TELEMETRY_DISABLED: Disable telemetry data collection (default: false)
    • Sequin collects telemetry data by default. While we’re early, this greatly helps us improve the product. To opt-out, set this to true.
  • CRASH_REPORTING_DISABLED: Disable crash reporting (default: false)
    • Sequin sends crash reports to Sentry by default. This is very useful for the Sequin team to proactively fix bugs. To opt-out, set this to true.

Networking configuration

  • LONG_POLL_FALLBACK_MS: Long poll fallback time in milliseconds (default: 3000)
    • This is the duration that Sequin will wait for a healthy websocket connection before falling back to HTTP long polling. If your network configuration disallows websocket connections, you should set this to a low value (e.g. 100ms).

Clustering configuration

You can cluster Sequin nodes in an active-passive configuration for high availability. See Active-passive architecture for more information.

We recommend using the AUTO_ASSIGN_RELEASE_NODE setting, unless it doesn’t suit your requirements.

  • RELEASE_DISTRIBUTION: Must be set to name (default: sname, which disables network clustering).
  • AUTO_ASSIGN_RELEASE_NODE: Set to true to automatically assign a node name (default: false). See start_commands.sh to see how Sequin generates node names. Overrides RELEASE_NODE.
  • RELEASE_NODE: Manually set the node name. Each node must have a unique name. Format is {node_name}@{ip_address_or_hostname}.
  • RELEASE_COOKIE: The secret key nodes will use to authenticate with each other. Must be same for all nodes. Use a strong random string.
  • ELIXIR_ERL_OPTIONS: Set to -proto_dist inet6_tcp to enable IPv6 support when clustering (default is unset).

Email configuration

Email configuration is coming soon. Please comment on this issue if you’d like to see this feature.

OAuth configuration

To use GitHub OAuth as a sign-in/sign-up method, provide the following environment variables:

  • GITHUB_CLIENT_ID: GitHub OAuth client ID
  • GITHUB_CLIENT_SECRET: GitHub OAuth client secret

Monitoring/stats configuration

Monitoring/stats configuration is coming soon. Please comment on this issue if you’d like to see this feature.

Deploying to production

Secret generation

For production environments, generate secure values for SECRET_KEY_BASE and VAULT_KEY:

# Generate SECRET_KEY_BASE
openssl rand -base64 64

# Generate VAULT_KEY
openssl rand -base64 32

Active-passive architecture

Sequin supports deployment in an active-passive configuration for high availability. In this setup:

  • One node operates as the active node, running all sinks
  • Additional nodes operate as passive (“hot standby”) nodes
  • All nodes can serve web traffic and API requests
  • If the active node fails, a passive node automatically promotes to active

Requirements for multi-node deployment:

  • All nodes must share:
    • The same Postgres database
    • The same Redis instance
    • Identical configuration
  • Nodes must be able to communicate directly with each other
  • Network latency between nodes should be minimal
  • Environment variables for Clustering configuration must be properly set

Sequin uses Postgres for node discovery and Redis for distributed locking and leader election.

Runtime requirements

Redis

Sequin requires Redis to be persistent. Redis alternatives like KeyDB are supported.