How to Install PrestaShop on Ubuntu 22.04 Server

Learn the simple steps to install and set up Prestashop e-commerce platform on Ubuntu 22.04 IT IS Linux server stuck jellyfish, run on localhost Where cloud hosting like AWS, Google, DigitalOcean, etc.

PrestaShop is an open source platform that makes it easy for anyone to build an eCommerce website platform to start selling products. It’s like WooCommerce but with more features. Being an open source platform, the source code of the software is publicly available, hence secure. In addition, it allows users to adapt the software to their needs and to constantly improve and update their offers. The software was created with PHP and released under the Open Software License (OSL).

It is an extremely popular solution used by over 30,000 companies worldwide in 60 different languages. The company was founded in 2007 and is based in Paris. However, it is now a multinational company.

The Prestashop system offers a wide range of functions, from warehouse management to extensive analysis and reporting functions to the included eBay login. To extend the functions of the platform, an ecosystem is available for extensions, but it largely provides paid modules – although there is an acceptable amount of free modules. The selection of modules is also wide, from connecting to Amazon’s marketplace to WordPress integration to connecting merchandise management and ERP systems.

Steps to Install PrestaShop on Ubuntu Server 22.04

The steps given here to configure PrestaShop on Ubuntu 22.04 will be the same for Ubuntu 20.04 and 18.04 including Debian 11 server.

What should we do in this tutorial?

⇒ A clean Ubuntu 22.04 server
⇒ A user with sudo access
⇒ Internet connection

1. Update Ubuntu Server 22.04

The first thing to do after connecting to the Ubuntu server to install PrestaShop is to make sure that our system is up to date. For this, run the given command using APT.

sudo apt update && sudo apt upgrade

2. Install Apache web server

We need a web server to serve Prestashop generated content using PHP. Therefore, here we opt for the popular Apache web server. To install it on Ubuntu, run:

sudo apt install apache2

Enable Apache mod_rewrite module

sudo a2enmod rewrite
sudo systemctl restart apache2

3. Install MariaDB database

Well, to store the data we can either use MySQL or its MariaDB fork. Here we go for MariaDB, those who want to use MySQL can follow this Tutorial. Just like Apache, the packages to install the MariaDB server are also available for download using Ubuntu’s default system repository. Therefore, just run:

sudo apt install mariadb-server

To ensure that the database service is up and running, use:

sudo systemctl enable --now mariadb

Now secure your Database instance:

sudo mysql_secure_installation

Questions Answers

Enter the current password for root (enter for none): Hit it Walk in key
Switch to unix_socket authentication [Y/n]: Type – there and press the Enter key
Change root password? [Y/n]: If you want to change the root password for MariaDB, press Yes Otherwise – not

Delete anonymous users? [Y/n]: Type – there and press the Enter key
Forbid remote root login? [Y/n]: Type – there and press the Enter key
Delete the test database and access it. [Y/n]: Type – there and press the Enter key
Reload privilege tables now? [Y/n]: Type – y and press the Enter key

Secure installation of MariaDB

4. Create a database for PrestaShop

Now, let’s create a database to store data generated by PrestaShop during installation and later, such as product data, users, etc.

sudo mysql

To note:presta_h2s is the database here and prestauser is the user and the password is the password we used for the database user. Modify them according to your choice.

Create a database

create database `presta_h2s`;

Create a user with a password

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

Grant all database permissions to user

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

5. Install PHP 7.4 on Ubuntu 22.04

As we know that PrestaShop is a PHP based e-commerce platform, therefore our system should have PHP and required extensions for this platform to work properly. PHP version when writing this article on Ubuntu 22.04 was PHP8.1. However, the PrestaShop requirement was PHP7.4, so we need to install it. But PHP 7.4 is not available to use default system repository, so add Ondrej PPA.

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y

Now install PHP 7.4:

sudo apt install php7.4 php7.4-{cli,common,curl,zip,gd,mysql,xml,mbstring,json,intl}

