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
- Select HTTP as the traffic type
- Set the internal port to 80
Create Your Repository
Create a new GitHub repository with a Dockerfile for Sylius:
FROM sylius/standard:latest
ENV APP_ENV=prodENV 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:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
APP_ENV | prod |
APP_SECRET | Generate with openssl rand -hex 16 |
DATABASE_URL | Your database connection string |
MAILER_DSN | Your mail server DSN |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/var/www/html/public/media | 50 GB | Product images and uploads |
/var/www/html/var | 10 GB | Cache 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:
- Create the database schema
- Load fixtures (optional, for demo data)
- 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:
- Navigate to Configuration > Payment Methods
- Add payment gateways (Stripe, PayPal, etc.)
- Configure API credentials
- Enable for your channels
Shipping Configuration
Set up shipping methods:
- Navigate to Configuration > Shipping Methods
- Create shipping zones
- Define shipping methods and rates
- Configure shipping calculators
Additional Resources
- Sylius Official Website
- Sylius GitHub Repository
- Sylius Documentation
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
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.