docker.recipes

PrestaShop

beginner

E-commerce solution for online stores.

Overview

PrestaShop is an open-source e-commerce platform built on PHP that enables businesses to create professional online stores with comprehensive product management, order processing, and payment integration capabilities. Originally launched in 2007, PrestaShop has evolved into a feature-rich solution supporting over 300,000 merchants worldwide, offering multilingual and multi-currency support, extensive customization options through themes and modules, and robust inventory management tools that make it suitable for businesses ranging from small startups to large enterprises. This Docker stack combines PrestaShop with MySQL 8.0 to create a complete e-commerce environment where PrestaShop handles the web storefront, administrative interface, and business logic while MySQL provides the relational database backend for storing product catalogs, customer data, orders, and configuration settings. The MySQL InnoDB storage engine ensures ACID compliance for financial transactions, while PrestaShop's modular architecture allows integration with payment gateways, shipping providers, and marketing tools through its extensive marketplace ecosystem. This configuration is ideal for developers building e-commerce solutions, digital agencies deploying client stores, and businesses seeking a self-hosted alternative to SaaS platforms like Shopify. The combination provides complete control over data, unlimited customization possibilities, and the ability to integrate with existing business systems while avoiding monthly subscription fees and transaction-based pricing models typical of hosted e-commerce solutions.

Key Features

  • Multi-store management allowing multiple shops from single PrestaShop installation with shared or separate inventories
  • Advanced product catalog system with unlimited categories, attributes, combinations, and digital product support
  • Built-in SEO optimization tools including friendly URLs, meta tags management, and sitemap generation
  • Comprehensive order management workflow with customizable statuses, automated emails, and invoice generation
  • MySQL 8.0 JSON data type support for flexible product attribute storage and complex catalog structures
  • Integrated customer relationship management with segmentation, loyalty programs, and purchase history tracking
  • Extensive payment gateway ecosystem with 250+ payment modules including PayPal, Stripe, and regional providers
  • Multi-currency and multi-language support with automatic currency conversion and localized checkout processes

Common Use Cases

  • 1Small to medium businesses launching their first online store with professional e-commerce features
  • 2Digital agencies developing custom e-commerce solutions for clients requiring specific integrations
  • 3Retail businesses migrating from hosted platforms to gain full control over their online presence
  • 4B2B companies needing wholesale pricing, customer-specific catalogs, and bulk ordering capabilities
  • 5Multi-brand retailers managing multiple storefronts with shared inventory and centralized administration
  • 6International businesses requiring multi-currency support and localized shopping experiences
  • 7Developers prototyping e-commerce applications or testing payment gateway integrations

Prerequisites

  • Minimum 2GB RAM recommended for PrestaShop with MySQL 8.0 for optimal performance
  • Port 8080 available on host system for accessing PrestaShop web interface
  • Basic understanding of e-commerce concepts like product attributes, tax rules, and payment flows
  • MySQL administration knowledge for database maintenance and performance optimization
  • SSL certificate and domain configuration knowledge for production deployment
  • Familiarity with PrestaShop module system for extending functionality

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:latest
4 container_name: prestashop
5 restart: unless-stopped
6 environment:
7 DB_SERVER: mysql
8 DB_NAME: ${DB_NAME}
9 DB_USER: ${DB_USER}
10 DB_PASSWD: ${DB_PASSWORD}
11 volumes:
12 - prestashop_data:/var/www/html
13 ports:
14 - "8080:80"
15 depends_on:
16 - mysql
17 networks:
18 - prestashop
19
20 mysql:
21 image: mysql:8.0
22 container_name: prestashop-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 - prestashop
32
33volumes:
34 prestashop_data:
35 mysql_data:
36
37networks:
38 prestashop:
39 driver: bridge

.env Template

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

Usage Notes

  1. 1Docs: https://docs.prestashop-project.org/
  2. 2Access at http://localhost:8080 - complete installation wizard
  3. 3IMPORTANT: Delete /install folder after setup for security
  4. 4Admin panel at /admin-dev (or renamed admin folder)
  5. 5Modules marketplace for payments, shipping, themes
  6. 6Auto-generated admin folder name shown during install

Individual Services(2 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
  environment:
    DB_SERVER: mysql
    DB_NAME: ${DB_NAME}
    DB_USER: ${DB_USER}
    DB_PASSWD: ${DB_PASSWORD}
  volumes:
    - prestashop_data:/var/www/html
  ports:
    - "8080:80"
  depends_on:
    - mysql
  networks:
    - prestashop
mysql
mysql:
  image: mysql:8.0
  container_name: prestashop-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:
    - prestashop

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 prestashop:
5 image: prestashop/prestashop:latest
6 container_name: prestashop
7 restart: unless-stopped
8 environment:
9 DB_SERVER: mysql
10 DB_NAME: ${DB_NAME}
11 DB_USER: ${DB_USER}
12 DB_PASSWD: ${DB_PASSWORD}
13 volumes:
14 - prestashop_data:/var/www/html
15 ports:
16 - "8080:80"
17 depends_on:
18 - mysql
19 networks:
20 - prestashop
21
22 mysql:
23 image: mysql:8.0
24 container_name: prestashop-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 - prestashop
34
35volumes:
36 prestashop_data:
37 mysql_data:
38
39networks:
40 prestashop:
41 driver: bridge
42EOF
43
44# 2. Create the .env file
45cat > .env << 'EOF'
46DB_ROOT_PASSWORD=rootpassword
47DB_NAME=prestashop
48DB_USER=prestashop
49DB_PASSWORD=changeme
50EOF
51
52# 3. Start the services
53docker compose up -d
54
55# 4. View logs
56docker 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/prestashop/run | bash

Troubleshooting

  • PrestaShop installation wizard shows database connection error: Verify DB_SERVER environment variable matches MySQL container name and ensure both containers are on same network
  • MySQL container fails to start with 'data directory not empty': Remove mysql_data volume or ensure MYSQL_ROOT_PASSWORD matches existing database configuration
  • PrestaShop admin panel shows 'For security reasons, you cannot connect to the admin panel': Delete or rename the /install directory from prestashop_data volume after completing setup wizard
  • Product images not displaying correctly: Check file permissions in prestashop_data volume and ensure img/ directory is writable by web server
  • Performance issues during peak traffic: Increase MySQL InnoDB buffer pool size and enable PrestaShop's built-in cache system through Performance settings
  • Email notifications not sending from PrestaShop: Configure SMTP settings in Advanced Parameters > E-mail or set up mail server container in the stack

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