PrestaShop is a popular and powerful open-source eCommerce platform that allows businesses to create, customize, and manage an online store. It supports multiple payment methods, themes, and modules, making it ideal for creating scalable and professional online shops.


Why Use PrestaShop?

  • Wide Range of Features: PrestaShop offers a robust set of features for managing products, orders, and customers.
  • Flexibility: With over 3,000 modules and numerous themes available, PrestaShop is highly customizable.
  • Multilingual: Support for multiple languages and currencies makes it easy to manage stores serving different markets.
  • Payment Gateway Support: Integration with many payment gateways like PayPal, Stripe, and others.

Step 1: Set Up a Cloud Instance

Before we begin the installation process, you’ll need a cloud instance where the FTP server will run. Follow these steps to create one:

Step 1.1: Access Your Provider’s Dashboard

  • Log into your hosting provider’s control panel and find the option to create a new instance or server.
Shape.host Resources dashboard with Create > Instance highlighted.

Step 1.2: Select Data Center Location

  • Choose the data center location that is geographically closest to your users or target audience for optimal performance.
Shape.host instance form with the data center location selector highlighted.

Step 1.3: Configure the Server Plan and Operating System

  • Pick the server plan that meets your needs in terms of CPU, memory, and storage.
  • Select AlmaLInux 9 as the operating system for the instance.
Shape.host instance form with the operating system image selector highlighted.

Step 1.4: Finalize the Instance Creation

  • Provide the necessary details like hostname and authentication method (SSH keys or password), then initiate the creation of your instance.
Shape.host instance form with the Create Instance button highlighted.

Step 1.5: Locate Your Instance’s IP Address

  • After the instance is created, retrieve the public IP address from the instance’s details. This will be needed to connect remotely and configure the server.
Shape.host Resources dashboard with the server IP address highlighted.

Connecting to the Instance

Once your instance is created, follow these steps to connect to it:

  1. Obtain Your IP Address: After creating the instance, you will be provided with an IP address. Make sure to copy it.
  2. Use SSH to Connect: Open a terminal (on Linux or macOS) or an SSH client (such as PuTTY for Windows), and run the following command to connect to your AlmaLinux instance:
   ssh root@<your-ip-address>

Replace <your-ip-address> with the actual IP address of your instance.

  1. Accept the SSH Key: If this is your first time connecting to the instance, you will be prompted to accept the server’s SSH key. Type yes and press Enter.
  2. Enter Your Password: Input the root password you set when creating the instance.

You should now be logged into your AlmaLinux server and ready to proceed with the PrestaShop installation.


Step 2: Update the System

Start by updating the system packages:

dnf update -y
reboot
Terminal showing DNF/YUM package management commands and output.

Step 3: Install EPEL and Remi Repository

To enable additional PHP versions and packages, install the EPEL and Remi repositories:

dnf install epel-release dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm
Terminal showing DNF/YUM package management commands and output.

Step 4: Enable PHP 8.2

Reset the default PHP module and enable PHP 8.2 from the Remi repository:

dnf module reset php
dnf module enable php:remi-8.2
Terminal showing DNF/YUM package management commands and output.

Step 5: Install Apache, MariaDB, and PHP with Required Extensions

Install Apache, MariaDB, PHP, and the required PHP extensions for PrestaShop:

dnf install httpd mariadb-server php php-curl php-soap php-intl php-zip php-cli php-mysqlnd php-common php-opcache php-memcached php-bcmath php-gd php-mbstring php-xml php-gmp php-imagick -y
Terminal showing DNF/YUM package management commands and output.

Step 6: Enable and Start Apache and MariaDB

Enable and start both the Apache and MariaDB services:

systemctl enable httpd
systemctl start httpd
systemctl status httpd
Terminal showing systemd service management commands or output.
Terminal showing systemd service management commands or output.
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb
Terminal showing systemd service management commands or output.
Terminal showing systemd service management commands or output.

Step 7: Verify PHP Installation

Verify that PHP and its extensions are correctly installed:

php -v
php -m
Terminal showing php commands or output during Verify PHP Installation.

Step 8: Configure Firewall

Make sure your firewall allows HTTP and HTTPS traffic by enabling the services and reloading the firewall:

systemctl unmask firewalld
systemctl start firewalld
firewall-cmd --add-service={http,https} --permanent
firewall-cmd --reload
firewall-cmd --list-all
Terminal showing firewall configuration commands and rules.
Terminal showing firewall configuration commands and rules.
Terminal displaying firewalld zone rules and services.

Step 9: Edit PHP Configuration

Edit the PHP configuration file to meet PrestaShop’s requirements:

nano /etc/php.ini
Terminal showing nano commands or output during Edit PHP Configuration.

Make the following changes:

date.timezone = Europe/Paris
max_execution_time = 130
memory_limit = 256M
allow_url_fopen = On
allow_url_include = Off
post_max_size = 128M
upload_max_filesize = 128M
max_input_vars = 5000

Restart Apache to apply the changes:

systemctl restart httpd
Terminal showing systemd service management commands or output.

Step 10: Secure MariaDB Installation

Run the MariaDB security installation script to set up a secure database environment:

mariadb-secure-installation
Terminal showing MariaDB/MySQL database security configuration prompts.

Log into MariaDB as root to verify it’s working properly:

mariadb -u root -p

Once logged in, execute the following queries to create a new database prestashopdb with user prestashop and password psp4ssw0rd.

CREATE DATABASE prestashopdb;
GRANT ALL PRIVILEGES ON prestashopdb.* TO 'prestashop'@'localhost' IDENTIFIED BY 'psp4ssw0rd';
FLUSH PRIVILEGES;
SHOW GRANTS FOR prestashop@localhost;
QUIT
Terminal showing SQL database and user configuration commands.

Step 11: Download PrestaShop

Navigate to the web root and download the PrestaShop package:

cd /var/www/html/
wget https://github.com/PrestaShop/php-ps-info/archive/refs/tags/v1.1.tar.gz
tar -xzvf v1.1.tar.gz
mv php-ps-info-1.1 check-ps
Terminal showing file download commands and transfer output.
Terminal showing file and directory setup commands.

Download PrestaShop:

cd /var/www/
wget https://github.com/PrestaShop/PrestaShop/releases/download/8.1.3/prestashop_8.1.3.zip
unzip prestashop_8.1.3.zip -d /var/www/prestashop
Terminal showing file download commands and transfer output.
Terminal showing unzip commands or output during Download PrestaShop.

Step 12: Set Correct File Permissions

Ensure that Apache has ownership of the PrestaShop files and assign the appropriate permissions:

chown -R apache:apache /var/www/prestashop
chmod u+rw /var/www/prestashop
Terminal showing file ownership or permission commands.

Step 13: Configure Apache for PrestaShop

Create a new Apache virtual host configuration for PrestaShop:

nano /etc/httpd/conf.d/prestashop.conf
Terminal showing nano commands or output during Configure Apache for PrestaShop.

Add the following configuration:

<VirtualHost *:80>
    ServerName example.comt
    ServerAdmin contact@example.com
    DocumentRoot /var/www/prestashop

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

    ErrorLog /var/log/httpd/prestashop_error.log
    CustomLog /var/log/httpd/prestashop_access.log combined
</VirtualHost>
Terminal showing web server configuration text.

Test the Apache configuration and restart the service:

apachectl configtest
systemctl restart httpd
Terminal showing an Apache configuration test.
Terminal showing systemd service management commands or output.

Step 14: Secure PrestaShop with Let’s Encrypt SSL

Install Certbot and configure SSL with Let’s Encrypt:

dnf install -y certbot python3-certbot-apache
Terminal showing DNF/YUM package management commands and output.

Run Certbot to obtain and install the SSL certificate:

certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email contact@shape.host -d almalinux.shape.host
Terminal showing Certbot certificate commands and messages.

Step 15: Access PrestaShop from the Browser

Once you have successfully installed PrestaShop on the server, follow these steps to complete the installation through your browser.

  1. Open your web browser and navigate to http://<your-domain-or-ip>/install (replace <your-domain-or-ip> with your actual domain name or server IP). You will be greeted by the PrestaShop Installation Assistant. Choose Language
  2. Choose Your Language: Select your preferred language from the dropdown menu and click Next to proceed.
  3. License Agreements: Read the PrestaShop license agreement and accept the terms. License Agreements
  4. System Compatibility: Ensure that your server environment is compatible with PrestaShop. System Compatibility
  5. Store Information: Enter your store and administrator details, such as name, email, and password. Store Information
  6. Content of Your Store: Choose whether to install demo products or not. Content of Store
  7. System Configuration: Enter your database credentials. System Configuration
  1. Store Installation: The PrestaShop installer will now install the necessary components. Store Installation Progress
  2. Installation Complete: Once the installation is finished, you will receive your administrator login details for the Back Office. It will show your email and password used for the login. For security reasons, PrestaShop will prompt you to delete the install folder. Make sure to follow this step by running the following command to remove the installation folder:
  1. PrestaShop Dashboard: After logging into the Back Office, you will be taken to the PrestaShop Dashboard. Here, you can manage orders, products, customers, and configure your store as per your requirements. PrestaShop Dashboard

Important Step: Remove the Install Directory

After completing the installation via the browser, it is critical to delete the installation directory to secure your store. Run the following command to remove the directory:

rm -rf /var/www/prestashop/install

Without removing this directory, your store will remain vulnerable to potential attacks. Make sure to complete this step after finalizing the browser installation.

You have now completed the installation of PrestaShop on AlmaLinux 9. Your online store is now up and running, and you can start configuring it with products, shipping methods, payment gateways, and more. PrestaShop provides powerful tools to help manage your business efficiently, from managing stock to handling customer orders.

For better performance and reliability, consider using Shape.Host‘s Linux SSD VPS services, optimized for hosting demanding eCommerce platforms like PrestaShop. With high-speed SSDs, you can ensure a smooth shopping experience for your customers.