Skip to content

Deploying Sylius

Introduction

Sylius is an open-source eCommerce platform built on Symfony, designed for developers who need a flexible, customizable solution. Unlike monolithic eCommerce platforms, Sylius provides a modular architecture that allows you to build exactly the store you need.

Key highlights of Sylius:

  • Built on Symfony: Leverages the power of the Symfony framework
  • Modular Architecture: Use only the components you need
  • API-First: Full REST and GraphQL API support
  • Multi-Channel: Sell on web, mobile, and marketplaces
  • Multi-Currency: Support for multiple currencies and locales
  • Customizable: Extend every aspect of the platform
  • Admin Panel: Modern, responsive administration interface
  • Plugin System: Extend functionality with community plugins
  • Headless Ready: Use as a headless commerce backend
  • Enterprise Features: Promotions, shipping, taxes, and inventory

This guide walks through deploying Sylius on Klutch.sh using Docker.

Why Deploy Sylius on Klutch.sh

Deploying Sylius on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Sylius without complex orchestration.

Persistent Storage: Attach persistent volumes for product images and user uploads.

HTTPS by Default: Secure eCommerce transactions with automatic SSL certificates.

GitHub Integration: Connect your configuration repository for automatic redeployments.

Prerequisites

Before deploying Sylius on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Sylius configuration
  • Basic familiarity with Docker and containerization concepts
  • A MySQL or PostgreSQL database
  • (Optional) A payment gateway account (Stripe, PayPal, etc.)

Deploying Sylius on Klutch.sh

    Create Your Repository

    Create a new GitHub repository with a Dockerfile for Sylius:

    FROM sylius/standard:latest
    ENV APP_ENV=prod
    ENV APP_SECRET=${APP_SECRET}
    ENV DATABASE_URL=${DATABASE_URL}
    ENV MAILER_DSN=${MAILER_DSN}
    EXPOSE 80
    VOLUME ["/var/www/html/public/media", "/var/www/html/var"]

    Push to GitHub

    Initialize and push your repository to GitHub with your Dockerfile.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project.

    Create a New App

    Within your project, create a new app and connect your GitHub repository.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    APP_ENVprod
    APP_SECRETGenerate with openssl rand -hex 16
    DATABASE_URLYour database connection string
    MAILER_DSNYour mail server DSN

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /var/www/html/public/media50 GBProduct images and uploads
    /var/www/html/var10 GBCache and logs

    Deploy Your Application

    Click Deploy to start the build process.

    Access Sylius

    Once deployment completes, access your Sylius store at your app URL. Access the admin panel at /admin.

Configuration

Initial Setup

After deployment, run the installation commands:

  1. Create the database schema
  2. Load fixtures (optional, for demo data)
  3. Create an admin user

Admin Panel

Access the admin panel at https://your-store.klutch.sh/admin:

  • Manage products and categories
  • Process orders
  • Configure shipping and payments
  • Set up promotions and discounts

Payment Integration

Configure payment methods:

  1. Navigate to Configuration > Payment Methods
  2. Add payment gateways (Stripe, PayPal, etc.)
  3. Configure API credentials
  4. Enable for your channels

Shipping Configuration

Set up shipping methods:

  1. Navigate to Configuration > Shipping Methods
  2. Create shipping zones
  3. Define shipping methods and rates
  4. Configure shipping calculators

Additional Resources

Conclusion

Deploying Sylius on Klutch.sh gives you a powerful, customizable eCommerce platform with automatic builds, persistent storage, and secure HTTPS access. Build the exact online store you need with Symfony’s flexibility and Sylius’s commerce features.