docker.recipes

Shopware

advanced

Open-source headless commerce platform.

Overview

Shopware is a modern, German-born e-commerce platform that has evolved from a traditional monolithic system into a powerful headless commerce solution. Built with PHP and Symfony, Shopware provides both traditional storefront capabilities and headless API-first architecture, making it particularly attractive for enterprise retailers who need flexibility in their frontend implementations. The platform emphasizes developer experience with its plugin system, comprehensive APIs, and modern architecture patterns. This Docker stack combines Shopware's production-ready container with MySQL 8.0 for transactional data storage and Elasticsearch 7.17 for advanced search capabilities. MySQL handles all product catalogs, customer data, orders, and configuration while Elasticsearch powers the sophisticated product search, filtering, and recommendation features that modern e-commerce demands. The integration between these components creates a robust foundation where Shopware automatically syncs product data to Elasticsearch for lightning-fast search responses while maintaining data consistency in MySQL. This configuration is ideal for businesses moving from platforms like Magento or WooCommerce who need enterprise-grade performance, developers building custom storefronts using Shopware's Store API, and organizations implementing omnichannel commerce strategies. The headless capabilities combined with Elasticsearch's analytics features make this stack particularly valuable for retailers requiring advanced personalization and search-driven shopping experiences.

Key Features

  • Shopware Store API and Admin API for complete headless commerce implementation
  • MySQL InnoDB storage with ACID compliance for reliable order and inventory management
  • Elasticsearch full-text search with relevance scoring for advanced product discovery
  • Shopware App System enabling custom plugins and third-party integrations
  • Shopware Flow Builder for automated business processes and customer journeys
  • Elasticsearch aggregations powering dynamic product filtering and faceted search
  • MySQL JSON data type support for flexible product variant and custom field storage
  • Shopware Shopping Experiences visual page builder for content management

Common Use Cases

  • 1Mid-size retailers migrating from Magento seeking better developer experience and performance
  • 2B2B companies needing complex pricing rules, customer groups, and procurement workflows
  • 3Agencies building custom React or Vue.js storefronts using Shopware's headless APIs
  • 4Multi-brand retailers requiring separate storefronts with shared inventory and customer data
  • 5Fashion and electronics retailers needing advanced product search with filters and recommendations
  • 6International businesses requiring multi-language, multi-currency, and multi-domain capabilities
  • 7Marketplace operators building vendor management and commission tracking systems

Prerequisites

  • Minimum 6GB RAM (2GB for Elasticsearch, 1GB for MySQL, 2GB for Shopware, plus system overhead)
  • Docker Engine 20.10+ and Docker Compose v2 for proper container orchestration
  • Available ports 8080 for Shopware storefront and admin panel access
  • Basic understanding of PHP e-commerce platforms and Symfony framework concepts
  • Knowledge of MySQL database administration for backup and performance tuning
  • Familiarity with Elasticsearch concepts for search optimization and index management

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: shopware/production:latest
4 container_name: shopware
5 restart: unless-stopped
6 environment:
7 DATABASE_URL: mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME}
8 APP_URL: http://localhost:8080
9 ELASTICSEARCH_HOSTS: elasticsearch:9200
10 volumes:
11 - shopware_data:/var/www/html
12 ports:
13 - "8080:80"
14 depends_on:
15 - mysql
16 - elasticsearch
17 networks:
18 - shopware
19
20 mysql:
21 image: mysql:8.0
22 container_name: shopware-mysql
23 environment:
24 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
25 MYSQL_DATABASE: ${DB_NAME}
26 MYSQL_USER: ${DB_USER}
27 MYSQL_PASSWORD: ${DB_PASSWORD}
28 volumes:
29 - mysql_data:/var/lib/mysql
30 networks:
31 - shopware
32
33 elasticsearch:
34 image: elasticsearch:7.17.0
35 container_name: shopware-es
36 environment:
37 - discovery.type=single-node
38 volumes:
39 - es_data:/usr/share/elasticsearch/data
40 networks:
41 - shopware
42
43volumes:
44 shopware_data:
45 mysql_data:
46 es_data:
47
48networks:
49 shopware:
50 driver: bridge

