In this article, we are going to teach you How to Install OpenCart on AlmaLinux 8. The OpenCart Store Builder system is one of the most popular systems used in online stores in online stores today and provides a professional and reliable foundation for building a successful online store. OpenCart has extensive features that give you strong control over your store customization.

Introduction To OpenCart

OpenCart is a free open-source E-commerce Content Management System for online merchants. You can create a complete and unique online store to introduce goods or sell goods and products online and use it for work and business on the Internet. OpenCart is an out-of-the-box shopping cart solution. It is easy to install, you should just choose your template, add products and finally be ready to accept the orders. It supports a wide range of E-commerce websites across the length and breadth of the global market. You can help liven up the potential of your online store with OpenCart tools.

Prerequisites To Install OpenCart on AlmaLinux 8

1. A Linux VPS server running AlmaLinux 8

2. A root password is configured on your server

How To Install OpenCart on AlmaLinux 8

Create cloud Server

Log in to your server first. Create a new server and select AlmaLinux as the operating system with at least 2 GB of RAM. Connect to the Server via SSH and log in using the credentials highlighted at the top. Once logged in to the server, run the following command to update the base system to the latest available packages:

dnf update -y

Installing Apache, MariaDB, and PHP on AlmaLinux

First, you need to install the Apache and MariaDB web server on the system and install them using the following command:

dnf install httpd mariadb-server -y

After installing both packages, you need to install PHP version 8.0 and all the required extensions. By default, PHP 8.0 is not included in the default AlmaLinux repository, so you must install the PHP REMI repository on your system. First, install the EPEL and REMI package with the following command:

dnf install epel-release -y
dnf install

In the next step, reset the default PHP module and activate the PHP REMI 8.0 module with the following command:

dnf module reset php
dnf module enable php:remi-8.0

Install PHP 8.0 with all the required extensions using the following command:

dnf install php php-gd php-ldap php-zip php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mysqlnd php-snmp php-soap curl curl-devel unzip git -y

After installing all the packages, launch the Apache and MariaDB services with the following command and enable them to start the system by restarting:

systemctl start httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb

How to Create OpenCart Database on AlmaLinux

Secure the MariaDB installation and set the MariaDB root password using the following command:


Answer all the questions as follows:

Enter current password for root (enter for none): 
Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

Then enter MariaDB using the following command:

mysql -u root -p

After logging in, create the user and database using the following command:

CREATE USER 'opencart'@'localhost' IDENTIFIED BY 'password';

Give all points to the OpenCart database with the following command:

GRANT ALL PRIVILEGES ON opencart.* TO 'opencart'@'localhost';

Empty the points and exit MariaDB with the following command:


How To Download OpenCart

Download the latest version of OpenCart from the GitHub repository using the following command:

git clone

Once the download is complete, change the directory to a download directory and copy the upload directory to the Apache web root directory:

cd opencart
mv upload /var/www/html/opencart

You must also copy the sample configuration file:

cp /var/www/html/opencart/config-dist.php /var/www/html/opencart/config.php
cp /var/www/html/opencart/admin/config-dist.php /var/www/html/opencart/admin/config.php

Then, set up the appropriate licenses and ownership using the following command:

chown -R apache:apache /var/www/html/opencart
chmod -R 755 /var/www/html/opencart

How To Configure Apache to Host OpenCart

In this step, you need to create the Apache virtual host configuration file for OpenCart hosting on the Internet:

nano /etc/httpd/conf.d/opencart.conf

Add the following commands:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html/opencart/
<Directory /var/www/html/opencart/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
ErrorLog /var/log/httpd/
CustomLog /var/log/httpd/ common

Save and close the file, and restart the Apache service for the changes to take effect:

systemctl restart httpd

How To Configure a Firewall

If you are using a firewall, enable HTTP and HTTPS services through the firewall. Allow them to use the following command:

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https

Reload the firewall to make the changes:

firewall-cmd --reload

How to Access OpenCart Web UI

Access the OpenCart web interface now using the URL You should see the following page:

How to Access OpenCart Web UI

Accept the license agreement and click the Continue button. You should see the following page:

How to Access OpenCart Web UI


Make sure all PHP extensions are installed then click the Continue button and you should see the following page:


How to Access OpenCart Web UI


Enter the details of the database, admin username, and password, and click the Continue button. You should see the following page:

How to Access OpenCart Web UI

Open the terminal and delete the installation directory using the following command:

rm -rf /var/www/html/opencart/install

Go back to the OpenCart web interface and click on Login to Administration. You should see the OpenCart login page:

How to Access OpenCart Web UI

Enter the admin username and password and click the login button. You should see the OpenCart dashboard on the following page:

How to Access OpenCart Web UI


Your OpenCart platform is now ready to use. This article taught you how to install OpenCart on AlmaLinux 8. You can now deploy your own online store using OpenCart. We hope you find this article useful. Share your comments with us via the form below.


Is Opencart free to use?

Opencart is a free and increasingly popular open-source e-commerce platform that allows businesses to create a high-tailored experience.

Can we make money on Opencart?

Yes. Earn reward points by purchasing a product from a purchase referral link. Earn rewards by inviting customers.
Rate this post