PrestaShop Deployment Guide
Complete installation on RamNode VPS with Ubuntu 22.04/24.04 LTS and LAMP stack
Table of Contents−
Introduction
PrestaShop is a powerful, open-source e-commerce platform that enables businesses to create professional online stores. With over 300,000 active stores worldwide, PrestaShop offers extensive customization options, a vast marketplace of modules, and robust multi-language and multi-currency support.
This guide provides step-by-step instructions for deploying PrestaShop on a RamNode VPS running Ubuntu with the LAMP stack (Linux, Apache, MySQL, PHP).
Prerequisites
Before beginning the installation, ensure you have the following:
| Component | Minimum | Recommended |
|---|---|---|
| PHP Version | 8.1 | 8.2 or 8.3 |
| MySQL/MariaDB | 5.7 / 10.4 | 8.0 / 10.11 |
| RAM | 2GB | 4GB+ |
| Storage | 20GB SSD | 50GB+ SSD |
Note: You'll also need root or sudo access, a registered domain pointed to your server IP, and basic familiarity with Linux command line.
Server Preparation
Begin by connecting to your RamNode VPS via SSH and updating the system packages.
Update System Packages
sudo apt update && sudo apt upgrade -yConfigure Hostname
sudo hostnamectl set-hostname prestashop-server
sudo nano /etc/hostsAdd your server IP and domain:
127.0.0.1 localhost
YOUR_IP yourdomain.com prestashop-serverConfigure Firewall
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw statusInstalling LAMP Stack
Install Apache Web Server
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2Enable required Apache modules:
sudo a2enmod rewrite headers ssl expires deflate
sudo systemctl restart apache2Install MySQL Server
sudo apt install mysql-server -y
sudo systemctl enable mysql
sudo mysql_secure_installationDuring secure installation, set a strong root password and answer Y to all security questions.
Install PHP and Required Extensions
sudo apt install php php-mysql php-curl php-gd php-intl \
php-mbstring php-xml php-zip php-bcmath php-soap \
php-cli php-common libapache2-mod-php -yConfigure PHP for PrestaShop
sudo nano /etc/php/8.3/apache2/php.iniUpdate the following values:
memory_limit = 512M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_time = 300
max_input_vars = 10000
date.timezone = America/Chicagosudo systemctl restart apache2Database Configuration
Create a dedicated database and user for PrestaShop:
sudo mysql -u root -pCREATE DATABASE prestashop CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'prestashop_user'@'localhost' IDENTIFIED BY 'YourSecurePassword123!';
GRANT ALL PRIVILEGES ON prestashop.* TO 'prestashop_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;Important: Replace 'YourSecurePassword123!' with a strong, unique password. Store this password securely as you will need it during PrestaShop installation.
Installing PrestaShop
Download PrestaShop
cd /var/www
sudo wget https://github.com/PrestaShop/PrestaShop/releases/download/8.2.0/prestashop_8.2.0.zip
sudo apt install unzip -y
sudo mkdir prestashop
sudo unzip prestashop_8.2.0.zip -d prestashop/Extract Installation Archive
cd prestashop
sudo unzip prestashop.zip
sudo rm prestashop.zipSet File Permissions
sudo chown -R www-data:www-data /var/www/prestashop
sudo find /var/www/prestashop -type d -exec chmod 755 {} \;
sudo find /var/www/prestashop -type f -exec chmod 644 {} \;Configure Apache Virtual Host
sudo nano /etc/apache2/sites-available/prestashop.conf<VirtualHost *:80>
ServerName yourdomain.com
ServerAlias www.yourdomain.com
DocumentRoot /var/www/prestashop
<Directory /var/www/prestashop>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/prestashop_error.log
CustomLog ${APACHE_LOG_DIR}/prestashop_access.log combined
</VirtualHost>sudo a2ensite prestashop.conf
sudo a2dissite 000-default.conf
sudo systemctl reload apache2SSL Certificate with Let's Encrypt
Secure your store with a free SSL certificate from Let's Encrypt:
sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d yourdomain.com -d www.yourdomain.comFollow the prompts to complete SSL setup. Certbot will automatically configure Apache for HTTPS and set up auto-renewal.
sudo certbot renew --dry-runPost-Installation Security
Open your browser and navigate to your domain to complete the PrestaShop installation wizard. After installation, perform these critical security steps:
Remove Installation Directory
sudo rm -rf /var/www/prestashop/installRename Admin Directory
Rename the admin folder to a unique, hard-to-guess name:
sudo mv /var/www/prestashop/admin /var/www/prestashop/admin-$(openssl rand -hex 4)Note the new admin directory name and use it to access your back office.
Secure Configuration Files
sudo chmod 400 /var/www/prestashop/app/config/parameters.phpPerformance Optimization
Enable OPcache
sudo nano /etc/php/8.3/apache2/conf.d/10-opcache.iniopcache.enable=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.revalidate_freq=0
opcache.fast_shutdown=1Apache Performance Settings
Add inside the VirtualHost block:
# Enable Gzip Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css
AddOutputFilterByType DEFLATE application/javascript application/json
</IfModule>
# Browser Caching
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>PrestaShop Cache Settings
In the PrestaShop back office, navigate to Advanced Parameters → Performance and enable:
- Smarty Cache: Yes
- Cache Type: File System
- CCC (Combine, Compress, Cache): Enable all options
- Disable non-PrestaShop modules: Yes (if not needed)
Backup Strategy
Implement regular backups to protect your store data.
Database Backup Script
sudo nano /opt/backup-prestashop.sh#!/bin/bash
BACKUP_DIR=/var/backups/prestashop
DATE=$(date +%Y%m%d_%H%M%S)
# Create backup directory
mkdir -p $BACKUP_DIR
# Database backup
mysqldump -u prestashop_user -p'YourSecurePassword123!' prestashop | \
gzip > $BACKUP_DIR/db_$DATE.sql.gz
# Files backup
tar -czf $BACKUP_DIR/files_$DATE.tar.gz /var/www/prestashop
# Remove backups older than 7 days
find $BACKUP_DIR -type f -mtime +7 -delete
echo "Backup completed: $DATE"sudo chmod +x /opt/backup-prestashop.sh
sudo crontab -eAdd daily backup at 2 AM:
0 2 * * * /opt/backup-prestashop.sh >> /var/log/prestashop-backup.log 2>&1Troubleshooting
🎉 Congratulations!
Your PrestaShop store is now deployed and ready on your RamNode VPS. Remember to regularly update PrestaShop and its modules to maintain security and access new features.
For additional support, consult the official PrestaShop documentation at docs.prestashop-project.org or reach out to RamNode support for server-related inquiries.
