Building an e-commerce platform is now easier thanks to open-source solutions like Bagisto. This e-commerce platform offers high flexibility, optimal performance, and comprehensive features to build a modern online store. If you want to run Bagisto on your own server (self-hosted), this guide will walk you through everything from an introduction, key features, to a complete installation on Ubuntu using Nginx.
1. Introduction to Bagisto
Bagisto is an open-source e-commerce platform based on Laravel and Vue.js, developed by Webkul. Designed for ease of development, high performance, and scalability, Bagisto allows you to build a modern online store with complete features such as product management, orders, customers, multi-store, multi-channel, and much more. Thanks to its modular architecture, Bagisto is suitable for small businesses to enterprise-level organizations that require a flexible and fully customizable e-commerce solution.
Key Features of Bagisto:
- Supports multi-channel and multi-store within a single dashboard.
- Provides an advanced product catalog for various product types.
- Supports multi-language and multi-currency for global businesses.
- Offers a powerful and flexible inventory management system.
- Provides role-based access control (RBAC) for admin access management.
- Uses a modern tech stack (Laravel and Vue.js) that is easy to extend.
2. System Requirements
Minimum Requirements:
- Apache or Nginx Web Server
- PHP 8.3+
- Composer 2.5+
- MySQL 8.0+ or MariaDB 10.3+
3. Server Preparation
This tutorial uses Ubuntu as the operating system. Before installation, update your Ubuntu system:
sudo apt update
sudo apt upgrade -yInstall Nginx:
sudo apt install nginx certbot python3-certbot-nginx -yAdd the ondrej/php PPA repository:
sudo add-apt-repository ppa:ondrej/php -y
sudo apt upgrade -yInstall PHP 8.3 and required extensions:
sudo apt install php8.3 php8.3-fpm php8.3-cli php8.3-common \
php8.3-apcu php8.3-mbstring php8.3-gd php8.3-intl \
php8.3-xml php8.3-soap php8.3-bcmath php8.3-mysql php8.3-zip \
php8.3-curl php8.3-tidy php8.3-imagick php8.3-sqlite3 unzip -yInstall Composer:
sudo wget https://getcomposer.org/download/latest-stable/composer.phar -O /usr/local/bin/composer
sudo chmod +x /usr/local/bin/composerInstall MariaDB:
sudo apt install mariadb-server -y4. Create Database
Log in to MariaDB:
sudo mysqlCreate database and user:
CREATE DATABASE bagisto;
CREATE USER 'bagisto'@'localhost' IDENTIFIED BY 'secretpassword';
GRANT ALL PRIVILEGES ON bagisto.* TO 'bagisto'@'localhost';
FLUSH PRIVILEGES;
exit5. Nginx Reverse Proxy Configuration
Create an Nginx server block configuration for the subdomain bagisto.domain.com:
sudo nano /etc/nginx/sites-available/bagisto.domain.com.confInsert the following configuration:
server {
listen 80;
listen [::]:80;
server_name bagisto.domain.com;
root /var/www/bagisto.domain.com/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 ~* ^\/(?!cache).*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|webp|woff|woff2)$ {
expires max;
access_log off;
add_header Cache-Control "public";
}
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 ~ ^/index\.php(/|$) {
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_hide_header X-Powered-By;
}
location ~ /\.(?!well-known).* {
deny all;
}
}Enable the configuration:
sudo ln -s /etc/nginx/sites-available/bagisto.domain.com.conf /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginxRequest an SSL certificate:
sudo certbot --non-interactive \
-m [email protected] \
--agree-tos \
--no-eff-email \
--nginx -d bagisto.domain.com \
--redirect6. Install Bagisto
Create a Bagisto project via Composer:
sudo composer create-project bagisto/bagisto /var/www/bagisto.domain.comRun the installer:
cd /var/www/bagisto.domain.com
sudo php artisan bagisto:installPrompts during installation:
Please enter the application name
Please enter the application URL
Please select the application timezone
Please select the default application locale
Please select the default currency
Please choose the allowed locales for your channels
Please choose the allowed currencies for your channels
Please select the database connection
Please enter the database host
Please enter the database port
Please enter the database name
Please enter the database prefix
Please enter your database username
Please enter your database password
Enter the name of the admin user
Enter the email address of the admin user
Configure the password for the admin user
Please select if you want some sample products after installationOpen the .env file:
sudo nano /var/www/bagisto.domain.com/.envSet production mode:
APP_ENV=production
APP_DEBUG=falseChange directory ownership:
sudo chown -R www-data:www-data /var/www/bagisto.domain.comBagisto installation is complete and accessible at https://bagisto.domain.com and the admin dashboard at https://bagisto.domain.com/admin.
8. Conclusion
Bagisto is one of the most comprehensive open-source e-commerce platforms built on Laravel. Its installation process is relatively straightforward and ideal for developers who want to build a professional online store with full control over their server. By following this tutorial, you have successfully set up the environment, database, web server configuration, and completed the Bagisto installation.




