Skip to content

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 Solidus
    rails new mystore --database=postgresql
    cd mystore
    # Add Solidus to Gemfile
    gem 'solidus'
    gem 'solidus_auth_devise'
    # Install Solidus
    bin/rails generate solidus:install

    Create 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=production
    ENV RAILS_SERVE_STATIC_FILES=true
    ENV 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:

    VariableValue
    DATABASE_URLPostgreSQL connection string
    REDIS_URLRedis connection string
    SECRET_KEY_BASERails secret key
    RAILS_MASTER_KEYRails 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 PathRecommended SizePurpose
    /app/storage10 GB+Active Storage uploads
    /app/public/assets2 GBCompiled 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:

  1. General Settings: Store name, contact info, SEO settings
  2. Zones and Tax: Configure geographic zones and tax rates
  3. Shipping: Set up shipping methods and carriers
  4. Payment: Configure payment gateways
  5. Products: Add your product catalog

Payment Gateway Integration

Solidus supports many payment gateways through extensions:

  • Stripe: solidus_stripe gem
  • PayPal: solidus_paypal_commerce_platform gem
  • Braintree: solidus_braintree gem

Install the appropriate gem and configure via the admin panel.

Background Jobs

Solidus uses Sidekiq for background processing. Deploy a separate worker process:

Dockerfile.worker
FROM your-app-image
CMD ["bundle", "exec", "sidekiq"]

Additional Resources

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.