Setting Up PrestaShop on a VDS (Virtual Dedicated Server)
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.
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
- Install Apache or Nginx:
sudo apt install apache2 -y # For Apache sudo apt install nginx -y # For Nginx - Install PHP and Extensions:
sudo apt install php php-cli php-mysql php-curl php-zip php-gd php-xml php-mbstring -y - Install MySQL or MariaDB:
sudo apt install mysql-server -y # For MySQL sudo apt install mariadb-server -y # For MariaDB - Secure the Database Server:
sudo mysql_secure_installation
Download and Configure PrestaShop
- Navigate to the web server root directory:
cd /var/www/html - Download PrestaShop:
wget https://download.prestashop.com/releases/prestashop_1.7.8.8.zip - 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
Configure Apache or Nginx
Apache Configuration
- Create a new virtual host:
sudo nano /etc/apache2/sites-available/prestashop.conf - 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> - Enable the site and restart Apache:
sudo a2ensite prestashop.conf sudo systemctl restart apache2
Nginx Configuration
- Create a new configuration file:
sudo nano /etc/nginx/sites-available/prestashop - 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; } } - 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
- Log in to MySQL:
sudo mysql -u root -p - 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
- Open your browser and navigate to:
http://yourdomain.com - Follow the installation wizard:
- Enter database details (prestashop_user, prestashop, password).
- Set your admin account and store details.
- After installation, delete the /install directory:
rm -rf /var/www/html/prestashop/install
Secure Your Installation
- Enable HTTPS: Install an SSL certificate (e.g., Let's Encrypt):
sudo apt install certbot python3-certbot-apache sudo certbot --apache -d yourdomain.com - 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.
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.
How to Reinstall PrestaShop on Your Server
How to Install & Optimize OpenCart on a VPS
Osclass Hosting — A Complete Guide for System Administrators


