Deploying a PrestaShop App
Introduction
PrestaShop is a popular open-source eCommerce platform built on PHP and MySQL. Deploying PrestaShop with a Dockerfile on Klutch.sh delivers reproducible builds, managed secrets, and persistent storage—all configured from klutch.sh/app. This guide covers installation, Dockerfile setup, environment variables, storage, Nixpacks overrides, and sample requests to verify your shop.
Prerequisites
- A Klutch.sh account (sign up)
- A GitHub repository containing your PrestaShop Dockerfile (GitHub is the only supported git source)
- External MySQL-compatible database (e.g., MariaDB)
- Domain and TLS for your storefront
For onboarding, see the Quick Start.
Architecture and ports
- PrestaShop serves HTTP on internal port
8080in the official image. Choose HTTP traffic and set the internal port to8080. - Persistent storage is required for uploaded assets and configuration; database resides externally.
Repository layout
prestashop/├── Dockerfile # Must be at repo root for auto-detection└── README.mdKeep secrets out of Git; store them in Klutch.sh environment variables.
Installation (local) and starter commands
Build and run locally (ensure MySQL is reachable):
docker build -t prestashop-local .docker run -p 8080:8080 \ -e PS_DEV_MODE=0 \ -e PS_INSTALL_AUTO=1 \ -e DB_SERVER=localhost \ -e DB_NAME=prestashop \ -e DB_USER=prestashop \ -e DB_PASSWD=changeme \ prestashop-localDockerfile for PrestaShop (production-ready)
Place this at the repo root; Klutch.sh auto-detects Dockerfiles.
FROM prestashop/prestashop:8-apache
ENV APACHE_DOCUMENT_ROOT=/var/www/htmlENV PS_INSTALL_AUTO=1ENV PS_DEV_MODE=0ENV PS_ENABLE_SSL=1ENV PS_LANGUAGE=enENV PS_COUNTRY=USENV PS_TIMEZONE=UTC
EXPOSE 8080CMD ["apache2-foreground"]Notes:
- Pin the image tag (e.g.,
prestashop/prestashop:8.1-apache) for stability. apache2-foregroundruns the web server on port 8080.
Environment variables (Klutch.sh)
Set these before deploying:
PORT=8080DB_SERVER=<db-host>DB_NAME=<db-name>DB_USER=<db-user>DB_PASSWD=<db-password>PS_INSTALL_AUTO=1PS_DEV_MODE=0PS_ENABLE_SSL=1- Optional:
PS_LANGUAGE=en,PS_COUNTRY=US,PS_TIMEZONE=UTC
If you deploy without the Dockerfile and need Nixpacks overrides:
NIXPACKS_START_CMD=apache2-foreground
Attach persistent volumes
Add storage in Klutch.sh (path and size only):
/var/www/html/img— product and media uploads./var/www/html/var— cache and generated files.
Ensure paths are writable inside the container.
Deploy PrestaShop on Klutch.sh (Dockerfile workflow)
- Push your repository—with the Dockerfile at the root—to GitHub.
- Open klutch.sh/app, create a project, and add an app.
- Select HTTP traffic and set the internal port to
8080. - Add the environment variables above (database credentials, SSL flag, language settings).
- Attach volumes at
/var/www/html/imgand/var/www/html/varsized for your catalog and cache. - Deploy. Access your shop at
https://example-app.klutch.shand complete any remaining setup screens.
Sample checks
Health/landing check:
curl -I https://example-app.klutch.shAdmin login (after setup, replace path if customized):
curl -I https://example-app.klutch.sh/adminHealth checks and production tips
- Use an HTTP readiness probe on
/to confirm the storefront responds. - Keep DB credentials in Klutch.sh secrets; rotate them regularly.
- Enforce HTTPS at the edge; set
PS_ENABLE_SSL=1. - Back up your external database; export media from
/var/www/html/imgas needed. - Pin image versions and test upgrades in staging before production.
PrestaShop on Klutch.sh combines reproducible Docker builds, managed secrets, and persistent storage for media and cache—without extra YAML or CI steps. Configure ports, env vars, and volumes, then launch your storefront.