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.
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
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
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.


