Skip to content

Environment Variables

Your application receives configuration through environment variables. SKE assembles these from multiple sources with a defined precedence order.

  1. Secrets — set via ske secret set, stored encrypted in your cloud provider. These take highest precedence.
  2. ske.yml env block — environment-specific variables defined in your config file. Good for non-sensitive, environment-varying config.
  3. Runtime defaults — SKE sets standard variables for the runtime (database connection strings, cache endpoints, queue URLs) based on your provisioned infrastructure.
  4. Framework defaults — the Laravel runtime sets sensible defaults like LOG_CHANNEL=stderr and SESSION_DRIVER=cookie.

Secrets override everything. If you set DB_HOST as a secret and it also appears in ske.yml or as a runtime default, the secret value wins.

Secrets > ske.yml env > Runtime defaults > Framework defaults
name: my-app
environments:
production:
env:
APP_DEBUG: "false"
CACHE_DRIVER: "redis"
QUEUE_CONNECTION: "sqs"
staging:
env:
APP_DEBUG: "true"
CACHE_DRIVER: "array"

These are committed to version control, so don’t put sensitive values here. Use secrets for anything that should stay private.

SKE automatically sets environment variables based on your provisioned infrastructure:

Variable Source Example
DB_HOST Attached database my-db.abc123.us-east-1.rds.amazonaws.com
DB_PORT Attached database 3306
DB_DATABASE Attached database my_app
DB_USERNAME Attached database ske_admin
DB_PASSWORD Attached database (auto-generated)
CACHE_HOST Attached cache my-cache.abc123.cache.amazonaws.com
CACHE_PORT Attached cache 6379
SQS_PREFIX Queue configuration https://sqs.us-east-1.amazonaws.com/123456789012
SQS_QUEUE Queue configuration my-app-production-default

These are set automatically when you attach a database, cache, or configure queues for an environment. You don’t need to set them manually.

Use a secret when… Use ske.yml env when…
The value is sensitive (passwords, API keys) The value is not sensitive
The value differs between local and deployed The value is tied to the environment config
The value should not be in version control The value should be reviewed in PRs
The value changes independently of deploys The value changes with code
Terminal window
ske secret set APP_KEY
ske secret set DB_PASSWORD
ske secret set MAIL_PASSWORD
ske secret set AWS_ACCESS_KEY_ID
ske secret set AWS_SECRET_ACCESS_KEY
ske secret set STRIPE_SECRET
ske secret set SENTRY_DSN