PrestaShop is an open-source e-commerce platform written in PHP, with a complete store out of the box: catalog, cart, checkout, customers, promotions, multi-language and multi-currency. It’s lighter than Magento, and very popular in Europe. This guide installs PrestaShop on Ubuntu 24.04 with Nginx, PHP-FPM and MySQL.

Requirements

Component Notes
PHP PrestaShop 9 supports PHP 8.1–8.4; PrestaShop 8 supports up to PHP 8.1
Database MySQL 5.7+ / 8.x or MariaDB 10.x
Extensions curl, gd, intl, mbstring, zip, xml, mysql (PDO), fileinfo, json, opcache
RAM 2 GB minimum for a small store; 4 GB is more comfortable

Check the requirements of the exact release you download. Ubuntu 24.04 ships PHP 8.3, which suits PrestaShop 9. See installing PHP and MySQL.

1. Install packages

sudo apt update
sudo apt install -y nginx mysql-server unzip \
  php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd php8.3-intl php8.3-mbstring \
  php8.3-zip php8.3-xml php8.3-bcmath php8.3-opcache

Recommended PHP settings in /etc/php/8.3/fpm/php.ini:

memory_limit = 512M
upload_max_filesize = 32M
post_max_size = 32M
max_execution_time = 300
max_input_vars = 10000
sudo systemctl restart php8.3-fpm

2. Database

sudo mysql <<'SQL'
CREATE DATABASE prestashop CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'prestashop'@'localhost' IDENTIFIED BY 'StrongPassword!';
GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashop'@'localhost';
SQL

3. Download PrestaShop

Get the latest release zip from the official PrestaShop GitHub releases page or prestashop.com. The release zip contains an inner prestashop.zip plus an extractor script:

cd /tmp
wget https://github.com/PrestaShop/PrestaShop/releases/download/9.0.0/prestashop_9.0.0.zip   # use the current version
unzip prestashop_9.0.0.zip -d ps
sudo mkdir -p /var/www/prestashop
sudo unzip ps/prestashop.zip -d /var/www/prestashop
sudo chown -R www-data:www-data /var/www/prestashop

4. Nginx

PrestaShop’s documentation includes a full Nginx configuration (with rewrite rules for product images and friendly URLs). The core of it:

server {
    listen 80;
    server_name shop.example.com;
    root /var/www/prestashop;
    index index.php;
    client_max_body_size 32M;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    }

    # never serve these
    location ~ /\. { deny all; }
    location ~ ^/(app|bin|cache|classes|config|var|vendor|translations)/ { deny all; }
    location ~ \.(log|tpl|twig|sql|yml)$ { deny all; }
}

Copy the image rewrite rules from the official config too, so friendly image URLs work. Then:

sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d shop.example.com

See Let’s Encrypt with Certbot on Nginx.

5. Run the installer

Open https://shop.example.com/install/ and follow the wizard: language, licence, store details, then the database (host localhost, name, user and password from step 2). Or install from the command line:

cd /var/www/prestashop/install
sudo -u www-data php index_cli.php \
  --domain=shop.example.com --ssl=1 \
  --db_server=localhost --db_name=prestashop --db_user=prestashop --db_password='StrongPassword!' \
  --name="My Shop" --country=us --language=en \
  [email protected] --password='AdminPass123!'

6. Post-install steps

sudo rm -rf /var/www/prestashop/install
ls /var/www/prestashop | grep admin     # the admin folder is renamed to admin + random characters

Bookmark the admin URL (https://shop.example.com/adminXXXX/). Then, in the back office:

  • Shop Parameters → Traffic & SEO: enable friendly URLs.
  • Shop Parameters → General: enable SSL on all pages.
  • Advanced Parameters → Performance: set debug mode off, template compilation to “never recompile” in production, and enable caching (CCC for CSS/JS).
  • Advanced Parameters → E-mail: configure SMTP, so order emails are delivered. See SMTP ports 25, 465 and 587.

Cron

Some modules (currency rates, sitemap, data cleaning) need scheduled tasks. Use the module’s cron URL in a crontab entry:

crontab -e
# */30 * * * * curl -s "https://shop.example.com/modules/…/cron.php?token=…" > /dev/null

Performance

  • PHP OPcache with enough memory. See PHP OPcache.
  • Redis or Memcached as the cache backend (configurable in the Performance settings).
  • MySQL tuning for larger catalogs. See MySQL performance tuning.
  • WebP images and a CDN for media. See WebP and AVIF.

Security and maintenance

  • Keep PrestaShop and modules updated. Old modules are the main attack vector.
  • Back up the database and the img/ folder daily. See database backup automation.
  • Restrict back-office access by IP where practical, and use strong admin passwords.
  • Firewall: only 80, 443 and SSH open. See UFW firewall.

Quick reference

Task Where / how
Admin URL /admin + random suffix
Friendly URLs Shop Parameters → Traffic & SEO
Debug mode Advanced Parameters → Performance
Clear cache Performance → Clear cache, or delete var/cache/prod
Email Advanced Parameters → E-mail (SMTP)

Related: e-commerce platforms compared and VPS for e-commerce.

  • E-Commerce
  • PrestaShop
  • PHP