docs/DEVELOPMENT.md
Complete guide for setting up and working with PrestaShop development environment.
git clone https://github.com/PrestaShop/PrestaShop.git
cd PrestaShop
make docker-start
Default Admin Credentials:
[email protected]Correct Horse Battery StapleThe setup includes three services:
.docker/ # Docker configuration
├── Dockerfile # PHP container definition
└── install/ # Installation scripts
docker-compose.yml # Base configuration
docker-compose.override.yml.dist # Development overrides
Makefile # Development commands
make help # Show all available commands
| Command | Description |
|---|---|
make docker-build | Build Docker images from scratch |
make docker-up | Start containers in detached mode |
make docker-start | Build and start containers |
make docker-restart | Restart the docker hub |
make docker-down | Stop and remove containers |
make docker-logs | Show live container logs |
make docker-bash | Connect to PHP container via bash |
| Command | Description |
|---|---|
make assets | Build all assets (admin + front) |
make assets-dev | Start development servers for all themes |
make wait-assets | Wait for assets to finish building |
make admin | Build admin assets (default + new theme) |
make front | Build front assets (core + classic) |
make admin-default | Build default admin theme assets |
make admin-new-theme | Build new admin theme assets |
make front-core | Build core front theme assets |
make front-classic | Build classic front theme assets |
make front-hummingbird | Build hummingbird theme assets |
| Command | Description |
|---|---|
make install | Install PHP dependencies and build assets |
make install-prestashop | Install fresh PrestaShop database |
| Command | Description |
|---|---|
make composer | Install PHP dependencies |
make cc | Clear Symfony cache |
| Command | Description |
|---|---|
make test | Run all tests (unit + integration) |
make test-unit | Run unit tests |
make test-integration | Run integration tests |
make test-integration-behaviour | Run integration behaviour tests |
make test-api-module | Run API module tests |
| Command | Description |
|---|---|
make cs-fixer | Run PHP CS Fixer |
make cs-fixer-dry | Run PHP CS Fixer (dry run) |
make phpstan | Run PHPStan analysis |
make scss-fixer | Fix SCSS files |
make es-linter | Fix ESLint issues |
| Category | Variable | Default | Description |
|---|---|---|---|
| Database | DB_PASSWD | prestashop | Database password |
DB_NAME | prestashop | Database name | |
DB_SERVER | mysql | Database host | |
DB_PREFIX | ps_ | Database table prefix | |
| PrestaShop | PS_INSTALL_AUTO | 1 | Auto-install PrestaShop |
PS_DOMAIN | localhost:8001 | Shop domain | |
PS_FOLDER_INSTALL | install-dev | Install folder | |
PS_FOLDER_ADMIN | admin-dev | Admin folder | |
PS_COUNTRY | fr | Shop country | |
PS_LANGUAGE | en | Installation language | |
PS_DEV_MODE | 1 | Development mode | |
PS_ENABLE_SSL | 0 | Enable SSL | |
PS_ERASE_DB | 0 | Erase database on install | |
PS_USE_DOCKER_MAILDEV | 1 | Use MailDev for emails | |
| Admin | ADMIN_MAIL | [email protected] | Admin email |
ADMIN_PASSWD | Correct Horse Battery Staple | Admin password | |
| Development | VERSION | 8.1-apache | PHP version |
NODE_VERSION | 20.19.5 | Node.js version | |
INSTALL_XDEBUG | false | Install Xdebug | |
BLACKFIRE_ENABLE | 0 | Enable Blackfire profiling | |
BLACKFIRE_SERVER_ID | 0 | Blackfire server ID | |
BLACKFIRE_SERVER_TOKEN | 0 | Blackfire server token | |
USER_ID | 1000 | User ID for container | |
GROUP_ID | 1000 | Group ID for container | |
DISABLE_MAKE | 0 | Disable make commands | |
PS_HOSTNAME | localhost | Container hostname |
make docker-start # Build, start containers and install assets and database fixtures
make docker-up # Start containers
make cc # Clear Symfony's cache
make test # Run tests
make cs-fixer # Fix code style
The asset build system provides a simple and reliable way to build all assets:
Examples:
# Build all assets
make assets
# Build Admin default theme
make admin-default
# Direct script usage (dry-run by default. Use --force to force rebuild)
# All assets
./tools/assets/build.sh # dry-run
./tools/assets/build/sh --force
# Specific asset
./tools/assets/build.sh admin-default # dry-run
./tools/assets/build.sh admin-default --force
make test-unit for faster test runs during developmentmake cs-fixer-dry to check code style without modifying filesSolutions:
Clean Docker cache:
docker system prune -f
docker volume prune -f
Rebuild from scratch:
make docker-down
docker system prune -af
make docker-start
Solutions:
Check what's using the port:
lsof -i :8001
Stop conflicting services:
docker ps
docker stop <container-id>
Solutions:
Increase Docker resources:
Check network connectivity:
curl -I https://deb.nodesource.com
Solutions:
Check database container:
docker ps | grep mysql
docker logs prestashop-mysql-1
Reset database:
make docker-down
docker volume rm prestashop_db-data
make docker-up
Check database credentials:
docker compose exec prestashop-git env | grep DB_
If your database is corrupted / data is lost, you can reset your data by running the following command:
make install-prestashop
Solutions:
Install Node.js dependencies:
make assets
Restart Docker containers:
make docker-restart
Solutions:
Check for syntax errors:
make assets
Rebuild specific assets:
make admin-default
make front-classic
Restart Docker containers:
make docker-restart
Solutions:
Fix ownership:
sudo chown -R $USER:$USER .
Fix permissions:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod +x .docker/docker_run_git.sh
Solutions:
Clear cache:
make cc
Fix cache permissions:
make sh
chmod -R 777 var/cache
chmod -R 777 var/logs
Solutions:
Enable Xdebug:
export INSTALL_XDEBUG=true
make docker-start
Check Xdebug configuration:
make docker-sh
php -i | grep xdebug
Solutions:
Run specific test groups:
make test-unit
make test-integration
Check test database:
make docker-sh
php bin/console doctrine:database:create --env=test
Run tests with custom options:
# Run specific test files or classes
composer run unit-tests -- --filter=ClassName
composer run integration-tests -- --filter=ClassName
# Run with specific options
composer run unit-tests -- --stop-on-failure
composer run integration-tests -- --stop-on-failure
If you're still experiencing issues:
Check logs:
make docker-logs
docker logs prestashop-prestashop-git-1
docker logs prestashop-mysql-1
Search existing issues:
Ask for help: