Skip to main content
Lasso is configured via environment variables for runtime settings and YAML files for routing configuration. This page documents all available environment variables.

Core Configuration

Required and recommended settings for running Lasso.
string
required
Phoenix signing and encryption secret. Must be at least 64 bytes. Generate with mix phx.gen.secret.
Required in production. Omit in development (auto-generated).
string
default:"localhost"
Public hostname for URL generation. Set to your domain in production.
Required in production for correct URL generation in responses and redirects.
string
default:"false"
Set to true to start the HTTP server. Required for releases and production deployments.
integer
default:"4000"
HTTP listener port.
Useful for running multiple instances locally:
string
default:"https"
URL scheme for external access. Automatically set to https in production.
string
required
Unique, stable identifier for this node instance. Used for state partitioning (circuit breakers, metrics) via {provider_id, node_id} keys.
Convention: Use geographic region names when deploying one node per region (e.g., us-east-1, eu-west-1, ap-southeast-1).Required in production. Defaults to "local" in development.

Clustering

Optional configuration for multi-node clustering.
string
DNS name that resolves to all node IPs for automatic cluster discovery.
Both CLUSTER_DNS_QUERY and CLUSTER_NODE_BASENAME must be set for clustering to activate.
string
Erlang distribution node basename.
Nodes will be named <basename>@<ip> (e.g., lasso@10.0.1.5).

Clustering Example

Nodes poll DNS every 5 seconds and automatically join the cluster. See Deployment Guide for details.

Provider API Keys

API keys for RPC providers. Used in profile YAML via ${VAR_NAME} substitution.
string
dRPC API key. Get yours at https://drpc.org/
Use in profile:
string
Alchemy API key. Get yours at https://dashboard.alchemy.com/
Use in profile:
string
Lava Network API key. Get yours at https://gateway.lavanet.xyz/
string
1RPC API key. Get yours at https://www.1rpc.io/
string
Chainstack API key. Get yours at https://console.chainstack.com/
string
NodeReal API key. Get yours at https://nodereal.io/

Custom API Keys

You can use any environment variable in your profile configurations:
Important: Unresolved variables crash at startup to prevent silent misconfiguration.

Optional Settings

boolean
default:"true"
Enable VM metrics collection (memory, CPU, process counts).
Set to false in production SaaS environments where VM metrics aren’t relevant.
string
PostgreSQL connection URL. Only used in cloud/SaaS deployments for persistent storage.
Not required for standalone deployments. Lasso uses in-memory ETS tables by default.

.env File Support

Lasso loads environment variables from a .env file in the project root if present:
Precedence: System environment variables override .env file values.

Example .env File

Production Checklist

Before deploying to production:
  • SECRET_KEY_BASE set (64+ bytes)
  • PHX_HOST set to public hostname
  • PHX_SERVER=true set
  • LASSO_NODE_ID set to unique, stable value
  • PORT configured for your infrastructure
  • API keys set for all BYOK providers in profiles
  • Environment variable substitution tested (startup should crash on unresolved vars)
  • Keys stored securely (secrets manager, not version control)
  • CLUSTER_DNS_QUERY set and resolving correctly
  • CLUSTER_NODE_BASENAME set
  • Erlang distribution ports open between nodes (4369 + epmd range)
  • Each node has unique LASSO_NODE_ID
  • Health check monitoring GET /api/health
  • TLS terminated at reverse proxy/load balancer
  • Structured JSON log drain configured
  • Rate limits configured in profile frontmatter

Development vs Production

Development

Run with:

Production

Run with:

Environment Variable Precedence

  1. System environment variables (highest priority)
  2. .env file (loaded at startup)
  3. Application defaults (config/runtime.exs)
Example:

Next Steps

Deployment Guide

Learn how to deploy Lasso in production

Profile Configuration

Configure chains and routing policies