Deploying Solidus
Introduction
Solidus is a free, open-source eCommerce platform built on Ruby on Rails. As a fork of the original Spree Commerce, Solidus focuses on stability, flexibility, and developer experience. It powers online stores ranging from small boutiques to large enterprises, offering a modular architecture that can be customized for virtually any eCommerce use case.
Unlike monolithic eCommerce platforms, Solidus embraces a composable approach where each component can be modified, replaced, or extended. This makes it ideal for businesses with unique requirements or developers who need complete control over their commerce stack.
Key features of Solidus include:
- Modular Architecture: Core, frontend, backend, and API as separate components
- Product Management: Variants, options, properties, and inventory tracking
- Order Processing: Flexible checkout flow with extensible states
- Payment Processing: Multiple payment gateway integrations
- Promotions Engine: Complex discount rules and coupon codes
- Tax Calculation: Configurable tax categories and zone-based rates
- Shipping Methods: Multiple carriers with rate calculation
- Multi-Currency: International sales with currency conversion
- Admin Dashboard: Full-featured backend for store management
- REST API: Headless commerce capabilities
- Extensions Ecosystem: Community extensions for added functionality
- Active Development: Regular releases and security updates
- Open Source: BSD-3-Clause license
This guide walks through deploying Solidus on Klutch.sh using Docker.
Why Deploy Solidus on Klutch.sh
Deploying Solidus on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles container builds and Rails deployments.
Complete Control: Full ownership of your eCommerce platform and data.
HTTPS by Default: Secure transactions with automatic SSL certificates.
Persistent Storage: Product images and data survive restarts.
Scalable Resources: Handle traffic spikes and growth.
Custom Domains: Professional storefront on your domain.
Always Available: 24/7 uptime for your online store.
Prerequisites
Before deploying Solidus on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Solidus store
- A PostgreSQL database
- A Redis instance (for background jobs)
- Basic familiarity with Ruby on Rails and Docker
- (Optional) Payment gateway API credentials
Deploying Solidus on Klutch.sh
Create a New Solidus Project
Start by creating a new Solidus project locally:
# Create a new Rails app with Solidusrails new mystore --database=postgresqlcd mystore
# Add Solidus to Gemfilegem 'solidus'gem 'solidus_auth_devise'
# Install Solidusbin/rails generate solidus:installCreate Your Dockerfile
Create a Dockerfile in your project root:
FROM ruby:3.2-slim
RUN apt-get update && apt-get install -y \ build-essential \ libpq-dev \ nodejs \ yarn \ git \ libvips \ && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Gemfile Gemfile.lock ./RUN bundle install --deployment --without development test
COPY . .
RUN bundle exec rails assets:precompile
ENV RAILS_ENV=productionENV RAILS_SERVE_STATIC_FILES=trueENV RAILS_LOG_TO_STDOUT=true
EXPOSE 3000
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]Push Your Repository to GitHub
Initialize git, commit your code, and push to GitHub.
Create a PostgreSQL Database
Set up a PostgreSQL database for your store.
Set Up Redis
Configure a Redis instance for Sidekiq background jobs.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project.
Create a New App
Create a new app and connect your GitHub repository.
Configure Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
DATABASE_URL | PostgreSQL connection string |
REDIS_URL | Redis connection string |
SECRET_KEY_BASE | Rails secret key |
RAILS_MASTER_KEY | Rails credentials key |
Configure HTTP Settings
Set the traffic type to HTTP and configure the internal port to 3000.
Attach Persistent Storage
Add persistent volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/app/storage | 10 GB+ | Active Storage uploads |
/app/public/assets | 2 GB | Compiled assets |
Deploy Your Application
Click Deploy to start the build process.
Run Database Migrations
After deployment, run database migrations and seed data.
Create Admin User
Access the Rails console to create your admin user.
Access Your Store
Navigate to your app URL to see your storefront, and /admin for the backend.
Configuring Your Store
After deployment, configure your store through the admin panel:
- General Settings: Store name, contact info, SEO settings
- Zones and Tax: Configure geographic zones and tax rates
- Shipping: Set up shipping methods and carriers
- Payment: Configure payment gateways
- Products: Add your product catalog
Payment Gateway Integration
Solidus supports many payment gateways through extensions:
- Stripe:
solidus_stripegem - PayPal:
solidus_paypal_commerce_platformgem - Braintree:
solidus_braintreegem
Install the appropriate gem and configure via the admin panel.
Background Jobs
Solidus uses Sidekiq for background processing. Deploy a separate worker process:
FROM your-app-imageCMD ["bundle", "exec", "sidekiq"]Additional Resources
- Solidus GitHub Repository
- Solidus Official Website
- Solidus Guides
- Solidus Extensions
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying Solidus on Klutch.sh gives you a powerful, flexible eCommerce platform with complete control over your code and data. The modular architecture means you can customize every aspect of your store, from checkout flow to admin interface.
For developers and businesses seeking a robust, open-source alternative to hosted eCommerce platforms, Solidus provides enterprise-grade features with the freedom to build exactly what you need.