.env Template

.env
1DB_ROOT_PASSWORD=rootpassword
2DB_NAME=shopware
3DB_USER=shopware
4DB_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://docs.shopware.com/
  2. 2Access storefront at http://localhost:8080, admin at /admin
  3. 3Default admin: admin / shopware (change immediately)
  4. 4Headless Store API and Admin API for integrations
  5. 5App system for plugins, flows for automation
  6. 6Enterprise features in commercial editions

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

shopware
shopware:
  image: shopware/production:latest
  container_name: shopware
  restart: unless-stopped
  environment:
    DATABASE_URL: mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME}
    APP_URL: http://localhost:8080
    ELASTICSEARCH_HOSTS: elasticsearch:9200
  volumes:
    - shopware_data:/var/www/html
  ports:
    - "8080:80"
  depends_on:
    - mysql
    - elasticsearch
  networks:
    - shopware
mysql
mysql:
  image: mysql:8.0
  container_name: shopware-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:
    - shopware
elasticsearch
elasticsearch:
  image: elasticsearch:7.17.0
  container_name: shopware-es
  environment:
    - discovery.type=single-node
  volumes:
    - es_data:/usr/share/elasticsearch/data
  networks:
    - shopware

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 shopware:
5 image: shopware/production:latest
6 container_name: shopware
7 restart: unless-stopped
8 environment:
9 DATABASE_URL: mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_NAME}
10 APP_URL: http://localhost:8080
11 ELASTICSEARCH_HOSTS: elasticsearch:9200
12 volumes:
13 - shopware_data:/var/www/html
14 ports:
15 - "8080:80"
16 depends_on:
17 - mysql
18 - elasticsearch
19 networks:
20 - shopware
21
22 mysql:
23 image: mysql:8.0
24 container_name: shopware-mysql
25 environment:
26 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
27 MYSQL_DATABASE: ${DB_NAME}
28 MYSQL_USER: ${DB_USER}
29 MYSQL_PASSWORD: ${DB_PASSWORD}
30 volumes:
31 - mysql_data:/var/lib/mysql
32 networks:
33 - shopware
34
35 elasticsearch:
36 image: elasticsearch:7.17.0
37 container_name: shopware-es
38 environment:
39 - discovery.type=single-node
40 volumes:
41 - es_data:/usr/share/elasticsearch/data
42 networks:
43 - shopware
44
45volumes:
46 shopware_data:
47 mysql_data:
48 es_data:
49
50networks:
51 shopware:
52 driver: bridge
53EOF
54
55# 2. Create the .env file
56cat > .env << 'EOF'
57DB_ROOT_PASSWORD=rootpassword
58DB_NAME=shopware
59DB_USER=shopware
60DB_PASSWORD=changeme
61EOF
62
63# 3. Start the services
64docker compose up -d
65
66# 4. View logs
67docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/shopware/run | bash

Troubleshooting

  • Shopware installation wizard fails: Ensure DATABASE_URL format is exactly mysql://user:password@mysql:3306/database and MySQL is fully started
  • Elasticsearch connection refused errors: Verify Elasticsearch container has enough memory and set ES_JAVA_OPTS="-Xms1g -Xmx1g" environment variable
  • Product search returns no results: Check Shopware admin under Settings > Extensions > Shopware Search to rebuild Elasticsearch indices
  • MySQL connection timeout during setup: Add 'wait_timeout=28800' to MySQL configuration and ensure containers start in correct dependency order
  • Shopware admin panel shows 500 errors: Check PHP memory limit in production image and verify all required PHP extensions are loaded
  • Elasticsearch cluster health yellow/red: Increase vm.max_map_count on Docker host with 'sysctl -w vm.max_map_count=262144'

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