Bagisto Laravel E-commerce
Modern Laravel-based e-commerce with multi-warehouse and marketplace support.
Overview
Bagisto is a modern, Laravel-based e-commerce platform that provides multi-warehouse management, marketplace functionality, and extensive customization capabilities for online retailers. Built with a headless architecture approach, Bagisto separates the frontend presentation layer from the backend business logic, making it ideal for businesses requiring custom storefronts or multi-channel selling strategies. This implementation combines Bagisto with MySQL for transactional data storage, Redis for session management and caching, Elasticsearch for product search and analytics, and NGINX as a high-performance web server and reverse proxy. The stack creates a robust e-commerce environment capable of handling complex inventory management across multiple warehouses while providing fast search capabilities and efficient caching for improved customer experience. This configuration is particularly valuable for medium to large-scale online retailers, marketplace operators, and businesses with complex inventory requirements who need a scalable platform that can grow with their operations while maintaining the flexibility to customize both frontend experiences and backend workflows.
Key Features
- Multi-warehouse inventory management with real-time stock tracking across locations
- Built-in marketplace functionality supporting multiple vendors and commission structures
- Laravel framework foundation with Eloquent ORM for rapid custom development
- Elasticsearch-powered product search with faceted filtering and real-time indexing
- Redis-based session storage and application caching for improved performance
- Multi-currency and multi-language support for international e-commerce operations
- RESTful API architecture enabling headless commerce implementations
- MySQL 8.0 with InnoDB storage engine providing ACID compliance for transactional integrity
Common Use Cases
- 1Multi-vendor marketplaces requiring vendor management and commission tracking
- 2Retailers with multiple warehouse locations needing unified inventory management
- 3B2B e-commerce platforms requiring custom pricing and bulk ordering features
- 4International retailers needing multi-currency and multi-language capabilities
- 5Businesses requiring headless commerce architecture for custom frontend applications
- 6Growing online stores needing scalable search functionality for large product catalogs
- 7Custom e-commerce solutions requiring extensive Laravel-based backend modifications
Prerequisites
- Minimum 4GB RAM (2GB for Elasticsearch, 1GB for MySQL, 512MB for Redis, 512MB for application)
- Docker Engine 20.10+ and Docker Compose v2 for modern compose file support
- Available ports 80 for web access and 9200 for Elasticsearch (if external access needed)
- Basic understanding of Laravel framework and PHP for customization and troubleshooting
- Familiarity with MySQL database administration for backup and maintenance procedures
- Understanding of Elasticsearch concepts for search optimization and index management
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 mysql: 3 image: mysql:8.04 environment: 5 - MYSQL_DATABASE=bagisto6 - MYSQL_USER=bagisto7 - MYSQL_PASSWORD=${MYSQL_PASSWORD}8 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}9 volumes: 10 - mysql_data:/var/lib/mysql11 networks: 12 - bagisto_net1314 redis: 15 image: redis:7-alpine16 volumes: 17 - redis_data:/data18 networks: 19 - bagisto_net2021 elasticsearch: 22 image: docker.elastic.co/elasticsearch/elasticsearch:8.11.023 environment: 24 - discovery.type=single-node25 - xpack.security.enabled=false26 volumes: 27 - es_data:/usr/share/elasticsearch/data28 networks: 29 - bagisto_net3031 bagisto: 32 image: bagisto/bagisto:latest33 environment: 34 - APP_URL=http://localhost35 - DB_HOST=mysql36 - DB_DATABASE=bagisto37 - DB_USERNAME=bagisto38 - DB_PASSWORD=${MYSQL_PASSWORD}39 - REDIS_HOST=redis40 - ELASTICSEARCH_HOST=elasticsearch41 volumes: 42 - bagisto_data:/var/www/html43 depends_on: 44 - mysql45 - redis46 - elasticsearch47 networks: 48 - bagisto_net4950 nginx: 51 image: nginx:alpine52 ports: 53 - "80:80"54 volumes: 55 - ./nginx.conf:/etc/nginx/nginx.conf:ro56 - bagisto_data:/var/www/html:ro57 depends_on: 58 - bagisto59 networks: 60 - bagisto_net6162volumes: 63 mysql_data: 64 redis_data: 65 es_data: 66 bagisto_data: 6768networks: 69 bagisto_net: .env Template
.env
1# Bagisto2MYSQL_PASSWORD=secure_mysql_password3MYSQL_ROOT_PASSWORD=secure_root_password45# Shop at http://localhost6# Admin at http://localhost/adminUsage Notes
- 1Shop at http://localhost
- 2Admin at http://localhost/admin
- 3Built on Laravel framework
- 4Multi-warehouse support
- 5Marketplace module available
Individual Services(5 services)
Copy individual services to mix and match with your existing compose files.
mysql
mysql:
image: mysql:8.0
environment:
- MYSQL_DATABASE=bagisto
- MYSQL_USER=bagisto
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- bagisto_net
redis
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
networks:
- bagisto_net
elasticsearch
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
- bagisto_net
bagisto
bagisto:
image: bagisto/bagisto:latest
environment:
- APP_URL=http://localhost
- DB_HOST=mysql
- DB_DATABASE=bagisto
- DB_USERNAME=bagisto
- DB_PASSWORD=${MYSQL_PASSWORD}
- REDIS_HOST=redis
- ELASTICSEARCH_HOST=elasticsearch
volumes:
- bagisto_data:/var/www/html
depends_on:
- mysql
- redis
- elasticsearch
networks:
- bagisto_net
nginx
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- bagisto_data:/var/www/html:ro
depends_on:
- bagisto
networks:
- bagisto_net
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 mysql:5 image: mysql:8.06 environment:7 - MYSQL_DATABASE=bagisto8 - MYSQL_USER=bagisto9 - MYSQL_PASSWORD=${MYSQL_PASSWORD}10 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}11 volumes:12 - mysql_data:/var/lib/mysql13 networks:14 - bagisto_net1516 redis:17 image: redis:7-alpine18 volumes:19 - redis_data:/data20 networks:21 - bagisto_net2223 elasticsearch:24 image: docker.elastic.co/elasticsearch/elasticsearch:8.11.025 environment:26 - discovery.type=single-node27 - xpack.security.enabled=false28 volumes:29 - es_data:/usr/share/elasticsearch/data30 networks:31 - bagisto_net3233 bagisto:34 image: bagisto/bagisto:latest35 environment:36 - APP_URL=http://localhost37 - DB_HOST=mysql38 - DB_DATABASE=bagisto39 - DB_USERNAME=bagisto40 - DB_PASSWORD=${MYSQL_PASSWORD}41 - REDIS_HOST=redis42 - ELASTICSEARCH_HOST=elasticsearch43 volumes:44 - bagisto_data:/var/www/html45 depends_on:46 - mysql47 - redis48 - elasticsearch49 networks:50 - bagisto_net5152 nginx:53 image: nginx:alpine54 ports:55 - "80:80"56 volumes:57 - ./nginx.conf:/etc/nginx/nginx.conf:ro58 - bagisto_data:/var/www/html:ro59 depends_on:60 - bagisto61 networks:62 - bagisto_net6364volumes:65 mysql_data:66 redis_data:67 es_data:68 bagisto_data:6970networks:71 bagisto_net:72EOF7374# 2. Create the .env file75cat > .env << 'EOF'76# Bagisto77MYSQL_PASSWORD=secure_mysql_password78MYSQL_ROOT_PASSWORD=secure_root_password7980# Shop at http://localhost81# Admin at http://localhost/admin82EOF8384# 3. Start the services85docker compose up -d8687# 4. View logs88docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/bagisto-ecommerce/run | bashTroubleshooting
- Elasticsearch container fails with 'max virtual memory areas vm.max_map_count too low': Increase vm.max_map_count with 'sudo sysctl -w vm.max_map_count=262144'
- Bagisto shows 'SQLSTATE[HY000] [2002] Connection refused' error: Ensure MySQL container is fully started before Bagisto container attempts connection
- Product search returns no results despite having products: Check Elasticsearch indexing status in Bagisto admin and manually trigger reindexing if necessary
- Redis connection timeout errors in application logs: Verify Redis container health and increase Redis timeout settings in Bagisto configuration
- NGINX shows 502 Bad Gateway error: Check that Bagisto PHP-FPM process is running and accessible on the expected port within the container
- MySQL container exits with 'disk space' error: Clean up old MySQL binary logs or increase available disk space for mysql_data volume
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
Components
bagistomysqlrediselasticsearchnginx
Tags
#bagisto#laravel#ecommerce#php#marketplace
Category
E-Commerce & BusinessAd Space
Shortcuts: C CopyF FavoriteD Download