Skip to content

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:

Deploying Bagisto

  1. Create a New Project

    Log in to your Klutch.sh dashboard and create a new project for your eCommerce store.

  2. 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.

  3. Create a New App

    Create a new app within your project using the following Docker image from Docker Hub:

    webkul/bagisto:2.3.6

    This official Bagisto image includes PHP 8.2, Apache, and all required PHP extensions pre-configured.

  4. Configure Environment Variables

    Set up the following environment variables for your Bagisto deployment:

    VariableDescriptionExample
    APP_NAMEYour store nameMy Store
    APP_ENVApplication environmentproduction
    APP_DEBUGEnable debug modefalse
    APP_KEYApplication encryption keybase64:... (generate a 32-character random string)
    APP_URLYour store’s public URLhttps://your-app.klutch.sh
    APP_ADMIN_URLAdmin panel pathadmin
    DB_CONNECTIONDatabase drivermysql
    DB_HOSTMySQL host from Klutchyour-mysql-host
    DB_PORTMySQL port3306
    DB_DATABASEDatabase namebagisto
    DB_USERNAMEDatabase usernamebagisto_user
    DB_PASSWORDDatabase passwordyour-secure-password
    CACHE_DRIVERCache storage driverfile
    SESSION_DRIVERSession storage driverfile
    QUEUE_CONNECTIONQueue driversync
  5. Configure Persistent Storage

    Add a persistent volume to store uploaded files, product images, and cache:

    Mount PathDescription
    /var/www/html/storageApplication storage (uploads, cache, logs)

    Allocate at least 5GB of storage to accommodate product images and media files.

  6. Set Network Configuration

    Configure your app to use HTTP traffic on port 80, which is the default Apache port in the Bagisto container.

  7. 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/admin

Use the default administrator credentials:

  • Email: admin@example.com
  • Password: admin123

Initial Store Setup

After logging in, complete these essential configuration steps:

  1. Update Admin Credentials: Change the default email and password
  2. Configure Store Information: Set your store name, address, and contact details under Settings → Channels
  3. Set Currency and Locale: Configure your default currency and language under Settings → Locales and Settings → Currencies
  4. Configure Tax Rules: Set up tax categories and rates under Settings → Taxes
  5. Add Payment Methods: Configure payment gateways under Settings → Payment Methods
  6. Configure Shipping: Set up shipping methods and rates under Settings → Shipping Methods

Adding Products

To add your first products:

  1. Navigate to Catalog → Products in the admin panel
  2. Click Add Product and select the product type
  3. Fill in product details, pricing, and inventory information
  4. Upload product images
  5. Set product categories and attributes
  6. 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:

Terminal window
docker-compose up -d

Access 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:

VariableValue
CACHE_DRIVERredis
SESSION_DRIVERredis
QUEUE_CONNECTIONredis
REDIS_HOSTYour Redis host
REDIS_PORT6379
REDIS_PASSWORDYour Redis password (if set)

For enhanced product search functionality, deploy an Elasticsearch instance and configure:

VariableValue
ELASTICSEARCH_HOSTYour Elasticsearch host
ELASTICSEARCH_PORT9200

Additional Resources