AbanteCart on Ubuntu 22.04

How to Install AbanteCart on Ubuntu 22.04

AbanteCart is an open-source e-commerce platform based on PHP. It is an ideal e-commerce solution for small to medium businesses.

In this tutorial, we will show you how to install AbanteCart on Ubuntu 22.04 OS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges.

Step 1: Update Operating System

Update your Ubuntu 22.04 operating system to the latest version with the following command:

# apt update && sudo apt upgrade -y

Step 2: Install Apache webserver

The Apache HTTP Server is a free and open-source cross-platform web server. You can install it via apt package manager by executing the following command.

# apt install apache2

You can start the Apache service and configure it to run on startup by entering the following commands:

# systemctl start apache2
# systemctl enable apache2

Verify the status of the Apache service using systemctl status command:

# systemctl status apache2


 apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running)
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 3548 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 3552 (apache2)
      Tasks: 7 (limit: 2196)
     Memory: 46.8M         CPU: 1.594s
     CGroup: /system.slice/apache2.service
             ├─3552 /usr/sbin/apache2 -k start
             ├─3554 /usr/sbin/apache2 -k start
             ├─3555 /usr/sbin/apache2 -k start
             ├─3556 /usr/sbin/apache2 -k start

Step 3: Install PHP

To install PHP and additional PHP modules to support AbanteCart, run the following command:

# apt-get install php php-cli libapache2-mod-php php-common php-mbstring php-gd php-intl php-xml php-mysql php-zip php-curl php-xmlrpc

Verify if PHP is installed.

php -v
PHP 8.1.2-1ubuntu2.9 (cli) (built: Oct 19 2022 14:58:09) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.9, Copyright (c), by Zend Technologies

Also, disable the php-opcache module to avoid AbanteCart installation time errors.

# phpdismod opcache

Restart Apache for changes to take effect.

# systemctl restart apache2

Step 4: Install MySQL and create a database

You can install the MySQL server with the following command:

# apt install mysql-server

Start the database server daemon, and also enable it to start automatically at the next boot with the following commands:

# systemctl start mysql
# systemctl enable mysql

Verify the status of the MySQL service using systemctl status command:

# systemctl status mysql


 mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running)
   Main PID: 1083 (mysqld)
     Status: "Server is operational"
      Tasks: 41 (limit: 2797)
     Memory: 434.0M
        CPU: 1min 57.932s
     CGroup: /system.slice/mysql.service
             └─1083 /usr/sbin/mysqld

By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script.

# mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] Y
- 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

Now run the command below to log in to the MariaDB shell.

# mysql -u root -p

Once you are logged in to your database server you need to create a database for the AbanteCart installation:

mysql> CREATE DATABASE abantecart;
mysql> CREATE USER 'abantecart'@'localhost' IDENTIFIED BY 'Your-Strong-Password';
mysql> GRANT ALL PRIVILEGES ON abantecart . * TO 'abantecart'@'localhost';
mysql> exit;

Step 5: Download AbanteCart

By default, AbanteCart is not available on Ubuntu 20.04 base repository. You can download the latest version of AbanteCart from the Git repository using the following command:

# wget https://github.com/abantecart/abantecart-src/archive/master.zip

Once the download is completed extract the downloaded package using unzip command:

# apt -y install unzip 
# unzip master.zip -d /var/www/

Then, create the public web root directory for Abantecart:

# mkdir /var/www/abantecart

Move the extracted abantecart-src-master/public_html directory to the /var/www/abantecart/ directory:

# mv /var/www/abantecart-src-master/public_html/* /var/www/abantecart/

Enable permission for the Apache webserver user to access the files:

# chown -R www-data:www-data /var/www/abantecart/

Step 6: Create Virtualhost for Abantecart

Then, create an virtual host configuration file to host AbanteCart:

# nano /etc/apache2/sites-available/abantecart.conf

Paste the content as shown below:

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/abantecart/
    ServerName your-domain.com
    ServerAlias www.your-domain.com

    <Directory /var/www/abantecart/>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all

    ErrorLog /var/log/apache2/your-domain.com-error_log
    CustomLog /var/log/apache2/your-domain.com-access_log common

Remember to replace your-domain.com with the domain name of your server.

Save and exit the configuration file.

To enable this site run the command:

# a2ensite abantecart.conf

To implement the changes, restart Apache webserver:

# systemctl restart apache2

Step 7: Access AbanteCart Web Interface

To access the AbanteCart Web Interface, go to your browser and visit http://your-domain.com/.

The first page displays the license agreement. Scroll down Accept the License agreement and click Continue.

AbanteCart License

Make sure all the required PHP extensions are installed then click on the Continue button.

AbanteCart Compatibility Validation

The next page will require you to fill in the database details. Configure the database and admin credentials and click Continue.

AbanteCart Configuration

Once the installation has been completed, you should see the following page:

Completed Installation

Then if you click on the Your Online Shop you should see your shop page:

Frontend Page

Or if you click on the Login to your Control Panel button you should see the login page:

Login Page

Provide your admin username, password and click on the Login button. You should see your administration panel:

AbanteCart Dashboard


Now, open your terminal and remove the installation directory with the following command:

# rm -rf /var/www/abantecart/install/

Comments and Conclusion

Congratulations! You have successfully installed AbanteCart. Thanks for using this tutorial for installing the AbanteCart on Ubuntu 22.04 OS.

For additional help or useful information, we recommend you to check the official AbanteCart website.

Leave a Reply

Your email address will not be published. Required fields are marked *