---
title: "Deploy Spree eCommerce"
description: "Production-ready Spree eCommerce with admin & storefront"
category: "Other"
url: https://railway.com/deploy/spree-ecommerce-1
---

# Deploy Spree eCommerce

Production-ready Spree eCommerce with admin & storefront

**[Deploy Spree eCommerce on Railway](https://railway.com/template/spree-ecommerce-1)**

- **Creator:** Youssef Siam
- **Category:** Other
- **Total deploys:** 55

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Spree https://devicons.railway.app/spree

- **Source:** youssefsiam38/spree_starter
- **Public domain:** Yes

## Documentation

# Deploy and Host Spree eCommerce on Railway

Spree Commerce is an open-source, API-first eCommerce platform built with Ruby on Rails. It provides a complete, modular solution for building modern online stores with multi-vendor marketplace capabilities, multi-currency support, and customizable product catalogs. Trusted by major brands like New England Patriots, Craftsman, and Blue Bottle Coffee.

## About Hosting Spree eCommerce

Hosting Spree eCommerce requires a Ruby on Rails environment with PostgreSQL database support and Redis for caching and background job processing. The platform is highly scalable and can handle everything from small single-store setups to large multi-tenant marketplace deployments.

Spree's modular architecture allows for easy customization and extension through gems, while its RESTful API enables headless commerce implementations. The platform includes a comprehensive admin dashboard for managing products, orders, customers, and shipping, making it production-ready out of the box with enterprise-grade security and performance optimizations.

## Common Use Cases

**Multi-vendor Marketplaces:** Build platforms where multiple sellers can list and sell products with individual storefronts and payment processing

**B2B and B2C eCommerce Stores:** Create professional online stores with advanced product catalogs, customer segmentation, and custom pricing

**Multi-tenant SaaS Solutions:** Deploy white-label eCommerce solutions for clients with separate branding, product catalogs, and configurations per tenant

**Headless Commerce:** Use Spree's API-first architecture to power modern frontend frameworks like Next.js, Vue, or React

## Dependencies for Spree eCommerce Hosting

**PostgreSQL Database:** Primary data store for products, orders, customers, and store configuration

**Redis:** Required for caching, session management, and background job processing via Sidekiq

**Ruby 3.3+:** Runtime environment for the Rails application

**Rails 8+:** Web application framework powering Spree

**Image Processing Libraries:** libvips for product image manipulation and thumbnail generation

### Deployment Dependencies

- [Spree Commerce Documentation](https://spreecommerce.org/docs)
- [Spree GitHub Repository](https://github.com/spree/spree)
- [Spree Quickstart Guide](https://spreecommerce.org/docs/developer/getting-started/quickstart)
- [Spree Community Slack](https://slack.spreecommerce.org)

## Implementation Details

### Enterprise-Grade Security Configuration

This template implements production-ready security best practices from day one:

- **Secure Credential Management:** Admin credentials must be explicitly set during deployment - no default passwords
- **Deployment Validation:** Container fails fast with clear error messages if required security variables are missing
- **Session Management:** Configurable session timeouts with secure cookie handling


### Critical Variables (Must Be Set)

**ADMIN_EMAIL** - Your admin user email address. This account will be created automatically on first deployment

**ADMIN_PASSWORD** - Secure password for admin access (minimum 6 characters, recommend 12+ with mixed characters)

### Recommended Production Configuration

**Email Delivery (SendGrid):**
- `SENDGRID_API_KEY` - For transactional emails (order confirmations, password resets)
- `SENDGRID_DOMAIN` - Your verified sender domain
- `MAIL_FROM_ADDRESS` - Customize the "from" address for emails

**Error Monitoring (Sentry):**
- `SENTRY_DSN` - For production error tracking and performance monitoring

**Enhanced Features:**
- `GOOGLE_PLACES_API_KEY` - Enables address autocomplete during checkout
- `SCREENSHOT_API_TOKEN` - Automated screenshot generation for products/pages

### Auto-Configured Services

Railway automatically configures the following:
- PostgreSQL database with SSL support and connection pooling
- Redis for caching and Sidekiq background job processing
- Secrets generation for `SECRET_KEY_BASE` and `SPREE_AUTH_SECRET_KEY`
- Static asset serving optimized for production

### Post-Deployment Steps

1. **Access Admin Panel:** Navigate to `https://your-domain.railway.app/admin`

2. **Login:** Use the `ADMIN_EMAIL` and `ADMIN_PASSWORD` you configured during deployment

3. **Configure Payment Gateways:**
   - Settings → Payments → Add Payment Method
   - Stripe, PayPal, and other gateways are configured here (not via environment variables)
   - This allows multi-store deployments with different payment processors per store

4. **Configure Shipping Methods:**
   - Settings → Shipping Methods
   - Add your shipping zones, carriers, and rates

5. **Setup Tax Rates:**
   - Settings → Tax Rates
   - Configure tax categories and jurisdictions

6. **Customize Store Settings:**
   - Settings → Stores → Edit your store
   - Set store name, URL, SEO settings, and currencies

7. **Configure Email Templates:**
   - Settings → Emails
   - Customize transactional email templates for your brand

8. **Add Products:**
   - Products → New Product
   - Add your product catalog with images, variants, and pricing

### Optional Integrations

**Marketing & Analytics:**
- **Klaviyo:** Configure in Settings → Klaviyo (email marketing & automation)
- **Google Analytics 4:** Built-in integration for ecommerce tracking

**Payment Methods:**
- **Stripe:** Credit cards, Apple Pay, Google Pay, Buy Now Pay Later
- **PayPal Checkout:** PayPal, Venmo
- Configure API keys post-deployment via admin dashboard

## Why Deploy Spree eCommerce on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Spree eCommerce on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway Advantages for Spree

**Zero-Configuration Database:** PostgreSQL with automatic backups and SSL encryption

**Built-in Redis:** Caching and background job processing without additional setup

**Automatic SSL:** HTTPS enabled by default with managed certificates

**Environment Management:** Secure secret storage and easy environment variable configuration

**Persistent Volumes:** Reliable file storage for product images and uploads

**CI/CD Pipeline:** Automatic deployments from Git with zero downtime

**Monitoring Included:** Built-in metrics for application performance and resource usage

**One-Click Deployment:** From code to production in minutes with this template

Deploy your enterprise-grade eCommerce store today with production-ready security, scalability, and all the integrations you need to succeed.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/spree-ecommerce-1
