Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Setting Up PrestaShop on a VDS (Virtual Dedicated Server)

4 min read
18.05.2025

PrestaShop is a popular eCommerce platform that performs exceptionally well on a properly configured VDS (Virtual Dedicated Server). Below is a step-by-step guide to setting up PrestaShop on your VDS.

PrestaShop VDS Setup
PrestaShop on VDS — stack + install + secure + optimize.

For closely related PrestaShop topics, see How to Reinstall PrestaShop, PrestaShop IMAP Configuration Error, How to Change the Email Sender in PrestaShop, and Install & Optimize OpenCart on a VPS.

Server Requirements for PrestaShop

Component Requirement
Operating System Linux (Ubuntu 20.04/22.04, CentOS 7/8, or Debian 10/11)
Web Server Apache 2.4+ or Nginx 1.18+
PHP Version PHP 7.4?8.1 (depending on PrestaShop version)
Database MySQL 5.7+ or MariaDB 10.3+
Disk Space At least 2 GB free (more for larger stores)
Memory Minimum 2 GB RAM (4 GB recommended for better performance)

Prepare Your VDS

Update System Packages

sudo apt update && sudo apt upgrade -y  # For Ubuntu/Debian
sudo yum update -y                      # For CentOS

Install Required Software

  1. Install Apache or Nginx:
    sudo apt install apache2 -y      # For Apache
    sudo apt install nginx -y        # For Nginx
  2. Install PHP and Extensions:
    sudo apt install php php-cli php-mysql php-curl php-zip php-gd php-xml php-mbstring -y
  3. Install MySQL or MariaDB:
    sudo apt install mysql-server -y  # For MySQL
    sudo apt install mariadb-server -y # For MariaDB
  4. Secure the Database Server:
    sudo mysql_secure_installation

Download and Configure PrestaShop

  1. Navigate to the web server root directory:
    cd /var/www/html
  2. Download PrestaShop:
    wget https://download.prestashop.com/releases/prestashop_1.7.8.8.zip
  3. Extract the archive:
    sudo apt install unzip -y
    unzip prestashop_1.7.8.8.zip
    mv prestashop /var/www/html/prestashop

Set Permissions

sudo chown -R www-data:www-data /var/www/html/prestashop
sudo chmod -R 755 /var/www/html/prestashop
Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

Configure Apache or Nginx

Apache Configuration

  1. Create a new virtual host:
    sudo nano /etc/apache2/sites-available/prestashop.conf
  2. Add the following configuration:
    <VirtualHost *:80>
    
        ServerName yourdomain.com
    
        DocumentRoot /var/www/html/prestashop
    
        <Directory /var/www/html/prestashop/>
    
            AllowOverride All
    
            Require all granted
    
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/prestashop_error.log
    
        CustomLog ${APACHE_LOG_DIR}/prestashop_access.log combined
    
    </VirtualHost>
  3. Enable the site and restart Apache:
    sudo a2ensite prestashop.conf
    sudo systemctl restart apache2

Nginx Configuration

  1. Create a new configuration file:
    sudo nano /etc/nginx/sites-available/prestashop
  2. Add the following:
    server {
    
        listen 80;
    
        server_name yourdomain.com;
    
        root /var/www/html/prestashop;
    
    
    
        index index.php;
    
    
    
        location / {
    
            try_files $uri /index.php?$query_string;
    
        }
    
    
    
        location ~ \.php$ {
    
            include snippets/fastcgi-php.conf;
    
            fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    
            include fastcgi_params;
    
        }
    
    }
  3. Enable the configuration and restart Nginx:
    sudo ln -s /etc/nginx/sites-available/prestashop /etc/nginx/sites-enabled/
    sudo systemctl restart nginx

Create a Database for PrestaShop

  1. Log in to MySQL:
    sudo mysql -u root -p
  2. Create a database:
    CREATE DATABASE prestashop;
    
    CREATE USER 'prestashop_user'@'localhost' IDENTIFIED BY 'strongpassword';
    
    GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashop_user'@'localhost';
    
    FLUSH PRIVILEGES;
    
    EXIT;

Finalize PrestaShop Installation

  1. Open your browser and navigate to:
    http://yourdomain.com
  2. Follow the installation wizard:
    • Enter database details (prestashop_user, prestashop, password).
    • Set your admin account and store details.
  3. After installation, delete the /install directory:
    rm -rf /var/www/html/prestashop/install

Secure Your Installation

  1. Enable HTTPS: Install an SSL certificate (e.g., Let's Encrypt):
    sudo apt install certbot python3-certbot-apache
    sudo certbot --apache -d yourdomain.com
  2. Regular Backups: Automate backups of your database and files using cron or backup tools.

Optimize Performance

  • Enable Caching: Use PrestaShop built-in caching or tools like Redis.
  • Use a CDN: Integrate a CDN (e.g., Cloudflare) for faster content delivery.
  • Optimize Images: Use compressed images to improve load times.

Your PrestaShop is now set up and ready to use on your VDS.

Frequently asked questions
2 vCPU / 4 GB RAM / 40 GB SSD for ~500 products + low traffic. 4/8/80 for 5000+ products + active traffic. Image-heavy catalogs need more disk. PrestaShop's admin (BackOffice) is heavy — generous CPU helps responsive admin even with modest traffic.
`opcache.memory_consumption=256`, `opcache.max_accelerated_files=20000`, `opcache.validate_timestamps=0` (prod) or 1 (dev). PrestaShop has 10k+ PHP files — default OPcache fills up. Increase memory and max_files; monitor cache hit rate (PHP opcache_get_status).
Immediately post-install. Default is `/admin123/` — rename to random string. PrestaShop install wizard renames to `admin` automatically; verify the URL is something obscure. Bots scan for `/admin`, `/admin123`, etc.; random URL makes that ineffective.
Very. Product pages serve 5-15 images each. CDN cuts page load time significantly. CloudFront, Cloudflare, BunnyCDN all work. Set up via PrestaShop's native CDN config (Preferences → CCC → "Media servers") or via .htaccess RewriteRule pointing /img/ to CDN domain.
Related articles
How to Reinstall PrestaShop on Your Server
How to Install & Optimize OpenCart on a VPS
Osclass Hosting — A Complete Guide for System Administrators