Now change memory and file upload limits.

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

php -i | grep -i php.ini

Now see the path and use it for modify the php.ini case

In our case it was:

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

install PHP 7.4 on Ubuntu 22.04

Find two lines:

Change the memory_limit value to 128M

memory_limit= 128M

FIX PHP memory limit

And also increase the file upload size to 16MB or 32MB depending on your needs.

upload_max_filesize = 32M

Download MAX size PHP prestashop ubuntu 22.04

Save the file using CTRL+Opress the Walk in key, then exit the file using CTRL+X.

Finally, restart apache

sudo systemctl restart apache2

6. Download PrestaShop on Ubuntu 22.04

Get the latest version of PrestaShop directly on your system using the command terminal. Here is the link of Github page to get the latest version, however, use the given command to download it.

sudo apt install curl
cd /tmp
curl -s https://api.github.com/repos/PrestaShop/PrestaShop/releases/latest | grep "browser_download_url.*zip" | cut -d : -f 2,3 | tr -d " | wget -qi -

7. Unzip and move Prestashop to www folder

After downloading the latest version of PrestaShop, unzip it and move the folder to the webroot directory of the web server. Thus, it could be safely used to call through a web browser.

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

To note: If you don’t have a decompression tool, install it using the command:sudo apt install unzip

8. Change Permission for Apache User

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

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

9. Configure PrestaShop Virtual Host for Apache

If you plan to use multiple domains on your Apache web server, creating a virtual host for Prestashop will be a great idea. It will also allow us to use our domain to access the front-end and back-end of PrestaShop without showing the directory where we have kept all its files. So create a new Apache configuration file and enable it.

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

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

To note: change your_example.comthe domain you want to use for PrestaShop.


ServerAdmin [email protected]_example.com
ServerName your_example.com
ServerAlias www.your_example.com
DocumentRoot /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 Apache Prestashop configuration and restart the web server.

sudo a2ensite prestashop.conf

Disable Default Apache Page

sudo a2dissite 000-default.conf
sudo systemctl restart apache2

10. Access Ubuntu 22.04 by running Ecommerce Store

Everything is ready and it’s time to go to our PrestaShop e-commerce store installed on Ubuntu 22.04 or 20.04 for further settings. Open the Navigator on your local system and type the IP adress Where domain.com pointing to the store.

http://ip-address

http://your_domain.com

11. Select language

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

Select Prestashop Ubuntu 22.04 language installation

Accept license

License agreements

12. Information about your Store

Give it to your shop; select the category in which the products of your store are located; Install demo data- If you want the system to install demo data such as product images, etc., select the YES option otherwise NOPE. After that, select the country, hours and if you want Prestashop to enable SSL. However, disable it for now, as we can also enable it later.

Information about your store

After that scroll down and create an administrator account.

Set admin user account

13. Connect the database to PrestaShop

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

Prestashop database setup

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

Presta backend login details

14. Login to PrestaShop Backend running on Ubuntu 22.04

To login to the backend, just type admin at the end of your PrestaShop e-commerce URL. For instance http://www.domain.com/admin Where http://ip-address/admin

But as we try to login, an error appears “For security reasons, you cannot login to the back office until you delete the installation folder”

To delete the installation folder, run the command below on the server:

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

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

Enter login information

15. To change URL or domain

Those who wish to change the URL or domain to access PrestaShop later can do so from the main interface of the platform. In the left menu bar, select “Shop Preferences” Traffic and SEO SEO and URLs Set the store URL.

To Change Prestashop Ubuntu 22.04 URL or Domain

16. The demo interface

Here is the Frontend we got after installing PrestaShop demo data.

Install PrestaShop on Ubuntu Server 22.04

Other Items:

How to install PrestaShop on Almalinux 8
How to Install PrestaShop on Ubuntu 20.04 Server
Install Prestashop modules manually
How to Install WordPress on Ubuntu 22.04 LTS

Comments are closed.