PrestaShop E-commerce
PrestaShop with MySQL and Elasticsearch.
Overview
PrestaShop is a powerful open-source e-commerce platform written in PHP that enables businesses to create and manage online stores with professional-grade features. Originally launched in 2007, PrestaShop has grown to power over 300,000 online shops worldwide, offering comprehensive product catalog management, order processing, payment integration, and customer relationship tools. The platform provides extensive customization capabilities through themes and modules, supporting everything from small boutique stores to large enterprise e-commerce operations with multi-store and multi-language functionality.
This stack combines PrestaShop with MySQL 8.0 for robust transactional data storage and Elasticsearch 7.17 for advanced search capabilities. MySQL handles all e-commerce data including products, customers, orders, and inventory with ACID compliance ensuring data integrity during high-volume transactions. Elasticsearch enhances the shopping experience by providing lightning-fast product search with relevance scoring, faceted navigation, and auto-complete suggestions that significantly improve conversion rates compared to basic SQL-based search.
This configuration is ideal for medium to large e-commerce businesses that need professional search functionality and can handle the additional complexity of managing Elasticsearch alongside their traditional database. Store owners who prioritize customer experience through fast, accurate product discovery will benefit most from this setup, as the Elasticsearch integration can dramatically improve search performance and provide analytics insights into customer search behavior.
Key Features
- Auto-installation PrestaShop setup with configurable admin panel access through custom folder naming
- MySQL 8.0 with InnoDB storage engine providing ACID compliance for order processing and inventory management
- Elasticsearch full-text search with relevance scoring and faceted navigation for product catalogs
- PrestaShop's built-in multi-store management allowing multiple shops from single installation
- Advanced product catalog features including variants, combinations, and stock management
- Integrated payment gateway support for major providers like PayPal, Stripe, and regional processors
- MySQL Group Replication compatibility for high-availability e-commerce deployments
- Elasticsearch aggregations for sales analytics and customer behavior insights
Common Use Cases
- 1Fashion retailers needing advanced search with color, size, and brand filtering capabilities
- 2Electronics stores requiring detailed product specifications search and comparison features
- 3Multi-brand marketplaces managing thousands of products across different categories
- 4B2B wholesale platforms with complex pricing tiers and customer-specific catalogs
- 5International e-commerce sites leveraging multi-language and multi-currency support
- 6Growing online stores migrating from basic platforms to enterprise-grade search functionality
- 7Dropshipping businesses managing large product catalogs from multiple suppliers
Prerequisites
- Minimum 4GB RAM (2GB for Elasticsearch, 1GB for MySQL, 1GB for PrestaShop and system overhead)
- Docker and Docker Compose installed with at least 10GB available disk space
- Port 8080 available for PrestaShop web interface access
- Basic understanding of e-commerce concepts and PrestaShop administration
- Environment variables configured: DB_USER, DB_PASSWORD, DB_ROOT_PASSWORD, ADMIN_EMAIL, ADMIN_PASSWORD
- SSL certificate and reverse proxy knowledge for production deployments
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 prestashop: 3 image: prestashop/prestashop:latest4 container_name: prestashop5 restart: unless-stopped6 ports: 7 - "${PS_PORT:-8080}:80"8 environment: 9 - DB_SERVER=ps-mysql10 - DB_NAME=prestashop11 - DB_USER=${DB_USER}12 - DB_PASSWD=${DB_PASSWORD}13 - PS_INSTALL_AUTO=114 - PS_DOMAIN=localhost:${PS_PORT:-8080}15 - PS_FOLDER_ADMIN=admin_secure16 - ADMIN_MAIL=${ADMIN_EMAIL}17 - ADMIN_PASSWD=${ADMIN_PASSWORD}18 volumes: 19 - prestashop_data:/var/www/html20 depends_on: 21 - ps-mysql2223 ps-mysql: 24 image: mysql:8.025 container_name: ps-mysql26 restart: unless-stopped27 environment: 28 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}29 - MYSQL_DATABASE=prestashop30 - MYSQL_USER=${DB_USER}31 - MYSQL_PASSWORD=${DB_PASSWORD}32 volumes: 33 - mysql_data:/var/lib/mysql3435 elasticsearch: 36 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.037 container_name: ps-elasticsearch38 restart: unless-stopped39 environment: 40 - discovery.type=single-node41 - "ES_JAVA_OPTS=-Xms256m -Xmx256m"42 volumes: 43 - es_data:/usr/share/elasticsearch/data4445volumes: 46 prestashop_data: 47 mysql_data: 48 es_data: .env Template
.env
1# PrestaShop2PS_PORT=80803DB_USER=prestashop4DB_PASSWORD=ps_password5DB_ROOT_PASSWORD=root_password6ADMIN_EMAIL=admin@example.com7ADMIN_PASSWORD=admin_passwordUsage Notes
- 1Docs: https://devdocs.prestashop-project.org/
- 2Store at http://localhost:8080, admin at /admin_secure
- 3Delete /install folder after setup (security requirement)
- 4Enable Elasticsearch in Shop Parameters > Search for better performance
- 5Install modules from PrestaShop Addons marketplace
- 6Built-in multi-store and multi-language support
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
prestashop
prestashop:
image: prestashop/prestashop:latest
container_name: prestashop
restart: unless-stopped
ports:
- ${PS_PORT:-8080}:80
environment:
- DB_SERVER=ps-mysql
- DB_NAME=prestashop
- DB_USER=${DB_USER}
- DB_PASSWD=${DB_PASSWORD}
- PS_INSTALL_AUTO=1
- PS_DOMAIN=localhost:${PS_PORT:-8080}
- PS_FOLDER_ADMIN=admin_secure
- ADMIN_MAIL=${ADMIN_EMAIL}
- ADMIN_PASSWD=${ADMIN_PASSWORD}
volumes:
- prestashop_data:/var/www/html
depends_on:
- ps-mysql
ps-mysql
ps-mysql:
image: mysql:8.0
container_name: ps-mysql
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MYSQL_DATABASE=prestashop
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
elasticsearch
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
container_name: ps-elasticsearch
restart: unless-stopped
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m
volumes:
- es_data:/usr/share/elasticsearch/data
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 prestashop:5 image: prestashop/prestashop:latest6 container_name: prestashop7 restart: unless-stopped8 ports:9 - "${PS_PORT:-8080}:80"10 environment:11 - DB_SERVER=ps-mysql12 - DB_NAME=prestashop13 - DB_USER=${DB_USER}14 - DB_PASSWD=${DB_PASSWORD}15 - PS_INSTALL_AUTO=116 - PS_DOMAIN=localhost:${PS_PORT:-8080}17 - PS_FOLDER_ADMIN=admin_secure18 - ADMIN_MAIL=${ADMIN_EMAIL}19 - ADMIN_PASSWD=${ADMIN_PASSWORD}20 volumes:21 - prestashop_data:/var/www/html22 depends_on:23 - ps-mysql2425 ps-mysql:26 image: mysql:8.027 container_name: ps-mysql28 restart: unless-stopped29 environment:30 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}31 - MYSQL_DATABASE=prestashop32 - MYSQL_USER=${DB_USER}33 - MYSQL_PASSWORD=${DB_PASSWORD}34 volumes:35 - mysql_data:/var/lib/mysql3637 elasticsearch:38 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.039 container_name: ps-elasticsearch40 restart: unless-stopped41 environment:42 - discovery.type=single-node43 - "ES_JAVA_OPTS=-Xms256m -Xmx256m"44 volumes:45 - es_data:/usr/share/elasticsearch/data4647volumes:48 prestashop_data:49 mysql_data:50 es_data:51EOF5253# 2. Create the .env file54cat > .env << 'EOF'55# PrestaShop56PS_PORT=808057DB_USER=prestashop58DB_PASSWORD=ps_password59DB_ROOT_PASSWORD=root_password60ADMIN_EMAIL=admin@example.com61ADMIN_PASSWORD=admin_password62EOF6364# 3. Start the services65docker compose up -d6667# 4. View logs68docker 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/prestashop-stack/run | bashTroubleshooting
- PrestaShop shows database connection error: Verify ps-mysql container is running and DB_* environment variables match MySQL configuration
- Elasticsearch container exits with OutOfMemoryError: Increase Docker memory limits or reduce ES_JAVA_OPTS heap size from 256m
- PrestaShop installation hangs at database setup: Check MySQL container logs for initialization completion before starting PrestaShop
- Search functionality not working after Elasticsearch setup: Enable Elasticsearch module in PrestaShop admin under Shop Parameters > Search
- Admin panel returns 404 error: Verify PS_FOLDER_ADMIN environment variable matches the actual admin folder name
- Product images not displaying properly: Ensure prestashop_data volume has proper write permissions and sufficient disk space
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
prestashopmysqlelasticsearch
Tags
#prestashop#ecommerce#shop#php
Category
E-Commerce & BusinessAd Space
Shortcuts: C CopyF FavoriteD Download