Shopware 6 + MySQL + Elasticsearch
Enterprise e-commerce platform with advanced features.
Overview
Shopware 6 is a German-built open-source e-commerce platform designed for enterprise-grade online stores. Originally launched in 2000 and completely rebuilt from the ground up, Shopware 6 offers advanced features like headless commerce, progressive web app capabilities, and extensive API-first architecture. It competes directly with platforms like Magento and WooCommerce but focuses on providing superior user experience for both merchants and customers with its modern Vue.js-based administration interface and Symfony framework foundation.
This stack combines Shopware 6 with MySQL for transactional data storage, Elasticsearch for product search and catalog indexing, Redis for session management and caching, and NGINX as a high-performance web server. MySQL handles all product data, customer information, and order processing with ACID compliance, while Elasticsearch powers the advanced search functionality that modern e-commerce demands. Redis accelerates page load times by caching frequently accessed data and managing user sessions, and NGINX serves static assets efficiently while proxying dynamic requests to Shopware.
This configuration is ideal for medium to large online retailers who need scalable search capabilities, fast response times, and enterprise-grade reliability. E-commerce agencies, digital marketing companies, and businesses processing thousands of products with complex filtering requirements will benefit most from this stack. The combination provides the performance needed for high-traffic sales events, complex product catalogs, and multi-language storefronts that require sophisticated search and filtering capabilities.
Key Features
- Advanced product search with Elasticsearch faceted filtering and auto-suggestions
- MySQL 8.0 InnoDB storage engine with JSON field support for flexible product attributes
- Redis-powered shopping cart persistence and user session management
- Shopware 6 Sales Channel API for headless commerce and mobile app integration
- NGINX FastCGI caching with 2-hour TTL for improved page load performance
- Elasticsearch aggregations for real-time inventory filtering and category browsing
- Shopware Administration interface with Vue.js for modern store management
- Multi-language and multi-currency support with localized search indexing
Common Use Cases
- 1Fashion retailers with complex product variations, sizes, and color filtering
- 2B2B wholesale platforms requiring customer-specific pricing and catalog access
- 3Multi-brand online stores managing separate inventories and search indexes
- 4Digital agencies developing custom e-commerce solutions for enterprise clients
- 5Retailers migrating from Magento or WooCommerce seeking better performance
- 6Online marketplaces with thousands of products requiring fast search capabilities
- 7International e-commerce sites needing multi-language product search
Prerequisites
- Minimum 4GB RAM (2GB for Elasticsearch, 1GB for MySQL, 1GB for Shopware)
- Docker Engine 20.10+ and Docker Compose 2.0+ installed
- Port 80 available for NGINX web server access
- Basic understanding of Shopware 6 administration and store configuration
- Familiarity with MySQL database management for backup and maintenance
- Knowledge of Elasticsearch indexing concepts for search optimization
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 shopware: 3 image: shyim/shopware:latest4 environment: 5 - APP_ENV=prod6 - APP_SECRET=${APP_SECRET}7 - DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/shopware8 - ELASTICSEARCH_HOSTS=elasticsearch:92009 - REDIS_HOST=redis10 - SHOPWARE_HTTP_CACHE_ENABLED=111 - SHOPWARE_HTTP_DEFAULT_TTL=720012 volumes: 13 - shopware-data:/var/www/html14 depends_on: 15 - mysql16 - elasticsearch17 - redis18 networks: 19 - shopware-network20 restart: unless-stopped2122 nginx: 23 image: nginx:alpine24 volumes: 25 - ./nginx.conf:/etc/nginx/nginx.conf:ro26 - shopware-data:/var/www/html:ro27 ports: 28 - "80:80"29 depends_on: 30 - shopware31 networks: 32 - shopware-network33 restart: unless-stopped3435 mysql: 36 image: mysql:8.037 environment: 38 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}39 - MYSQL_DATABASE=shopware40 - MYSQL_USER=${MYSQL_USER}41 - MYSQL_PASSWORD=${MYSQL_PASSWORD}42 volumes: 43 - mysql-data:/var/lib/mysql44 networks: 45 - shopware-network46 restart: unless-stopped4748 elasticsearch: 49 image: elasticsearch:7.17.1050 environment: 51 - discovery.type=single-node52 - ES_JAVA_OPTS=-Xms512m -Xmx512m53 volumes: 54 - es-data:/usr/share/elasticsearch/data55 networks: 56 - shopware-network57 restart: unless-stopped5859 redis: 60 image: redis:alpine61 volumes: 62 - redis-data:/data63 networks: 64 - shopware-network65 restart: unless-stopped6667volumes: 68 shopware-data: 69 mysql-data: 70 es-data: 71 redis-data: 7273networks: 74 shopware-network: 75 driver: bridge.env Template
.env
1# Shopware 62APP_SECRET=your-app-secret-change-this3MYSQL_ROOT_PASSWORD=secure_root_password4MYSQL_USER=shopware5MYSQL_PASSWORD=secure_mysql_passwordUsage Notes
- 1Store at http://localhost
- 2Admin at http://localhost/admin
- 3Default admin: admin / shopware
- 4Elasticsearch for search
- 5Redis for caching
Individual Services(5 services)
Copy individual services to mix and match with your existing compose files.
shopware
shopware:
image: shyim/shopware:latest
environment:
- APP_ENV=prod
- APP_SECRET=${APP_SECRET}
- DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/shopware
- ELASTICSEARCH_HOSTS=elasticsearch:9200
- REDIS_HOST=redis
- SHOPWARE_HTTP_CACHE_ENABLED=1
- SHOPWARE_HTTP_DEFAULT_TTL=7200
volumes:
- shopware-data:/var/www/html
depends_on:
- mysql
- elasticsearch
- redis
networks:
- shopware-network
restart: unless-stopped
nginx
nginx:
image: nginx:alpine
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- shopware-data:/var/www/html:ro
ports:
- "80:80"
depends_on:
- shopware
networks:
- shopware-network
restart: unless-stopped
mysql
mysql:
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=shopware
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
volumes:
- mysql-data:/var/lib/mysql
networks:
- shopware-network
restart: unless-stopped
elasticsearch
elasticsearch:
image: elasticsearch:7.17.10
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms512m -Xmx512m
volumes:
- es-data:/usr/share/elasticsearch/data
networks:
- shopware-network
restart: unless-stopped
redis
redis:
image: redis:alpine
volumes:
- redis-data:/data
networks:
- shopware-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 shopware:5 image: shyim/shopware:latest6 environment:7 - APP_ENV=prod8 - APP_SECRET=${APP_SECRET}9 - DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/shopware10 - ELASTICSEARCH_HOSTS=elasticsearch:920011 - REDIS_HOST=redis12 - SHOPWARE_HTTP_CACHE_ENABLED=113 - SHOPWARE_HTTP_DEFAULT_TTL=720014 volumes:15 - shopware-data:/var/www/html16 depends_on:17 - mysql18 - elasticsearch19 - redis20 networks:21 - shopware-network22 restart: unless-stopped2324 nginx:25 image: nginx:alpine26 volumes:27 - ./nginx.conf:/etc/nginx/nginx.conf:ro28 - shopware-data:/var/www/html:ro29 ports:30 - "80:80"31 depends_on:32 - shopware33 networks:34 - shopware-network35 restart: unless-stopped3637 mysql:38 image: mysql:8.039 environment:40 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}41 - MYSQL_DATABASE=shopware42 - MYSQL_USER=${MYSQL_USER}43 - MYSQL_PASSWORD=${MYSQL_PASSWORD}44 volumes:45 - mysql-data:/var/lib/mysql46 networks:47 - shopware-network48 restart: unless-stopped4950 elasticsearch:51 image: elasticsearch:7.17.1052 environment:53 - discovery.type=single-node54 - ES_JAVA_OPTS=-Xms512m -Xmx512m55 volumes:56 - es-data:/usr/share/elasticsearch/data57 networks:58 - shopware-network59 restart: unless-stopped6061 redis:62 image: redis:alpine63 volumes:64 - redis-data:/data65 networks:66 - shopware-network67 restart: unless-stopped6869volumes:70 shopware-data:71 mysql-data:72 es-data:73 redis-data:7475networks:76 shopware-network:77 driver: bridge78EOF7980# 2. Create the .env file81cat > .env << 'EOF'82# Shopware 683APP_SECRET=your-app-secret-change-this84MYSQL_ROOT_PASSWORD=secure_root_password85MYSQL_USER=shopware86MYSQL_PASSWORD=secure_mysql_password87EOF8889# 3. Start the services90docker compose up -d9192# 4. View logs93docker 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/shopware-complete/run | bashTroubleshooting
- Elasticsearch circuit_breaker_exception: Increase ES_JAVA_OPTS memory allocation beyond -Xms512m -Xmx512m
- Shopware installation wizard shows database connection error: Verify MYSQL_USER and MYSQL_PASSWORD environment variables match
- Product search returns no results: Check if Elasticsearch indexes are built by running bin/console es:index:populate in Shopware container
- 502 Bad Gateway from NGINX: Ensure Shopware container is fully started before NGINX attempts proxying
- Redis connection timeout errors: Verify REDIS_HOST environment variable points to correct service name 'redis'
- MySQL access denied errors: Wait for MySQL initialization to complete before starting dependent services
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
Components
shopwaremysqlelasticsearchredisnginx
Tags
#shopware#ecommerce#enterprise#php#elasticsearch
Category
E-Commerce & BusinessAd Space
Shortcuts: C CopyF FavoriteD Download