How to Install Bagisto eCommerce Platform on Ubuntu 20.04

how to install bagisto ecommerce platform on ubuntu 20.04

Bagisto is the popular open-source eCommerce platform built on the hottest technologies Laravel & Vue.js. A complete eCommerce solution built for merchants to cater to their online shop needs and very easy for developers to contribute and build. Bagisto has a built-in easy navigable admin panel and is bundled with functionalities like Multi-Currency, Multi-Localization, Access Control Level, Multi-Channel, Payment integration, and much more.

In this post, we will show you how to install the Bagisto E-Commerce platform on an Ubuntu 20.04 server.

Prerequisites

  • An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
  • Access to the root user account (or access to an admin account with root privileges)

Log in to the Server & Update the Server OS Packages

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

Before starting, you have to make sure that all Ubuntu 20.04 OS packages installed on the server are up to date. You can do this by running the following commands:

apt-get update -y

Install LAMP Server

Before starting, the LAMP stack must be installed on your server. If not installed, you can install it using the following command:

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-mysql php-gmp php-curl php-intl php-mbstring php-xmlrpc php-gd php-bcmath php-imap php-xml php-cli php-zip curl unzip git -y

Once the LAMP stack is installed, edit the php.ini file and modify some default settings:

nano /etc/php/7.4/apache2/php.ini

Change the following lines:

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America/Chicago

Save and close the file then restart the Apache service to apply the changes:

systemctl restart apache2

Create Bagisto Database

Bagisto uses MySQL/MariaDB to store its contents. So you will need to create a database and user for Bagisto.

First, log in to MariaDB with the following command:

mysql

Once login, create a database and user with the following command:

MariaDB [(none)]> CREATE DATABASE bagistodb;
MariaDB [(none)]> CREATE USER 'bagistouser'@'localhost' IDENTIFIED BY 'securepassword';

Next, grant all the privileges to the Bagisto database using the command below:

MariaDB [(none)]> GRANT ALL ON bagistodb.* TO 'bagistouser'@'localhost' WITH GRANT OPTION;

Next, flush the privileges and exit from the MariaDB with the following command:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Install Node.js

You will also need to install Node.js to your server. First, add the Node source repository using the following command:

curl -sL https://deb.nodesource.com/setup_14.x | bash -

Next, install the Node.js with the following command:

apt-get install nodejs -y

Once Node.js is installed, verify the Node.js version using the following command:

node -v

You should see the following output:

v14.17.4

Download Bagisto

First, you will need to install the Composer for managing PHP dependencies. You can install it with the following command:

curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

Next, download the latest version of Bagisto using the following command:

wget https://github.com/bagisto/bagisto/archive/refs/tags/v1.3.1.zip

Once the download is completed, unzip the downloaded file with the following command:

unzip v1.3.1.zip

Next, move the extracted directory to the Apache web root directory:

mv bagisto-1.3.1 /var/www/html/bagisto

Next, navigate to Bagisto directory and install the PHP dependencies using the following command:

cd /var/www/html/bagisto
composer install

Once all the PHP dependencies are installed, set proper ownership to Bagisto directory:

chown -R www-data:www-data /var/www/html/bagisto/

Configure Apache for Bagisto

Next, you will need to create an Apache virtual host configuration file for Bagisto. You can create it with the following command:

nano /etc/apache2/sites-available/bagisto.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmi admin@example.com
     DocumentRoot /var/www/html/bagisto/public
     ServerName bagisto.example.com

     <Directory /var/www/html/bagisto/public/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Save and close the file then activate the Bagisto virtual host and rewrite module with the following command:

a2ensite bagisto.conf
a2enmod rewrite

Next, restart the Apache service to apply the changes:

systemctl restart apache2

Access Bagisto Web Interface

Now, open your web browser and access the Bagisto web UI using the URL http://bagisto.example.com. You should see the following screen:

install bagisto ecommerce platform on ubuntu 20.04
Make sure all the PHP dependencies are installed then click on the Continue button. You should see the following screen:
set up and configure bagisto ecommerce platform on ubuntu 20.04
Provide your application name, URL, Currency, TimeZone, Locale, and click on the Continue button. You should see the following screen:
configure bagisto ecommerce platform on ubuntu 20.04
Provide your database connection details and click on the Save & Continue button. You should see the following screen:
installing bagisto ecommerce platform on ubuntu 20.04

Click on the Start installation button. You should see the following screen:

Click on the Continue button. You should see the following screen:

Provide your admin username, email, password, and click on the Continue button. You should see the following screen:

Provide your email configuration and click on the Save configuration button. Once the installation has been completed, you should see the following screen:

install bagisto on ubuntu 20.04

Click on Launch the admin interface. You should see the Bagisto login page:

Provide your admin username, password and click on the Sign-in button. You should see the Bagisto dashboard on the following screen:

Congratulations! you have successfully installed Bagisto on Ubuntu 20.04.

Of course, you don’t have to install Bagisto yourself if you use our Managed Bagisto Hosting services, in which case you can simply ask our expert Linux admins to install Bagisto on Ubuntu 20.04, for you. They are available 24/7 and will take care of your request immediately.

PS. If you liked this post on how to install Bagisto on Ubuntu 20.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment