PrestaShop is a free, open-source e-commerce platform built with PHP and MySQL. It comes with a clean admin dashboard, support for multiple payment gateways, multi-language storefronts, and built-in reporting. You can extend it further with free and paid plugins and themes.
This guide shows you how to install PrestaShop on Ubuntu 18.04 using Nginx as the web server.
<strong>Prerequisites:</strong> Nginx installed with an SSL certificate, a domain name pointing to your server, and sudo access. Prepare your system with <code>sudo apt update && sudo apt upgrade && sudo apt install unzip</code>.
PrestaShop needs a database to store products, orders, and customer data.
Install MySQL if it is not already on your server:
bashsudo apt install mysql-server mysql-client
For fresh installations, run mysql_secure_installation first to remove test accounts and restrict remote root access.
Log in to the MySQL shell:
bashsudo mysql
Create a dedicated database and user for PrestaShop:
sqlCREATE DATABASE prestashop;GRANT ALL ON prestashop.* TO 'prestashop'@'localhost' IDENTIFIED BY 'StrongPassword';EXIT;
Always use a strong, unique password for any database user account.
PHP 7.2 is the default version in Ubuntu 18.04 and is fully supported by PrestaShop.
Install PHP and all required extensions:
bashsudo apt install php7.2-common php7.2-cli php7.2-fpm php7.2-opcache php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap
The extensions cover image processing (gd), database connections (mysql), internationalization (intl), and XML handling (xsl). All are required for PrestaShop to work correctly.
Apply the recommended PHP settings:
bashsudo sed -i "s/memory_limit = .*/memory_limit = 1024M/" /etc/php/7.2/fpm/php.inisudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 256M/" /etc/php/7.2/fpm/php.inisudo sed -i "s/max_execution_time = .*/max_execution_time = 18000/" /etc/php/7.2/fpm/php.ini
Download the latest PrestaShop release and create the web root:
bashcd /tmpwget https://download.prestashop.com/download/releases/prestashop_1.7.6.2.zipsudo mkdir -p /var/www/html/example.com
Extract the archive. The outer zip contains a second zip file inside it — extract that one into your web root:
bashunzip prestashop_*.zipsudo unzip prestashop.zip -d /var/www/html/example.com
Set the correct ownership so Nginx can read all site files:
bashsudo chown -R www-data: /var/www/html
Create a server block at /etc/nginx/sites-available/example.com. The configuration must include:
root /var/www/html/example.comindex index.phpserver_name example.com www.example.comfastcgi_pass directive pointing to unix:/run/php/php7.2-fpm.sockFind your PrestaShop admin folder name and add a matching location block for it:
bashsudo ls -l /var/www/html/example.com | grep admin
Test the configuration and restart Nginx:
bashsudo nginx -tsudo systemctl restart nginx
Open your browser and go to https://example.com. The PrestaShop setup wizard will open.
Work through each step:
The installer will confirm when setup is complete. Delete the install folder right away for security:
bashsudo rm -rf /var/www/html/example.com/install
Log in to the admin panel using your email and password to start building your store.
PrestaShop is now live on your Ubuntu 18.04 server. Add your products, configure payment methods, and set up shipping rules from the admin panel. Leave a comment below if you run into any errors during installation.
Apache Tomcat is an open-source Java application server that implements the Java Servlet, JavaServer Pages, and…
Setting the correct timezone on your Ubuntu machine is more important than it sounds. Your…
SSH keys give you a more secure and convenient way to connect to remote servers. Instead…
FFmpeg is a free, open-source command-line tool for working with multimedia files. It can convert video…
Nginx server blocks let you run more than one website on a single server. Each block…
Tor Browser is a modified version of Firefox that routes all your web traffic through the Tor…