Bagisto is a free and open-source eCommerce platform used for managing multi-tenant businesses. It helps users track inventory, monitor stock levels, and handle orders from a web-based UI. It is built on Laravel and Vue.js, a progressive Javascript framework, and was designed to enable anyone to develop and scale an online business. It provides extensions to support mobile number login, Stripe payment gateway, dropshipping, point-of-sale, and other options to extend the functionality.

This post will show you how to install the Bagisto eCommerce platform on Fedora Linux.

Step 1 – Install Nginx, MariaDB, and PHP

First, update the server and install the Nginx and MariaDB servers using the following commands.

dnf update -y
dnf install nginx mariadb-server -y

Next, add the PHP remi repository.

dnf install -y http://rpms.remirepo.net/fedora/remi-release-34.rpm
dnf module install php:remi-8.0

Then, install PHP with other required extensions using the following command.

dnf install php php-bcmath php-common php-curl php-fpm php-gd php-mbstring php-mysqlnd php-soap php-xml php-xsl php-devel php-pear libsodium-devel
yum --enablerepo=remi install php-intl php-sodium php-zip

Next, install libsodium library and add it to the PHP configuration file.

pecl install libsodium
echo "extension=sodium.so" >> /etc/php.ini

Next, start and enable the Nginx, MariaDB, and PHP-FPM services.

systemctl start nginx mariadb php-fpm
systemctl enable nginx mariadb php-fpm

Step 2 – Create a Database for Bagisto

Bagisto uses MariaDB as a database backend, so you will need to create a database and user for Bagisto.

First, log in to MariaDB with the following command.

mysql

Next, create a database and user for Bagisto.

CREATE DATABASE bagisto;
GRANT ALL on bagisto.* to bagisto@localhost identified by 'password';

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

FLUSH PRIVILEGES;
\q;

Step 3 – Install Node.js and Composer

You will also need to install the Node.js and Composer to your server.

First, install the Node.js package with the following command.

dnf install nodejs npm -y

Next, install Composer using the following command.

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

You can verify the Composer version with the following command.

composer -V

Output:

Composer version 2.6.2 2023-09-03 14:09:15

Step 4 – Install Bagisto

First, navigate to the Nginx web root directory.

cd /var/www/html

Next, install Bagisto using Composer.

composer create-project bagisto/bagisto

You will see the following output.

> Webkul\Core\Events\ComposerEvents::postCreateProject

 ____              _     _
| __ )  __ _  __ _(_)___| |_ ___
|  _ \ / _` |/ _` | / __| __/ _ \
| |_) | (_| | (_| | \__ \ || (_) |
|____/ \__,_|\__, |_|___/\__\___/
             |___/



Welcome to the Bagisto project! Bagisto Community is an open-source e-commerce ecosystem 
which is built on top of Laravel and Vue.js.

Made with 💖  by the Bagisto Team. Happy helping :)

Next, edit the Bagisto environment file.

nano bagisto/.env

Modify the following lines.

APP_URL=http://bagisto.example.com
DB_DATABASE=bagisto
DB_USERNAME=bagisto
DB_PASSWORD=password
DB_PREFIX=bgs_

Save and close the file, then install the Bagisto with the following command.

cd bagisto
php artisan bagisto:install

You will see the following output.

-----------------------------
Congratulations!
The installation has been finished and you can now use Bagisto.
Go to http://bagisto.example.com/admin and authenticate with:
Email: [email protected]
Password: admin123
Cheers!

Note down the admin username and password from the above output.

Step 5 – Configure Nginx for Bagisto

Next, you must create a Nginx virtual host configuration file to serve Bagisto.

nano /etc/nginx/conf.d/bagisto.conf

Add the following configurations.

server {
   listen 80;
   server_name bagisto.example.com;
   root /var/www/html/bagisto/public;

   add_header X-Frame-Options "SAMEORIGIN";
   add_header X-Content-Type-Options "nosniff";

   index index.php;

   charset utf-8;

   location / {
      try_files $uri $uri/ /index.php?$query_string;
   }

   location = /favicon.ico { access_log off; log_not_found off; }
   location = /robots.txt { access_log off; log_not_found off; }

   error_page 404 /index.php;

   location ~ \.php$ {
      fastcgi_pass unix:/run/php-fpm/www.sock;
      fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
      include fastcgi_params;
   }

   location ~ /\.(?!well-known).* {
      deny all;
   }
}

Save the file, then edit the Nginx main configuration file.

nano /etc/nginx/nginx.conf

Add the following line after the line http{:

server_names_hash_bucket_size 64;

Save the file, then set permissions and ownership to the Bagisto directory.

chown -R nginx:nginx /var/www/html/bagisto
chmod -R 777 /var/www/html/bagisto

Finally, restart the Nginx and PHP-FPM services.

systemctl restart nginx php-fpm

Step 6 – Access Bagisto Web Interface

Now, open your web browser and access the Bagisto admin panel using the URL http://bagisto.example.com/admin/. You will see the Bagisto login screen.

Provide your admin username and password and click on the Sign in button. You will see the Bagisto dashboard on the following screen.

Conclusion

Congratulations! You have successfully installed Bagisto on Fedora Linux. You can now explore the Bagisto features and start managing your stocks and inventory from a central location. Try to deploy Bagisto on dedicated server hosting from Atlantic.Net!