How to Install PrestaShop on Debian Latest

Introduction

PrestaShop is a free and open-source e-commerce platform that enables you to create and manage online stores. In this tutorial, we will show you how to install PrestaShop on a Debian latest server.

Prerequisites

Before you start, you need to have the following requirements:

Step 1: Update the System Packages

Before installing any packages, it's necessary to update the system packages using the following command:

$ sudo apt update && sudo apt upgrade

Step 2: Install Apache Web Server

PrestaShop requires a web server to run. You can install Apache using the following command:

$ sudo apt install apache2

Run the following command to enable Apache on boot:

$ sudo systemctl enable apache2

Start the Apache web server using the following command:

$ sudo systemctl start apache2

Step 3: Install MariaDB Database Server

PrestaShop requires a database to store the data. You can install MariaDB using the following command:

$ sudo apt install mariadb-server mariadb-client

Run the following command to enable MariaDB on boot:

$ sudo systemctl enable mariadb

Start the MariaDB service using the following command:

$ sudo systemctl start mariadb

You will need to secure the MariaDB installation by running the mysql_secure_installation command. Follow the prompts to set a password for the root user, remove anonymous user accounts, disable remote root login, and remove test databases.

Step 4: Install PHP and Related Modules

PrestaShop is a PHP-based application, so you need to install PHP along with the necessary modules. You can install PHP and related modules using the following commands:

$ sudo apt install php php-curl php-gd php-mbstring php-intl php-xml php-zip php-mysql

Restart the Apache web server to apply the changes using the following command:

$ sudo systemctl restart apache2

Step 5: Download and Install PrestaShop

You could download PrestaShop from their official website, and the command-line version is shown below.

$ cd /tmp && wget https://www.prestashop.com/download/old/prestashop_1.7.6.5.zip

And now we'll unzip the PrestaShop file to the var/www/html directory.

$ sudo apt install unzip
$ sudo unzip prestashop_1.7.6.5.zip -d /var/www/html/

After unzipping, you will need to set the correct ownership of the files and directories. The following command sets the file ownership to the web server user, which is www-data in Debian:

$ sudo chown -R www-data:www-data /var/www/html/

Step 6: Access PrestaShop Installation Wizard

Before accessing the PrestaShop installation wizard, you need to create a new database and user for PrestaShop.

$ sudo mariadb
> CREATE DATABASE prestashop;
> CREATE USER 'prestashopuser'@'localhost' IDENTIFIED BY 'password';
> GRANT ALL PRIVILEGES ON *.* TO 'prestashopuser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

You can now access the PrestaShop installation wizard in your web browser by navigating to http://your-server-ip/prestashop/install (replace your-server-ip with your server IP address).

Follow the prompts in the installation wizard to configure your installation. When prompted, provide the database name, database username, and password that you created earlier.

Conclusion

That's it! You have now installed PrestaShop on Debian latest. You can log in to your PrestaShop administration dashboard by navigating to your-domain.com/admin.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!