Deploying Bagisto
Bagisto is a free and open-source Laravel-based eCommerce platform designed for building scalable online stores, multi-vendor marketplaces, and B2B commerce solutions. Built on the powerful Laravel framework with a Vue.js frontend, Bagisto provides a modern, customizable foundation for creating feature-rich eCommerce applications.
Why Bagisto?
Bagisto stands out in the eCommerce platform landscape with its unique combination of power and flexibility:
- Laravel Foundation: Built on Laravel, one of the most popular PHP frameworks, ensuring clean code, security, and scalability
- Multi-Vendor Marketplace: Native support for creating multi-seller marketplaces with vendor management
- B2B & B2C: Support for both business-to-business and business-to-consumer commerce models
- Headless Commerce: REST API and GraphQL support for building custom storefronts and mobile applications
- Multi-Channel: Manage multiple stores, currencies, and locales from a single installation
- Extensible Architecture: Modular design with package development support for custom features
- PWA Ready: Progressive Web App support for mobile-first experiences
- Built-in Features: Product management, inventory control, tax rules, shipping methods, and payment integrations
With over 24,000 GitHub stars and trusted by 25,000+ businesses worldwide, Bagisto has established itself as a leading open-source eCommerce solution.
Prerequisites
Before deploying Bagisto, you’ll need:
- A Klutch.sh account
- A MySQL database instance - follow our MySQL deployment guide to set one up
Deploying Bagisto
Create a New Project
Log in to your Klutch.sh dashboard and create a new project for your eCommerce store.
Deploy MySQL Database
If you haven’t already, deploy a MySQL 8.0+ database instance by following the MySQL guide. Take note of your database credentials for the next step.
Create a New App
Create a new app within your project using the following Docker image from Docker Hub:
webkul/bagisto:2.3.6This official Bagisto image includes PHP 8.2, Apache, and all required PHP extensions pre-configured.
Configure Environment Variables
Set up the following environment variables for your Bagisto deployment:
Variable Description Example APP_NAMEYour store name My StoreAPP_ENVApplication environment productionAPP_DEBUGEnable debug mode falseAPP_KEYApplication encryption key base64:...(generate a 32-character random string)APP_URLYour store’s public URL https://your-app.klutch.shAPP_ADMIN_URLAdmin panel path adminDB_CONNECTIONDatabase driver mysqlDB_HOSTMySQL host from Klutch your-mysql-hostDB_PORTMySQL port 3306DB_DATABASEDatabase name bagistoDB_USERNAMEDatabase username bagisto_userDB_PASSWORDDatabase password your-secure-passwordCACHE_DRIVERCache storage driver fileSESSION_DRIVERSession storage driver fileQUEUE_CONNECTIONQueue driver syncConfigure Persistent Storage
Add a persistent volume to store uploaded files, product images, and cache:
Mount Path Description /var/www/html/storageApplication storage (uploads, cache, logs) Allocate at least 5GB of storage to accommodate product images and media files.
Set Network Configuration
Configure your app to use HTTP traffic on port
80, which is the default Apache port in the Bagisto container.Deploy Your App
Click Deploy to start your Bagisto instance. The initial deployment may take a few minutes as the application initializes and runs database migrations.
Post-Deployment Configuration
Accessing the Admin Panel
Once deployed, access your Bagisto admin panel at:
https://your-app.klutch.sh/adminUse the default administrator credentials:
- Email:
admin@example.com - Password:
admin123
Initial Store Setup
After logging in, complete these essential configuration steps:
- Update Admin Credentials: Change the default email and password
- Configure Store Information: Set your store name, address, and contact details under Settings → Channels
- Set Currency and Locale: Configure your default currency and language under Settings → Locales and Settings → Currencies
- Configure Tax Rules: Set up tax categories and rates under Settings → Taxes
- Add Payment Methods: Configure payment gateways under Settings → Payment Methods
- Configure Shipping: Set up shipping methods and rates under Settings → Shipping Methods
Adding Products
To add your first products:
- Navigate to Catalog → Products in the admin panel
- Click Add Product and select the product type
- Fill in product details, pricing, and inventory information
- Upload product images
- Set product categories and attributes
- Save and publish your product
Sample Docker Compose for Local Development
For local development and testing before deploying to Klutch.sh, you can use this Docker Compose configuration:
version: '3.8'
services: bagisto: image: webkul/bagisto:2.3.6 ports: - "8080:80" environment: - APP_NAME=Bagisto - APP_ENV=local - APP_DEBUG=true - APP_URL=http://localhost:8080 - DB_CONNECTION=mysql - DB_HOST=mysql - DB_PORT=3306 - DB_DATABASE=bagisto - DB_USERNAME=bagisto - DB_PASSWORD=secret volumes: - bagisto_storage:/var/www/html/storage depends_on: mysql: condition: service_healthy
mysql: image: mysql:8.0 environment: - MYSQL_ROOT_PASSWORD=rootsecret - MYSQL_DATABASE=bagisto - MYSQL_USER=bagisto - MYSQL_PASSWORD=secret volumes: - mysql_data:/var/lib/mysql healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] interval: 10s timeout: 5s retries: 5
volumes: bagisto_storage: mysql_data:Save this as docker-compose.yml and run:
docker-compose up -dAccess Bagisto at http://localhost:8080 and the admin panel at http://localhost:8080/admin.
Performance Optimization
Enable Redis for Caching
For better performance in production, deploy a Redis instance using our Redis guide and update your environment variables:
| Variable | Value |
|---|---|
CACHE_DRIVER | redis |
SESSION_DRIVER | redis |
QUEUE_CONNECTION | redis |
REDIS_HOST | Your Redis host |
REDIS_PORT | 6379 |
REDIS_PASSWORD | Your Redis password (if set) |
Enable Elasticsearch for Search
For enhanced product search functionality, deploy an Elasticsearch instance and configure:
| Variable | Value |
|---|---|
ELASTICSEARCH_HOST | Your Elasticsearch host |
ELASTICSEARCH_PORT | 9200 |
Additional Resources
- Bagisto Documentation - Official developer documentation
- Bagisto User Guide - End-user documentation
- Bagisto GitHub Repository - Source code and issue tracking
- Bagisto Extensions - Official and community extensions
- Bagisto Forums - Community support and discussions