Set Up a Local PrestaShop Dev Environment

How to Set Up a Local PrestaShop Dev Environment

Setting up a local development environment for PrestaShop allows you to safely build, test, and customize your store without affecting the live site. Whether you’re just starting or an experienced dev, this guide will help you get going quickly.

✅ What You’ll Need

  • PHP (7.2–8.1 based on your PrestaShop version)
  • MySQL or MariaDB
  • Apache or Nginx
  • Composer (for PrestaShop 8+)
  • Git (optional but useful)
  • A local server stack (XAMPP, MAMP, Laragon, or Docker)

Step 1: Choose Your Local Server Stack

Option 1: XAMPP / MAMP / Laragon (Simple & Fast)

Install XAMPP (Windows/Linux) or MAMP (Mac). Launch Apache and MySQL, and place your PrestaShop folder in htdocs or your equivalent web directory.

Option 2: Docker (Isolated & Scalable)

Use Docker for more flexibility and environment control.

version: '3'
services:
  prestashop:
    image: prestashop/prestashop:8.1
    ports:
      - 8080:80
    environment:
      - DB_SERVER=db
      - PS_INSTALL_AUTO=1
    volumes:
      - ./ps:/var/www/html

  db:
    image: mysql:5.7
    environment:
      - MYSQL_ROOT_PASSWORD=admin
      - MYSQL_DATABASE=prestashop

Run the stack with:

docker-compose up -d

Step 2: Download PrestaShop

Go to the official PrestaShop download page, extract the files into your server directory (e.g., htdocs/prestashop), and open http://localhost/prestashop in your browser.

Step 3: Install PrestaShop

  1. Follow the installation wizard
  2. Use localhost as your DB server
  3. Enter your DB name, user, and password
  4. After install, delete the /install folder

Step 4: Enable Dev Mode

To see error messages and debug output:

// config/defines.inc.php
define('_PS_MODE_DEV_', true);

For PrestaShop 8+ (Symfony-based):

php bin/console debug:router

Step 5: Use Git (Optional)

Track your theme or module work with Git:

git init
echo "/admin123" >> .gitignore
echo "/var/cache" >> .gitignore

Common Issues

  • 500 Errors: Check file permissions or PHP version
  • DB Connection Issues: Ensure MySQL service is running
  • White Screen: Enable dev mode to reveal PHP errors

“A local environment is the safest place to break things and learn fast.”

🚀 You’re Ready!

You’re all set to start customizing themes, building modules, or debugging errors—all from a safe local environment.

Subscribe to PrestaInsights for more PrestaShop tutorials and developer content.

– The PrestaInsights Team

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top