PrestaShop Installation and Setup
Standard PrestaShop installation via web installer works for exploration. For production deployment, use CLI installation with pre-configured server, PHP optimization, and queue setup.
Server Requirements (PrestaShop 8.x)
-
PHP 8.1 or 8.2, extensions:
curl,dom,fileinfo,gd,intl,mbstring,openssl,pdo_mysql,simplexml,zip - MySQL 5.7+ / MariaDB 10.4+ / MySQL 8.0
-
Apache 2.4+ with
mod_rewriteor Nginx - RAM: minimum 512 MB (1–2 GB recommended for production)
- Disk: minimum 2 GB for basic installation
Installation via Composer
composer create-project prestashop/prestashop prestashop "~8.1.0" --no-dev
cd prestashop
# CLI installation without web interface
php install-dev/index_cli.php \
--domain=example.com \
--db_server=localhost \
--db_name=prestashop \
--db_user=psuser \
--db_password=securepassword \
--prefix=ps_ \
--firstname=Admin \
--lastname=User \
--password=AdminPass123! \
[email protected] \
--language=en \
--country=us \
--newsletter=0 \
--send_email=0
# Remove installer after completion
rm -rf install-dev/
Nginx Configuration
server {
listen 443 ssl http2;
server_name example.com;
root /var/www/prestashop;
index index.php;
client_max_body_size 64M;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
# Block access to sensitive files
location ~* \.(htaccess|htpasswd|ini|log|sh|sql|bak)$ { deny all; }
location ~ /\. { deny all; }
# Cache static files
location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff2)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
}
}
PHP-FPM Optimization
; /etc/php/8.1/fpm/pool.d/prestashop.conf
[prestashop]
pm = dynamic
pm.max_children = 20
pm.start_servers = 5
pm.min_spare_servers = 3
pm.max_spare_servers = 8
pm.max_requests = 500
php_value[memory_limit] = 512M
php_value[max_execution_time] = 300
php_value[upload_max_filesize] = 64M
php_value[post_max_size] = 64M
Post-Installation Configuration
Required steps after installation:
# Set permissions
find /var/www/prestashop -type d -exec chmod 755 {} \;
find /var/www/prestashop -type f -exec chmod 644 {} \;
chmod 777 var/cache var/logs
# Rename admin directory
mv admin-dev/ admin-secret-name/
# Configure cron for background tasks
# /etc/cron.d/prestashop
*/5 * * * * www-data php /var/www/prestashop/bin/console prestashop:cron:run
0 2 * * * www-data php /var/www/prestashop/bin/console cache:clear --env=prod
Timeline: installation + basic server setup—4–8 hours; full production environment with SSL, Redis, CDN—1–2 days.







