8 C
Texas
angeloma
Senior Writer and partner

How to install Prestashop on Ubuntu 20.04?

If there’s one thing the Internet has revolutionized, it’s commerce. Now almost any store needs a website to offer its products and services, but it also needs to be able to function as an online store where you can purchase right there. This is why I taught you how to install Prestashop on Ubuntu 20.04. Because Prestashop allows you to deploy an online store in a very comfortable way.

Prestashop ideal for the E-commerce

Prestashop is an open-source web application, written in PHP that allows you to create and deploy a website for a business. To some extent, it is similar to WordPress but Prestashop adds unique features for a business.

Some of its features are:

  • Allows you to create a catalog of products
  • With Prestashop, you can deploy a payment system
  • Customer Service System
  • You can manage shipments of products.

So, let us start.

Install Prestashop on Ubuntu 20.04

- Advertisement -

Prestashop is managed from a web interface created in PHP. Therefore, a functional web server is required along with a real database manager such as MariaDB or MySQL.

In any case, Prestashop is quite flexible and can also be used in conjunction with Nginx or PostgreSQL.

So, to install LAMP on Ubuntu 20.04 read our post about it.

How to install LAMP on Ubuntu 20.04

However, you also have to install some PHP modules for Prestashop to work properly.

php7.4 php7.4-gd php7.4-mbstring php7.4-mysql php7.4-curl php-xml php-cli php7.4-intl php7.4-zip

Once these modules are installed correctly, you can continue.

Creating a new database for Prestashop

Prestashop requires a database created to store all the information generated by the application.

So, open the MariaDB shell:

:~$ sudo mysql -u root -p

And then, it creates the database, the user along with the appropriate permissions.

> CREATE DATABASE prestadb;
> GRANT ALL PRIVILEGES ON prestadb.* TO 'prestauser'@'localhost' IDENTIFIED BY 'prestapss';
> FLUSH PRIVILEGES;
> exit;
1.- Create a new database for Prestahop
1.- Create a new database for Prestahop

So, you can continue.

Download Prestashop on Ubuntu 20.04

Prestashop requires a database created to store all the information generated by the application.

To download Prestashop it is necessary to install some necessary packages such as wget and unzip.

:~$ sudo apt install wget unzip

Now, you do proceed with the download:

~$ cd /tmp/
:~$ wget -c https://github.com/PrestaShop/PrestaShop/releases/download/1.7.6.5/prestashop_1.7.6.5.zip

At the time of writing, the latest version of Prestashop is 1.7.6.5

When the download is finished, decompress the file with the unzip command in a new folder called Prestashop.

:~$ mkdir prestashop
:~$ unzip prestashop_1.7.6.5.zip -d prestashop/
:~$ prestashop cd && unzip prestashop.zip

Then, go back to the previous folder and move the entire prestashop folder into the Apache root directory.

:~$ cd ..
:~$ sudo mv prestashop /var/www/html/

Then assign the folder the necessary permissions and make Apache the new owner of the folder.

:~$ sudo chown -R www-data:www-data /var/www/html/prestashop/
:~$ sudo chmod -R 755 /var/www/html/prestashop

Now create a new Virtualhost for Prestashop.

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

And add the following:

<VirtualHost *:80>
   ServerAdmin admin@your_domain.com
   DocumentRoot /var/www/html/prestashop
   ServerName your-domain.com

   <Directory /var/www/html/prestashop>
        Options FollowSymlinks
        AllowOverride All
        Require all granted 
   </Directory>
ErrorLog ${APACHE_LOG_DIR}/your-domain.com_error.log
CustomLog ${APACHE_LOG_DIR}/your-domain.com_access.log combined
2.- Creating a new Virtualhost for Prestashop
2.- Creating a new Virtualhost for Prestashop

Replace “shop.osradar.test” with yours. So, save the changes and close the file.

Now, enable the new Virtualhost and the rewrite modulo. To apply these changes, restart the Apache service.

:~$ sudo ln -s /etc/apache2/sites-available/prestashop.conf /etc/apache2/sites-enabled/prestashop.conf
:~$ sudo a2enmod rewrite
:~$ sudo systemctl restart apache2
3.- Configuring the new Virtualhost for Prestashop
3.- Configuring the new Virtualhost for Prestashop

Now complete the installation.

Install Prestashop on Ubuntu 20.04

Now it is necessary to complete the installation of Prestashop from the web interface. So, open a web browser and go to http://your-domain and you will see the following:

4.- Prestashop installation
4.- Prestashop installation

There you will have to select the language of the installation.

On this screen, you will be shown the terms of the license. If you accept, you can continue.

5.- License terms
5.- License terms

Then, you will have to define the information about your store. Also, here you will create the new administrator account.

6.- Store information on Prestashop
6.- Store information on Prestashop

Now, it’s the turn to define the database connection, for this you have to write the credentials previously created.

7.- Configuring the database connection
7.- Configuring the database connection

Then you will start the installation. However, in order to access the login page, you must delete the installation folder.

:~$ cd /var/www/html/prestashop/
:~$ sudo rm -r install/

Now you’ll see the Logbook screen.

8.- Prestashop log in page
8.- Prestashop log in page

Log in with your credentials and you will see the administration panel.

9.- Pestashop on Ubuntu 20.04
9.- Pestashop on Ubuntu 20.04

So, enjoy it.

Conclusion

Having an oonline dyke can relaunch your business. And for this, there is nothing better than Prestashop that will allow you to have everything you need to do it yourself.

Please share this post and join our Telegram channel. If you like our work you can also buy us a coffee.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

1 COMMENT

  1. Instead of linking manually the prestahop.conf file in apache, please use the existing tools for this:

    a2ensite prestashop

    😉

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article