Self-Hosting PrestaShop with Docker Compose
What PrestaShop Is
PrestaShop is an open-source e-commerce platform that competes directly with Shopify and WooCommerce. It provides a complete online store — product catalog, shopping cart, checkout, order management, customer accounts, and invoicing — all built in. No monthly SaaS fees, no transaction cuts, no feature gates.
PrestaShop 9.x is the current major version, running on PHP 8.2+ with a modernized admin interface. Over 300,000 stores run on PrestaShop worldwide, with a module marketplace of 5,000+ extensions for payment gateways, shipping, marketing, and analytics.
Prerequisites
- Linux server (Ubuntu 22.04+ or Debian 12+)
- Docker and Docker Compose installed (guide)
- 2 GB RAM minimum (4 GB recommended for production)
- 10 GB disk space (plus product images and media)
- A domain name for your store
Docker Compose Configuration
mkdir -p ~/prestashop && cd ~/prestashop
Create a .env file:
# Database
DB_PASSWORD=change-this-strong-password
DB_NAME=prestashop
# Admin account — CHANGE THESE
ADMIN_EMAIL=[email protected]
ADMIN_PASSWORD=YourStrongAdminPassword123!
# Store domain (without protocol)
PS_DOMAIN=shop.example.com
Create docker-compose.yml:
services:
prestashop:
image: prestashop/prestashop:9.0.3-apache
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
ports:
- "8080:80"
environment:
DB_SERVER: mysql
DB_NAME: ${DB_NAME:-prestashop}
DB_USER: prestashop
DB_PASSWD: ${DB_PASSWORD}
PS_INSTALL_AUTO: "1"
PS_DOMAIN: ${PS_DOMAIN:-localhost:8080}
PS_LANGUAGE: en
PS_COUNTRY: US
PS_ENABLE_SSL: "0"
PS_DEV_MODE: "0"
ADMIN_MAIL: ${ADMIN_EMAIL}
ADMIN_PASSWD: ${ADMIN_PASSWORD}
PS_FOLDER_ADMIN: admin-secure
volumes:
- ps-data:/var/www/html
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 5
start_period: 120s
mysql:
image: mysql:8.0
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME:-prestashop}
MYSQL_USER: prestashop
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- mysql-data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
volumes:
ps-data:
mysql-data:
Start the stack:
docker compose up -d
First startup takes 2-3 minutes — PrestaShop runs the installer automatically when PS_INSTALL_AUTO=1 is set. Check progress with docker compose logs -f prestashop.
Initial Setup
- Visit
http://your-server:8080— the storefront appears - Access the admin panel at
http://your-server:8080/admin-secure/ - Log in with the email and password from your
.envfile - Navigate to Shop Parameters → General to configure your store name, logo, and basic settings
- Set up payment methods under Payment → Payment Methods
- Configure shipping under Shipping → Carriers
Enabling SSL
Once you have a reverse proxy with SSL in front of PrestaShop:
- Update
.env: setPS_ENABLE_SSL=1andPS_DOMAIN=shop.example.com - In the admin panel: Shop Parameters → General → enable “Enable SSL” and “Enable SSL on all pages”
- Restart the container:
docker compose restart prestashop
Key Configuration
| Setting | Location | Default |
|---|---|---|
| Store name | Admin → Shop Parameters → General | ”PrestaShop” |
| Default currency | Admin → International → Localization | EUR |
| Tax rules | Admin → International → Taxes | EU rules |
| Admin URL path | PS_FOLDER_ADMIN env var | admin-secure |
| Debug mode | PS_DEV_MODE env var | 0 (off) |
| Auto-install | PS_INSTALL_AUTO env var | 1 (on) |
Modules and Themes
PrestaShop’s module marketplace has 5,000+ extensions. Install from the admin panel under Modules → Module Manager:
- PayPal Checkout — free, direct PayPal integration
- Stripe — credit card payments
- Google Analytics — traffic tracking
- SEO Expert — structured data, sitemap management
- One Page Checkout — streamlined checkout flow
Modules install into /var/www/html/modules/ inside the container. Since we’re using a named volume (ps-data), installed modules persist across container restarts.
Reverse Proxy with SSL
PrestaShop should run behind a reverse proxy for SSL. With Nginx Proxy Manager, point to http://prestashop:80 (using the container’s internal port). With Caddy:
shop.example.com {
reverse_proxy localhost:8080
}
After setting up SSL, enable it in the PrestaShop admin and update PS_DOMAIN to exclude the port number.
See Reverse Proxy Setup for full configuration guides.
Backup
Database
docker compose exec mysql mysqldump -u prestashop -p${DB_PASSWORD} prestashop > prestashop-backup.sql
Files
Product images, themes, and modules live in the ps-data volume:
docker run --rm -v prestashop_ps-data:/data -v $(pwd):/backup alpine tar czf /backup/ps-files-backup.tar.gz /data
Back up both the database and files. The database alone is not sufficient — product images are stored on the filesystem.
See Backup Strategy for automated backup scheduling.
Troubleshooting
Auto-install fails with database connection error
Symptom: Container starts but store shows the PrestaShop installer instead of auto-installing
Fix: Wait for the MySQL health check to pass before PrestaShop starts. The depends_on condition handles this, but if MySQL is slow to initialize (first run), increase the start_period on the PrestaShop health check. Check logs: docker compose logs prestashop | grep -i error.
Admin panel shows blank page after SSL change
Symptom: After enabling SSL, the admin panel returns a white page
Fix: Clear the PrestaShop cache: docker compose exec prestashop rm -rf /var/www/html/var/cache/*. If still broken, disable SSL via the database directly:
docker compose exec mysql mysql -u prestashop -p${DB_PASSWORD} prestashop -e "UPDATE ps_configuration SET value='0' WHERE name='PS_SSL_ENABLED';"
“caching_sha2_password” error
Symptom: PrestaShop can’t connect to MySQL 8 with authentication errors
Fix: The --default-authentication-plugin=mysql_native_password flag in the MySQL command handles this. If you removed that flag, add it back.
Permission issues on volume mount
Symptom: PrestaShop can’t write files (module installs fail, image uploads fail)
Fix: PrestaShop runs as www-data (UID 33). If using bind mounts instead of named volumes: sudo chown -R 33:33 ./ps-data.
Resource Requirements
| Resource | Minimum | Recommended |
|---|---|---|
| RAM | 1 GB (PrestaShop) + 512 MB (MySQL) | 2 GB + 1 GB |
| CPU | 1 vCPU | 2+ vCPUs |
| Disk | 5 GB + product media | 20 GB+ |
PrestaShop is heavier than static site generators but lighter than Magento. A $10-20/month VPS handles a small-to-medium store comfortably.
Verdict
PrestaShop is the best self-hosted option for a traditional e-commerce store with a built-in admin panel. It ships everything you need — product management, inventory, orders, payments, shipping — out of the box. The module ecosystem fills any gaps.
Choose PrestaShop over Saleor or Medusa if you want an admin-panel-driven store (not headless/API-first). Choose it over WooCommerce if you don’t want to manage WordPress. For headless commerce with a custom frontend, look at the Saleor vs Medusa comparison instead.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments