How to Install Prestashop on Ubuntu 24.04

PrestaShop is a well-known e-commerce platform that allows users to easily create and manage their online stores. It’s known for its extensive feature set and customization options, making it a go-to choice for many online merchants. Installing PrestaShop on Ubuntu 24.04 serves the purpose of setting up a powerful, free, and open-source e-commerce platform using a reliable and secure operating system. 

This tutorial will teach the step-by-step procedure for setting up PrestaShop on an Ubuntu 24.04 server.

How to Install Prestashop on Ubuntu 24.04

Utilizing Ubuntu for this installation ensures a stable environment that can leverage the LAMP stack Linux, Apache, MySQL/MariaDB, and PHP for optimal performance and security.

To Install Prestashop on Ubuntu 24.04, follow the below step-by-step instructions:

Step 1: Install Apache Web Server

PrestaShop requires a web server to function, and Apache is a robust choice. To install Apache, run the following commands:

sudo apt update
sudo apt-get install apache2 -y

After installation, users can enable and check the status of Apache to make sure that it’s running:

sudo systemctl enable apache2
sudo systemctl status apache2

Step 2: Install MariaDB

PrestaShop supports MySQL/MariaDB as its database. Let’s install MariaDB using the below command:

sudo apt install mariadb-server

Secure your installation and set a root password with the below one:

sudo mysql_secure_installation

Step 3: Install PHP

PrestaShop requires PHP to execute its scripts. PHP 7.4 is required for PrestaShop, so install it along with necessary extensions like “php7.4-xml” and “php7.4-curl”. Let’s install PHP and necessary extensions with the below commands:

sudo apt install software-properties-common apt-transport-https
sudo add-apt-repository ppa:ondrej/php   # Add Repository
sudo apt update
sudo apt install php7.4-{curl,fpm,gd,intl,mbstring,mysql,xml,zip}

Step 4: Enable and Check PHP-FPM

After installing the PHP 7.4 version, enable the dependency proxy and PHP-FPM module. After that, restart Apache as below:

sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.4-fpm
sudo systemctl status php7.4-fpm
sudo systemctl reload apache2

Step 5: Download PrestaShop

Download the latest version of PrestaShop from the official website or use wget to download it directly to your server. Then, extract the PrestaShop archive to the desired directory, and assign ownership of the directory to the web server user:

wget https://github.com/PrestaShop/PrestaShop/releases/download/1.7.8.11/prestashop_1.7.8.11.zip                                          # Download PrestaShop
sudo unzip prestashop_1.7.8.11.zip -d /var/www/html/prestashop  # unzip prestashop
sudo chown -R www-data:www-data /var/www/html/prestashop/ # Assign Directory Ownership
sudo chmod -R 755 /var/www/html/prestashop

To install unzip, use the “sudo apt install unzip” command.

Step 6: Create a Database for PrestaShop

Before running the installation script, you need to create a MySQL database for your store. It is possible via the hosting provider’s control panel. Let’s log in to MariaDB and create a database and user for PrestaShop:

sudo mysql -u root -pCREATE DATABASE prestashop;
GRANT ALL PRIVILEGES ON prestashop.* TO 'minhal'@'localhost' IDENTIFIED BY '1212';
FLUSH PRIVILEGES;
EXIT;

Step 7: Configure Apache for PrestaShop

After setting up the database, create an Apache virtual host file for your PrestaShop site:

nano /etc/apache2/sites-available/prestashop.conf
<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName presta.example.com
    ServerAlias www.your_domain
    DocumentRoot /var/www/html/prestashop   <Directory /var/www/html/prestashop>        Options FollowSymlinks        AllowOverride All        Require all granted    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Install Prestashop on Ubuntu 24.04 a

To enable the PrestaShop site configuration within the Apache web server and then restart Apache to apply the changes, use the below commands. Let’s enable the site and restart Apache:

sudo a2ensite prestashop.conf
sudo systemctl restart apache2

Step 8: Install PrestaShop

Navigate to your domain in a web browser and follow the PrestaShop installation wizard to complete the setup by navigating to the “http://your_domain.com/” or IP address.

 If you’re looking to set up your own PrestaShop store, using the Installation Assistant can simplify the process. Ensure you have the correct version that meets your hosting environment’s requirements:

Install Prestashop on Ubuntu 24.04 b

Accept the agreement and move forward by hitting the “Next” button:

Install Prestashop on Ubuntu 24.04 c

The assistant will ask you to fill in details about your store, such as store name, activity, country, and desired configurations. After that, hit the “Next” button at the end of the page:

Users can also install the demo product that is based on their preferences. Then, hit the “Next” button:

Install Prestashop on Ubuntu 24.04 d

Now, input the database information you already created. The assistant will then check if your system meets all the requirements for a successful PrestaShop installation. Finally, hit the “Next” button as below:

Install Prestashop on Ubuntu 24.04 e

Note: After the installation is complete, you’ll be prompted to delete the ‘install’ folder for security reasons and to rename the “admin” folder to something unique to you.

Once all configurations are set, the Installation Assistant will proceed with installing PrestaShop on your server. This may take a few minutes. With the installation done, users access the store’s front office by navigating to the domain and the back office. For instance, hit the store’s front office: 

Install Prestashop on Ubuntu 24.04 f

Finally, users can now access their store’s front office that can authenticate as below:

Install Prestashop on Ubuntu 24.04 g

By following these steps, you’ll have a fully functional PrestaShop e-commerce platform running on your Ubuntu 24.04 server. 

Congratulations on taking the first step towards building your online store with PrestaShop! 

PrestaShop is a versatile open-source e-commerce platform with a variety of features:

  1. Open-Source: Freely accessible for customization and use.
  2. Multi-Store Capabilities: Manage multiple online shops from one central dashboard.
  3. Unlimited Product Listings: No restrictions on the number of products you can sell.
  4. Data Export and Import: Simplifies the transfer of product, customer, and order data.
  5. Advanced SEO Capabilities: Built-in features to enhance search engine visibility.

For detailed instructions, users can navigate to the guide

Conclusion

PrestaShop is designed to provide users with the ability to create their own online stores, offering a fully customizable and feature-rich solution for e-commerce needs. To install PrestaShop on Ubuntu 24.04, set up a LAMP stack on your server. After configuring, download PrestaShop from the official site. Finally, extract it to the web server’s root folder. Create a database and user for PrestaShop in MariaDB, then navigate to the IP address or server’s domain name in the web browser to run the PrestaShop web installer. 

Installing PrestaShop on Ubuntu serves the purpose of setting up a robust and customizable e-commerce platform using a reliable and secure operating system.