How to Install PrestaShop on Ubuntu 24.04
Learn how to install PrestaShop on Ubuntu 24.04 LTS with Apache, MySQL, PHP 8.1, and SSL. Complete eCommerce store deployment and optimization tutorial.

6 min read
Learn how to install PrestaShop on Ubuntu 24.04 LTS with Apache, MySQL, PHP 8.1, and SSL. Complete eCommerce store deployment and optimization tutorial.
- Prerequisites and Supported Releases
- Step 1: Installing the Apache Web Server and MariaDB Database
- Step 2: Installing PHP and Required PrestaShop Extensions
PrestaShop is one of the world's most widely adopted open-source eCommerce platforms, powering hundreds of thousands of online storefronts across the globe. Built on PHP and MySQL, PrestaShop combines extensive out-of-the-box merchandise management with modular flexibility: multi-currency support, tax automation, international shipping rate calculations, SEO optimization, and an active marketplace of payment gateways and theme modules.
Unlike proprietary SaaS platforms that charge recurring monthly subscriptions and take percentages of your gross sales, hosting PrestaShop gives you complete sovereignty over customer data, payment processing fees, and server performance. Learning how to install prestashop on ubuntu 24.04 enables entrepreneurs and system administrators to launch a robust, scalable digital storefront on secure infrastructure.
In this comprehensive tutorial, we cover the end-to-end installation of PrestaShop on Ubuntu 24.04 LTS (Noble Numbat). We guide you through installing and configuring the LAMP stack (Apache, MariaDB, and required PHP extensions), creating an optimized database, extracting PrestaShop, configuring Apache Virtual Hosts and SSL with Certbot, and securing the administrative dashboard.
Deploy the open-source PrestaShop eCommerce platform on Ubuntu 24.04 LTS using the LAMP stack (Apache, MySQL/MariaDB, PHP), Let's Encrypt SSL, and production caching.
Prerequisites and Supported Releases
This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat). The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.
Before proceeding, ensure you have the following requirements satisfied:
- A server or cloud VPS running
Ubuntu 24.04 LTS. - A non-root user with administrative
sudoprivileges. - A registered domain name (e.g.,
store.example.com) pointed to your server IP address. - At least
2 GB of RAM(4 GB recommended for production product catalogs and checkout traffic).
Step 1: Installing the Apache Web Server and MariaDB Database
PrestaShop relies on the classic LAMP stack architecture. First, update your system package repositories and install the Apache HTTP server and MariaDB database engine.
Install apache2, mariadb-server, and standard archiving tools using APT.
Verify that both the web server and database service are active and configured to start at system boot.
# Refresh repositories and upgrade packages
sudo apt update && sudo apt upgrade -y
# Install Apache web server and MariaDB
sudo apt install -y apache2 mariadb-server mariadb-client unzip curl wget
# Ensure services are enabled and running
sudo systemctl enable --now apache2 mariadb
Step 2: Installing PHP and Required PrestaShop Extensions
PrestaShop requires PHP along with several critical extensions for data handling, XML feeds, image resizing, and encryption.
Install PHP and required modules: php-curl, php-gd, php-intl, php-mbstring, php-mysql, php-xml, php-zip, php-bcmath, and php-soap.
Optimize PHP settings in /etc/php/8.3/apache2/php.ini (or your active PHP version) to support eCommerce file uploads and catalog imports by increasing memory_limit = 256M and upload_max_filesize = 64M.
# Install PHP and extensions
sudo apt install -y php libapache2-mod-php php-cli php-fpm php-mysql php-curl php-gd php-intl php-mbstring php-xml php-zip php-bcmath php-soap
# Restart Apache to load extensions
sudo systemctl restart apache2
Step 3: Creating the PrestaShop Database and User
Set up a dedicated database and database user inside MariaDB for PrestaShop.
Log into the MariaDB command shell as the administrative root user.
Create the database prestashop_db with utf8mb4 character encoding, create user prestashop_user, grant full privileges, and apply the changes.
Replace SecureShopPassword123! with a strong password.
-- Access MariaDB prompt
sudo mariadb
-- Create PrestaShop database
CREATE DATABASE prestashop_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Create dedicated user
CREATE USER 'prestashop_user'@'localhost' IDENTIFIED BY 'SecureShopPassword123!';
-- Grant all privileges
GRANT ALL PRIVILEGES ON prestashop_db.* TO 'prestashop_user'@'localhost';
-- Flush privileges and exit
FLUSH PRIVILEGES;
EXIT;
Step 4: Downloading and Extracting PrestaShop
Download the latest stable release zip archive of PrestaShop from the official PrestaShop releases page or GitHub.
Extract the archive into your document root at /var/www/prestashop.
PrestaShop includes an internal installer zip (prestashop.zip) within the archive; extract this inner zip file directly into the directory.
# Create target directory
sudo mkdir -p /var/www/prestashop
# Download latest PrestaShop release zip
cd /tmp
wget https://github.com/PrestaShop/PrestaShop/releases/download/8.1.7/prestashop_8.1.7.zip -O prestashop.zip
# Extract into /var/www/prestashop
sudo unzip -q prestashop.zip -d /var/www/prestashop
# Unpack inner prestashop.zip if present
cd /var/www/prestashop
if [ -f prestashop.zip ]; then
sudo unzip -q prestashop.zip
sudo rm -f prestashop.zip
fi
Step 5: Configuring File Permissions and Ownership
To allow the Apache web server to write cache files, process customer image uploads, and install add-on modules, assign directory ownership to www-data.
Set directory permissions to 0755 and file permissions to 0644.
This ensures optimal security while preventing file upload permission errors.
# Assign ownership to web server user
sudo chown -R www-data:www-data /var/www/prestashop
# Set standard permissions
sudo find /var/www/prestashop -type d -exec chmod 755 {} \;
sudo find /var/www/prestashop -type f -exec chmod 644 {} \;
Step 6: Configuring Apache Virtual Host for PrestaShop
Create a dedicated Apache Virtual Host configuration for your store domain.
Create /etc/apache2/sites-available/prestashop.conf and define the document root, domain name, and directory overrides.
Enable the Apache rewrite and headers modules to support PrestaShop clean URLs.
Activate the virtual host and reload Apache.
# Create virtual host definition
sudo bash -c 'cat <<EOF > /etc/apache2/sites-available/prestashop.conf
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/prestashop
ServerName store.example.com
<Directory /var/www/prestashop>
Options +FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/prestashop_error.log
CustomLog ${APACHE_LOG_DIR}/prestashop_access.log combined
</VirtualHost>
EOF'
# Enable rewrite module and site
sudo a2enmod rewrite headers
sudo a2ensite prestashop.conf
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
Step 7: Securing PrestaShop with Let's Encrypt SSL
E-commerce stores handle sensitive customer information and payment tokens, making SSL/TLS encryption an absolute requirement.
Use Certbot to automatically obtain and configure a trusted Let's Encrypt SSL certificate for your storefront domain.
Certbot will configure Apache to automatically redirect all unencrypted HTTP traffic to secure HTTPS.
# Install Certbot
sudo apt install -y certbot python3-certbot-apache
# Issue and bind SSL certificate
sudo certbot --apache -d store.example.com
Step 8: Completing the Web Wizard and Post-Install Hardening
Navigate to https://store.example.com in your browser to launch the graphical PrestaShop installation assistant.
1. System Compatibility: Verify that all PHP modules pass the checklist.
2. Store Information: Specify your store name, main activity, country, and admin account credentials.
3. Database Configuration: Enter database details (Server: localhost, Name: prestashop_db, User: prestashop_user, Password: SecureShopPassword123!). Click Test database connection and proceed.
4. Security Cleanup: Once installation finishes, you must delete the install directory from the server to secure the shop, and rename your admin directory.
# Remove install directory for security
sudo rm -rf /var/www/prestashop/install
# PrestaShop automatically renames /admin to /adminXXXXX on first login
# Note the new admin URL provided in the installation confirmation
Troubleshooting and Common Errors
When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:
White screen or 500 internal server error during installation
Resolution: Check the Apache error log at /var/log/apache2/prestashop_error.log. Verify that all required PHP extensions (especially php-intl and php-zip) are installed and that directory ownership is set to www-data:www-data.
Images or product pages return 404 Not Found
Resolution: Ensure Apache's mod_rewrite is enabled (sudo a2enmod rewrite && sudo systemctl restart apache2) and verify that AllowOverride All is set inside /etc/apache2/sites-available/prestashop.conf.
Database connection test fails in installation assistant
Resolution: Confirm that MariaDB is running with sudo systemctl status mariadb and test logging in with the credentials via CLI: mariadb -u prestashop_user -p prestashop_db.
Security Best Practices and Hardening
Always delete the /var/www/prestashop/install folder immediately after completing the web installation wizard to prevent unauthorized store reconfiguration.
Protect your renamed admin directory using strong administrative passwords and enable two-factor authentication (2FA) for all back-office employee accounts.
Enforce HTTPS across all pages and enable HSTS in Apache to protect customer sessions and checkout credit card forms.
Regularly create database backups using mysqldump and archive the /var/www/prestashop directory before applying PrestaShop core or module upgrades.
Related Ubuntu Tutorials and Documentation
Deepen your Linux system administration skills with our related production-tested guides:
Authoritative References and Official Documentation

The Linux Command Line, 2nd Edition: A Complete Introduction
Frequently Asked Questions
Quick answers to common questions and configurations
admin folder to a randomized name (e.g., admin738xye) for security. Inspect your web root with ls -d /var/www/prestashop/admin* to find your active admin path.www-data to trigger store indexing and currency updates periodically.Editorial Disclosure: Website Vidya is supported by our readers. When you purchase hosting, tools, or software through our verified partner links, we may earn an affiliate commission at no extra cost to you. We only recommend solutions we trust and rigorously verify.
Rajesh Ray
I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.
Most Read Guides
TrendingUbuntu Server Not Booting? 10 Simple Steps to Fix It Fast
How to Create a 3D Button in HTML and CSS: Easy Steps
How to Install Python and Pip on Ubuntu 24.04 LTS
How to Install Nginx on Ubuntu 24.04
How to Install Python on Ubuntu 24.04 LTS
Related Technical Guides
Tested runbooks, server administration walkthroughs, and troubleshooting guides
Join the Conversation & Perspective
Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.
No comments on this guide yet. Be the first to share your thoughts or ask a question!