Sylius
Symfony-based e-commerce framework.
Overview
Sylius is a modern, component-based e-commerce framework built on Symfony, designed for developers who need a flexible alternative to monolithic platforms like Magento or WooCommerce. Created in 2011 by Paweł Jędrzejewski, Sylius follows Symfony's philosophy of reusable components and clean architecture, allowing developers to build custom e-commerce solutions without being locked into rigid structures. Unlike traditional e-commerce platforms, Sylius provides a headless-first approach with API Platform integration, making it ideal for omnichannel retail strategies.
This stack combines Sylius with MySQL 8.0 and Redis to create a production-ready e-commerce environment. MySQL serves as the primary data store for product catalogs, orders, customers, and inventory management, while Redis handles session storage, caching layer for product queries, and real-time features like cart persistence. The combination leverages MySQL's ACID compliance for transactional integrity during checkout processes and Redis's sub-millisecond response times for shopping cart operations and product recommendation caching.
This configuration targets mid-to-large scale e-commerce operations, digital agencies building custom storefronts, and businesses requiring headless commerce capabilities. The Symfony foundation makes it particularly attractive to PHP development teams already familiar with modern PHP practices, while the API-first architecture supports mobile apps, progressive web apps, and third-party integrations that traditional e-commerce platforms struggle to handle efficiently.
Key Features
- API Platform powered REST and GraphQL APIs for headless commerce implementations
- Component-based architecture allowing selective feature implementation without bloat
- Advanced promotion engine with rule-based discounts, coupons, and cart promotions
- Multi-channel support for managing different storefronts from single admin panel
- Flexible product variant system supporting configurable products with attributes
- Built-in inventory tracking with stock management and reservation system
- Taxation system with zone-based tax calculations and configurable tax categories
- Payment abstraction layer supporting multiple payment gateways through Payum integration
Common Use Cases
- 1Digital agencies building custom e-commerce solutions for clients requiring unique designs
- 2B2B marketplaces needing complex pricing tiers, customer groups, and bulk ordering features
- 3Fashion retailers managing product variants with size, color, and seasonal collections
- 4Multi-brand retailers operating separate storefronts with shared inventory management
- 5Businesses implementing headless commerce with React, Vue, or mobile app frontends
- 6Companies requiring extensive API integrations with ERP, CRM, or PIM systems
- 7Subscription commerce platforms needing custom billing cycles and recurring payment handling
Prerequisites
- Docker Engine 20.10+ and Docker Compose V2 for container orchestration
- 4GB+ RAM recommended for MySQL InnoDB buffer pool and Redis memory allocation
- PHP 8.1+ knowledge for Sylius customization and Symfony framework concepts
- Port 8080 available for Sylius web interface and port 3306 free for MySQL connections
- Basic understanding of Twig templating engine for storefront customization
- Familiarity with Doctrine ORM for entity management and database operations
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 sylius: 3 image: sylius/sylius:latest4 container_name: sylius5 restart: unless-stopped6 environment: 7 APP_ENV: prod8 DATABASE_URL: mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME}9 volumes: 10 - sylius_data:/srv/sylius/public11 ports: 12 - "8080:80"13 depends_on: 14 - mysql15 - redis16 networks: 17 - sylius1819 mysql: 20 image: mysql:8.021 container_name: sylius-mysql22 environment: 23 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}24 MYSQL_DATABASE: ${DB_NAME}25 MYSQL_USER: ${DB_USER}26 MYSQL_PASSWORD: ${DB_PASSWORD}27 volumes: 28 - mysql_data:/var/lib/mysql29 networks: 30 - sylius3132 redis: 33 image: redis:alpine34 container_name: sylius-redis35 networks: 36 - sylius3738volumes: 39 sylius_data: 40 mysql_data: 4142networks: 43 sylius: 44 driver: bridge.env Template
.env
1DB_ROOT_PASSWORD=rootpassword2DB_NAME=sylius3DB_USER=sylius4DB_PASSWORD=changemeUsage Notes
- 1Docs: https://docs.sylius.com/
- 2Access at http://localhost:8080 - built on Symfony PHP framework
- 3Admin at /admin, default: sylius@example.com / sylius
- 4Component-based architecture - use only what you need
- 5API Platform powered REST API for headless commerce
- 6Plugins marketplace for payments, shipping, promotions
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
sylius
sylius:
image: sylius/sylius:latest
container_name: sylius
restart: unless-stopped
environment:
APP_ENV: prod
DATABASE_URL: mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME}
volumes:
- sylius_data:/srv/sylius/public
ports:
- "8080:80"
depends_on:
- mysql
- redis
networks:
- sylius
mysql
mysql:
image: mysql:8.0
container_name: sylius-mysql
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- sylius
redis
redis:
image: redis:alpine
container_name: sylius-redis
networks:
- sylius
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 sylius:5 image: sylius/sylius:latest6 container_name: sylius7 restart: unless-stopped8 environment:9 APP_ENV: prod10 DATABASE_URL: mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME}11 volumes:12 - sylius_data:/srv/sylius/public13 ports:14 - "8080:80"15 depends_on:16 - mysql17 - redis18 networks:19 - sylius2021 mysql:22 image: mysql:8.023 container_name: sylius-mysql24 environment:25 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}26 MYSQL_DATABASE: ${DB_NAME}27 MYSQL_USER: ${DB_USER}28 MYSQL_PASSWORD: ${DB_PASSWORD}29 volumes:30 - mysql_data:/var/lib/mysql31 networks:32 - sylius3334 redis:35 image: redis:alpine36 container_name: sylius-redis37 networks:38 - sylius3940volumes:41 sylius_data:42 mysql_data:4344networks:45 sylius:46 driver: bridge47EOF4849# 2. Create the .env file50cat > .env << 'EOF'51DB_ROOT_PASSWORD=rootpassword52DB_NAME=sylius53DB_USER=sylius54DB_PASSWORD=changeme55EOF5657# 3. Start the services58docker compose up -d5960# 4. View logs61docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/sylius/run | bashTroubleshooting
- Sylius returns 500 error on startup: Check DATABASE_URL environment variable format and ensure MySQL container is fully initialized before Sylius starts
- Admin panel shows 'Access Denied' with correct credentials: Clear Redis cache using 'docker exec sylius-redis redis-cli FLUSHALL' and restart Sylius container
- Product images not displaying: Verify sylius_data volume is properly mounted and web server has write permissions to public/media directory
- MySQL connection refused errors: Wait 30-60 seconds after 'docker-compose up' as MySQL 8.0 initialization takes time, especially on first run
- Cart contents disappearing between sessions: Ensure Redis container is running and Sylius session configuration points to Redis server
- Composer memory exhausted during asset installation: Add COMPOSER_MEMORY_LIMIT=-1 environment variable to Sylius service definition
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download