Required
These two variables are all a production deployment strictly needs:
You’ll almost always want to set
RAILS_HOST too — without it, generated URLs point at localhost.
URLs and Hosts
RAILS_HOST is the canonical public host of your deployment. URLs Spree generates outside a request context use it — links in emails, webhook payloads, and image/attachment URLs in API responses (for the latter, CDN_HOST takes precedence when set).
Generated URLs use
https unless both RAILS_FORCE_SSL and RAILS_ASSUME_SSL are set to false (see SSL).
Web Server
Background Jobs
Background jobs (emails, image processing, webhooks, imports) run inside the web container by default — no extra service needed. See Background Jobs for how this works and when to split out a dedicated worker.Email (SMTP)
Spree works with any SMTP provider (Resend, Postmark, Mailgun, SendGrid, Amazon SES, etc.). SetSMTP_HOST to enable email delivery — when not set, production email delivery is disabled (in development, emails are captured by Mailpit at http://localhost:8025 instead of being sent). See Emails for the full guide.
Links in emails use the host configured via
RAILS_HOST.
Application
File Storage (S3 / Cloudflare R2)
By default, uploaded files (product images, assets) are stored on the local filesystem. Set the appropriate credentials to use cloud storage instead — Spree auto-detects the provider based on which credentials are present. See Asset Storage for the full guide.Amazon S3
Cloudflare R2
Search (Meilisearch)
Optional. When configured, Spree uses Meilisearch for product search, filtering, and faceted navigation instead of SQL.
After setting these, enable the provider and reindex:
Error Tracking (Sentry)
SSL
By default, Spree assumes it runs behind an SSL-terminating reverse proxy or load balancer. Set these tofalse if running without SSL (e.g., local development or behind a proxy that doesn’t do SSL termination).
Local Development
These variables are used when running theserver/ app locally (not via DATABASE_URL):

