docker.recipes

Bagisto

intermediate

Laravel-based e-commerce platform.

Overview

Bagisto is a modern, feature-rich e-commerce platform built on the Laravel PHP framework by Webkul. Released as an open-source solution in 2018, it combines the robustness of Laravel's ecosystem with comprehensive e-commerce functionality including multi-store management, inventory tracking, payment gateway integrations, and advanced catalog management. Unlike monolithic platforms like Magento, Bagisto offers a modular architecture that's easier to customize and extend while maintaining enterprise-grade capabilities. This Docker stack pairs Bagisto with MySQL 8.0 to create a complete e-commerce solution where MySQL's InnoDB storage engine handles transactional data integrity crucial for order processing, inventory updates, and customer data management. The combination leverages MySQL's query optimization for product catalogs and Laravel's Eloquent ORM for complex e-commerce relationships like customer orders, product variants, and promotional rules. This stack is ideal for businesses launching new online stores, developers building custom e-commerce solutions, or organizations migrating from legacy platforms who need modern multi-currency and multi-locale capabilities. The Laravel foundation makes it particularly attractive for PHP development teams, while the Docker containerization ensures consistent deployment across different hosting environments without complex LAMP stack configuration.

Key Features

  • Laravel 9.x framework foundation with Eloquent ORM for complex e-commerce data relationships
  • Multi-store management with shared customer database and separate catalog configurations
  • Built-in multi-currency support with real-time exchange rate APIs and localized pricing
  • Advanced inventory management with multi-warehouse tracking and low-stock alerts
  • Comprehensive admin panel with role-based permissions and customizable dashboards
  • RTL (Right-to-Left) language support with translation management system
  • MySQL 8.0 with JSON field support for flexible product attribute storage
  • Modular architecture allowing custom payment gateways and shipping method integrations

Common Use Cases

  • 1Small to medium businesses launching their first professional e-commerce website
  • 2Laravel development agencies building custom online stores for clients
  • 3International retailers requiring multi-currency and multi-language storefronts
  • 4B2B companies needing customer-specific pricing and bulk order management
  • 5Startups testing e-commerce concepts before scaling to enterprise platforms
  • 6Educational institutions teaching e-commerce development using modern PHP frameworks
  • 7Developers creating marketplace platforms using Bagisto's multi-vendor extensions

Prerequisites

  • Docker Engine 20.10+ and Docker Compose V2 installed on the host system
  • Minimum 2GB RAM available (1GB+ for MySQL, additional memory for PHP-FPM processes)
  • Port 8080 available for web access and no conflicts with existing MySQL instances
  • Basic understanding of Laravel framework and PHP application deployment
  • Familiarity with MySQL administration for database maintenance and optimization
  • SSL certificate and domain configuration knowledge for production deployments

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 bagisto:
3 image: webkul/bagisto:latest
4 container_name: bagisto
5 restart: unless-stopped
6 environment:
7 DB_HOST: mysql
8 DB_DATABASE: ${DB_NAME}
9 DB_USERNAME: ${DB_USER}
10 DB_PASSWORD: ${DB_PASSWORD}
11 APP_URL: http://localhost:8080
12 volumes:
13 - bagisto_data:/var/www/html
14 ports:
15 - "8080:80"
16 depends_on:
17 - mysql
18 networks:
19 - bagisto
20
21 mysql:
22 image: mysql:8.0
23 container_name: bagisto-mysql
24 environment:
25 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
26 MYSQL_DATABASE: ${DB_NAME}
27 MYSQL_USER: ${DB_USER}
28 MYSQL_PASSWORD: ${DB_PASSWORD}
29 volumes:
30 - mysql_data:/var/lib/mysql
31 networks:
32 - bagisto
33
34volumes:
35 bagisto_data:
36 mysql_data:
37
38networks:
39 bagisto:
40 driver: bridge

.env Template

.env
1DB_ROOT_PASSWORD=rootpassword
2DB_NAME=bagisto
3DB_USER=bagisto
4DB_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://bagisto.com/en/documentation/
  2. 2Access at http://localhost:8080 - built on Laravel PHP framework
  3. 3Admin panel at /admin, default credentials in setup
  4. 4Multi-inventory, multi-warehouse support built-in
  5. 5RTL support, multi-currency, multi-locale ready
  6. 6Marketplace extension available for multi-vendor setup

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

bagisto
bagisto:
  image: webkul/bagisto:latest
  container_name: bagisto
  restart: unless-stopped
  environment:
    DB_HOST: mysql
    DB_DATABASE: ${DB_NAME}
    DB_USERNAME: ${DB_USER}
    DB_PASSWORD: ${DB_PASSWORD}
    APP_URL: http://localhost:8080
  volumes:
    - bagisto_data:/var/www/html
  ports:
    - "8080:80"
  depends_on:
    - mysql
  networks:
    - bagisto
mysql
mysql:
  image: mysql:8.0
  container_name: bagisto-mysql
  environment:
    MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    MYSQL_DATABASE: ${DB_NAME}
    MYSQL_USER: ${DB_USER}
    MYSQL_PASSWORD: ${DB_PASSWORD}
  volumes:
    - mysql_data:/var/lib/mysql
  networks:
    - bagisto

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 bagisto:
5 image: webkul/bagisto:latest
6 container_name: bagisto
7 restart: unless-stopped
8 environment:
9 DB_HOST: mysql
10 DB_DATABASE: ${DB_NAME}
11 DB_USERNAME: ${DB_USER}
12 DB_PASSWORD: ${DB_PASSWORD}
13 APP_URL: http://localhost:8080
14 volumes:
15 - bagisto_data:/var/www/html
16 ports:
17 - "8080:80"
18 depends_on:
19 - mysql
20 networks:
21 - bagisto
22
23 mysql:
24 image: mysql:8.0
25 container_name: bagisto-mysql
26 environment:
27 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
28 MYSQL_DATABASE: ${DB_NAME}
29 MYSQL_USER: ${DB_USER}
30 MYSQL_PASSWORD: ${DB_PASSWORD}
31 volumes:
32 - mysql_data:/var/lib/mysql
33 networks:
34 - bagisto
35
36volumes:
37 bagisto_data:
38 mysql_data:
39
40networks:
41 bagisto:
42 driver: bridge
43EOF
44
45# 2. Create the .env file
46cat > .env << 'EOF'
47DB_ROOT_PASSWORD=rootpassword
48DB_NAME=bagisto
49DB_USER=bagisto
50DB_PASSWORD=changeme
51EOF
52
53# 3. Start the services
54docker compose up -d
55
56# 4. View logs
57docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/bagisto/run | bash

Troubleshooting

  • Bagisto showing 'Application key not set' error: Execute 'docker exec bagisto php artisan key:generate' to generate Laravel application key
  • Database connection refused during startup: Ensure MySQL container is fully initialized before Bagisto starts, add healthcheck or increase depends_on delay
  • Admin panel login fails with default credentials: Run 'docker exec bagisto php artisan bagisto:install' to complete initial setup and create admin user
  • Product images not displaying correctly: Check bagisto_data volume permissions and ensure storage/app/public is properly linked
  • MySQL container crashing with 'innodb-buffer-pool-size' error: Reduce MySQL memory allocation or increase host system RAM allocation
  • Bagisto session timeouts occurring frequently: Configure Redis for session storage instead of file-based sessions for better performance

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space