
Deploy Spree eCommerce
Production-ready Spree eCommerce with admin & storefront
Postgres
railwayapp-templates/postgres-ssl:17
Just deployed
/var/lib/postgresql/data
Redis
redis:8.2.1
Just deployed
/data
Spree
youssefsiam38/spree_starter
Just deployed
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
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 domainMAIL_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 checkoutSCREENSHOT_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_BASEandSPREE_AUTH_SECRET_KEY - Static asset serving optimized for production
Post-Deployment Steps
-
Access Admin Panel: Navigate to
https://your-domain.railway.app/admin -
Login: Use the
ADMIN_EMAILandADMIN_PASSWORDyou configured during deployment -
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
-
Configure Shipping Methods:
- Settings → Shipping Methods
- Add your shipping zones, carriers, and rates
-
Setup Tax Rates:
- Settings → Tax Rates
- Configure tax categories and jurisdictions
-
Customize Store Settings:
- Settings → Stores → Edit your store
- Set store name, URL, SEO settings, and currencies
-
Configure Email Templates:
- Settings → Emails
- Customize transactional email templates for your brand
-
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.
Template Content
Redis
redis:8.2.1ADMIN_EMAIL
REQUIRED: Admin user email address (will be created on first deployment)
ADMIN_PASSWORD
REQUIRED: Secure admin password (minimum 6 characters)