How to Install Prestashop on Ubuntu

Want to know how to install Prestashop on Ubuntu?

Since the turn of the 20th century, there has been a massive boom in E-commerce. Various companies started to provide e-commerce opportunities to millions of people worldwide. Today, it is for all of us to see Amazon’s success while dominating the e-commerce market and other giants. 

E-commerce is one of the best ways to set up a successful online business, and thus, there is a need for multiple e-commerce websites and platforms to do so. One of the platforms you can use to open a virtual shop is Prestashop. 

Prestashop is an open-source application offering its users different features to customize their virtual shops according to their choice. It also supports services from all major payment platforms, making it a complete e-commerce platform. You can either host the platform on a server you own or choose to make an account and sell your inventory.

Suppose you are using Ubuntu and are curious in knowing how to install Prestashop on Ubuntu. In that case, you are at the right place as we will be providing you a guide on how you can get the e-commerce platform on your system and use it to your benefit. 

So, let’s get started!

Installing Prestashop on Ubuntu.

Before attempting to install Prestashop, you must add multiple support applications and packages. We will guide you on which application you need to install and how to install them as well. Follow these steps. 

  1. Open the Command Terminal. 
  2. First, update your system repositories and packages so you can get all the latest applications and install them.
$ sudo apt-get update
  1. For Prestashop to work, you need to install a web-server application of your choice. We recommend one of the most popular web servers out there today, the Apache web-server application. Run the following command on the Terminal.
$ sudo apt install apache2
  1. After installing Apache, you need to enable the “mod_rewrite” module. You can do this by entering the following command. 
$ sudo a2enmod rewrite
install prestashop on ubuntu
  1. After this, restart the Apache application to save the changes you have made.
  2. Next, you need to install PHP. As Prestashop has been written in PHP, you need to have a package that can access the application for you. Run the following command on the Terminal
$ sudo apt install php php-cli php-common php-curl php-zip php-gd php-mysql php-xml php-mbstring php-json php-intl libapache2-mod-php
install prestashop on ubuntu
  1. While setting up in accordance with the Prestashop requirements, open the configuration file and set the limits for the following.
$ memory_limit = 256M
$ post_max_size = 32M
$ upload_max_filesize = 16M
  1. Next, you also need a web-based database application to manage your inventory and the other necessary inputs and outputs of your virtual shop. You can and should use the MariaDB database application. Execute the following command to install the application. 
$ sudo apt install mariadb-server
install prestashop on ubuntu
  1. After installing the MariaDB application, you need to make some configuration changes to the application and make a database for your virtual shop. Log in to the database server.
$ sudo mysql -u root -p
  1. Now, create a database for your virtual shop. You can name it anything.
$ mysql> create database <database name>;
  1. Next, create a root user to access and use the database. Use the following command and enter the username and password of your choice. 
$ mysql> create user <'username'>@<'localhost'> identified by <'password'>;
  1. The next step is to give the user you just created all the permissions and privileges you can give.
$  mysql> grant all privileges on database name.* to  <`username`>@localhost;
  1. Run the following command to save all the changes and then exit the MySQL shell. 
$ mysql> flush privileges;
$ mysql> exit;

These were the steps you need to follow to install the support application and packages. Next, let’s install Prestashop itself.

  1. Open the Command Terminal.
  2. Enter the command and run it.
$ wget
install prestashop on ubuntu
  1. Install the Prestashop files to a public directory. 
$ unzip -d /var/www/html/root-prestashop
install prestashop on ubuntu
  1. Next, you should give the Prestashop files proper access permissions.
$ chmod -R 755 /var/www/html/root-prestashop

These were the steps on how to install Prestashop on Ubuntu.

Create a Virtual Host File on Apache.

Creating the host files is important to specify the configurations of your domain. Let’s create a new host file and specify our required configurations in it.

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

Once the file is ready to open, paste the following lines.

<VirtualHost *:80> 
DocumentRoot /var/www/html/root-prestashop 
<Directory /var/www/html/root-prestashop> 
Options +FollowSymlinks 
AllowOverride All 
Require all granted 
ErrorLog /var/log/apache2/prestashop-error_log 
CustomLog /var/log/apache2/prestashop-access_log common 

With this, you are done with installing Prestashop on Ubuntu. 

As mentioned before, you must install a web-server application to use Prestashop on your system. We installed the Apache web server application, but you can use any other web server application. Another popular and useful web-server application is Nginx or “Engine-x”.

In addition to being a web server, you can use it to perform tasks such as load balancing and reverse proxy. If you want a web server instead of Apache, then we recommend using Nginx. 

If you are interested in installing Nginx, follow this web-server link. This will take you to a guide that mentions the specific steps you need to follow to install Nginx on your system.

This was an article on how to install Prestashop on Ubuntu. We first introduced the Prestashop application and where it is used. Next, we looked at how the various support packages can be installed and what changes we need to make in their configuration to run Prestashop.

Next, we looked at the commands you need to run to install and configure Prestashop. We hope that we were able to help you out in understanding the steps and you were able to install Prestashop successfully.  

If this guide helped you, please share it. 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *