How to install PrestaShop on Ubuntu 20.04 Server

Learn the simple steps to install and set up the Prestashop e-commerce platform on Ubuntu 20.04 or 18.04 LTS Linux server running on localhost or cloud hosting such as AWS, Google, DigitalOcean, etc.

PrestaShop is an open-source and free-to-use e-commerce platform that has been written in PHP and is suitable to all sizes of businesses that want their products to be sold online. However, the appropriate developer and support are necessary.

This free e-commerce platform is available in two versions community and premium which is hosted and managed by the developers themselves. The hosting is provided IONOS. Well, for those who want to host the Prestashop own their cloud hosting platforms, and have technical knowledge; the community edition is good to go. Whereas, all functions and modules which are not free, you have to purchase them for a fee. Also, the pre-build modules help a lot to extend the functions of Prestashop as required. Therefore, you don’t have to spend any money on features that you don’t need in the end.

The PrestaShop is quite flexible that’s why it gives the user the choice to opt between numerous themes, modules, and extensions, even if the number cannot keep up with giants like Magento.

The e-commerce platform is ideal for small shops and startups who desire to open online e-stores but at relatively low investment but in a very quick way.

System Requirements to install Prestashop on Ubuntu

  • Ubuntu 20.04 or 18.04 Linux server with root access
  • Prestashop setup files
  • Web server: Apache or Nginx
  • PHP 5.6+ with  extensions: Mcrypt, OpenSSL, Zip, Curl, GD, PDO and memory_limit to “128M” and upload_max_filesize to “16M”
  • MySQL 5.0+

Access your Ubuntu 20.04 Server

If you are on the cloud then simply login and access the terminal using SSH. Or use the local command terminal to do the same.  Well, if you are installing Prestashop on a locally installed Linux server or desktop then you would already be there.

Now, first, run the system update and upgrade commands:

sudo apt update
sudo apt upgrade

Install Apache and MySQL

You can use Nginx, however, here we are using the command on popular web server Apache to show this tutorial along with Mysql Database.

sudo apt install apache2

Enable Apache mod_rewrite module 

sudo a2enmod rewrite
sudo systemctl restart apache2

Install MySQL server

sudo apt install mysql-server


Get and Install PHP

The latest version of the PHP available on Ubuntu 20.04 LTS by default is v7.4 which could be different depending on when you are performing this tutorial. However, no need to worry about that. Just simply run the below command and the system will install the available supported version of PHP along with other key extensions we need to set up PrestaShop.

sudo apt install php php-cli php-common php-curl php-zip php-gd php-mysql php-xml php-mbstring php-json php-intl

InstallPHP and all its extensions

Now, change the memory and upload file limits. 

To find the path of your php.ini file run the below command:

php -i | grep -i php.ini

Now, see the path and use it to edit the php.ini file

In our case it was:

sudo nano /etc/php/7.4/cli/php.ini

Command to find the PHP INi path

Find two lines:

Change memory_limit value to 128M

memory_limit= 128M

Change php memory limit for Prestashop

And also increase the upload size of the file to 16 MB or 32 MB, as per your requirements.

upload_max_filesize = 32M

Increase the upload file size for Prestashop

Finally, restart the apache

sudo systemctl restart apache2

Download PrestaShop

The latest version of the PrestaShop while performing this tutorial was v1.7.6.8. Thus, here we are downloading the same. Here is the Github page link to get the latest release or use the given command to get it.

cd /tmp
curl -s | grep "browser_download_url.*zip" | cut -d : -f 2,3 | tr -d \" | wget -qi -


Unzip and move Prestashop to the www folder

After downloading the latest version of the PrestaShop, unzip it and move the folder to the webroot directory of the webserver. So, that it could be used safely for calling through a web browser.

sudo unzip prestashop_*.zip -d /var/www/prestashop/

Note: If you don’t have an unzip tool, then install it using the command:sudo apt install unzip

Change Permission to Apache user

Change the permission of Prestashop folder to Apache’s www-data user and group, for that the syntax will be:

sudo chown -R www-data: /var/www/prestashop/

Secure MySQL Installation

If you are installing the Prestashop on localhost then you can skip this step, however, for those who want it to use for commercial purposes, it is recommended to run the below command and follow the instructions. This will remove the demo database, force the admin to set a strong password for the MySQL server, and turn off the remote access of MySQL to secure it.

sudo mysql_secure_installation

Create Database

sudo mysql

Note:presta_h2s is the database here and prestauser is the user and the password is the password we used for the database user. Change them as per your choice.

Create Database

create database `presta_h2s`;

Create User with password

create user 'prestauser'@'localhost' identified by 'password';

Grant all permissions of Database to User

GRANT ALL PRIVILEGES ON `presta_h2s`.* to `prestauser`@localhost;



Configure PrestaShop virtual Host for Apache

In case you are planning to use multiple domains on your Apache webserver then creating a virtual host for Prestashop will be a great idea. This will also let us use our domain for accessing the front-end and backend of the PrestaShop without showing the directory in which we have kept its all files. Therefore create a new Apache configuration file and enable make it.

sudo nano /etc/apache2/sites-available/prestashop.conf

Copy-paste the following lines in the file and save them by using Ctrl+X and type Y and hit the Enter key.

Note: change, the domain you want to use for PrestaShop.

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/prestashop

<Directory /var/www/prestashop>
Options +FollowSymlinks
AllowOverride All
Require all granted

ErrorLog /var/log/apache2/prestashop-error_log
CustomLog /var/log/apache2/prestashop-access_log common

Enable the Prestashop Apache configuration and restart the webserver.

sudo a2ensite prestashop.conf

Disable default Apache page

sudo a2dissite 000-default.conf
sudo systemctl restart apache2


Access your Ecommerce Store

Everything is ready and it’s time to access our Ubuntu 20.04 or 18.04 installed PrestaShop eCommerce store for further settings. Open the browser on your local system and type the Ip address or pointing to the store.


Select the Language

Choose the language in which you want to install the PrestaShop and then select the Next button.

Prestashop Installer

Accept the License

Accepth the license

Information about your Store

Provide the information to be used with the store you want to create such as Shop name, main category, country, time zone, and others.

Set store Information of Ecommerce

Connect Database

The database we have created in this article, enter the details of that or any remote database you want to use with your PrestaShop installation.

configuring Database Prestashop

Wait for a few minutes, once done you will be able to access the installed Ecommerce portable.

Presta backend login details

Login to PrestaShop BackEnd

To login to the backend, just type admin at the end of your PrestaShop e-commerce URL. For example or http://ip-address/admin

But as we tried to log in, an error will appear “For security reasons, you can not connect to the back office until you have- deleted the Install folder”

To delete the install folder run the below command on the server:

sudo rm -r /var/www/html/prestashop/install

PrestaShop Login error

After deleting the folder, simply refresh the login page, and this time you will get the login page.

Enter login details

PrestaShop Install on Ubuntu 20.04 ot 18.04 LTS Linux



Comments (7)

  1. Pedro Tomás May 19, 2021
    • Heyan May 20, 2021
  2. joão cardoso July 3, 2021
  3. joão cardoso July 3, 2021
  4. joão cardoso July 3, 2021
  5. hellllp March 27, 2022
    • Heyan March 28, 2022

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.