$docker.recipes

Magento Open Source

advanced

Feature-rich e-commerce platform by Adobe.

[i]Overview

Magento Open Source is Adobe's flagship e-commerce platform that powers thousands of online stores worldwide. Originally developed by Varien in 2008 and later acquired by Adobe, Magento provides a comprehensive solution for building scalable online retail experiences with advanced catalog management, flexible pricing rules, and extensive customization capabilities. The platform is renowned for its modular architecture, multi-store management, and robust API ecosystem that enables complex B2B and B2C commerce scenarios. This deployment orchestrates three essential services: the Bitnami Magento container serving the complete e-commerce application, MySQL 8.0 providing transactional data storage for products, orders, and customer information, and Elasticsearch 7.17 powering the advanced catalog search and filtering capabilities. The Bitnami image includes an optimized Magento installation with Apache, PHP, and all necessary dependencies pre-configured, while Elasticsearch integration enables layered navigation, advanced search suggestions, and performance-optimized product discovery. This stack is ideal for developers and businesses seeking a production-grade e-commerce solution without the complexity of manual Magento installation and configuration. The combination provides enterprise-level search capabilities through Elasticsearch integration, reliable data persistence with MySQL, and the flexibility to customize every aspect of the shopping experience through Magento's extensive theming and module system.

[*]Key Features

  • [+]Complete Magento Open Source installation with Bitnami optimization and security hardening
  • [+]Advanced catalog search powered by Elasticsearch with layered navigation and faceted filtering
  • [+]MySQL 8.0 with InnoDB storage engine for ACID-compliant transaction processing
  • [+]Multi-store and multi-website management from single Magento instance
  • [+]Extensive product catalog management with configurable and grouped product types
  • [+]Built-in payment gateway integrations and flexible shipping rule configuration
  • [+]Advanced customer segmentation and promotional rule engine
  • [+]REST and GraphQL APIs for headless commerce implementations

[#]Common Use Cases

  • [1]Mid-market retailers launching comprehensive online stores with advanced product catalogs
  • [2]B2B wholesalers requiring complex pricing tiers and customer group management
  • [3]Multi-brand businesses managing several storefronts from unified backend
  • [4]Fashion and electronics retailers needing sophisticated product configurators
  • [5]Marketplace operators building vendor management and commission systems
  • [6]International merchants requiring multi-currency and multi-language support
  • [7]Developers prototyping custom e-commerce extensions and payment integrations

[!]Prerequisites

  • [!]Minimum 4GB RAM and 2 CPU cores for acceptable Magento performance
  • [!]At least 10GB available disk space for Magento files, media, and database growth
  • [!]Basic understanding of e-commerce concepts and Magento admin interface
  • [!]Ports 8080 and 8443 available for HTTP and HTTPS access
  • [!]Environment variables configured for database credentials and Magento host settings
  • [!]Patience for initial container startup as Magento installation takes 5-10 minutes
[!]

WARNING: 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 magento:
3 image: bitnami/magento:latest
4 container_name: magento
5 restart: unless-stopped
6 environment:
7 MAGENTO_HOST: localhost
8 MAGENTO_DATABASE_HOST: mysql
9 MAGENTO_DATABASE_NAME: ${DB_NAME}
10 MAGENTO_DATABASE_USER: ${DB_USER}
11 MAGENTO_DATABASE_PASSWORD: ${DB_PASSWORD}
12 ELASTICSEARCH_HOST: elasticsearch
13 volumes:
14 - magento_data:/bitnami/magento
15 ports:
16 - "8080:8080"
17 - "8443:8443"
18 depends_on:
19 - mysql
20 - elasticsearch
21 networks:
22 - magento
23
24 mysql:
25 image: mysql:8.0
26 container_name: magento-mysql
27 environment:
28 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
29 MYSQL_DATABASE: ${DB_NAME}
30 MYSQL_USER: ${DB_USER}
31 MYSQL_PASSWORD: ${DB_PASSWORD}
32 volumes:
33 - mysql_data:/var/lib/mysql
34 networks:
35 - magento
36
37 elasticsearch:
38 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
39 container_name: magento-es
40 environment:
41 - discovery.type=single-node
42 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
43 volumes:
44 - es_data:/usr/share/elasticsearch/data
45 networks:
46 - magento
47
48volumes:
49 magento_data:
50 mysql_data:
51 es_data:
52
53networks:
54 magento:
55 driver: bridge

[$].env Template

[.env]
1DB_ROOT_PASSWORD=rootpassword
2DB_NAME=magento
3DB_USER=magento
4DB_PASSWORD=changeme

[i]Usage Notes

  1. [1]Docs: https://devdocs.magento.com/
  2. [2]Access at http://localhost:8080 - initial setup takes 5-10 minutes
  3. [3]Resource intensive: needs 4GB+ RAM, 2 CPU cores minimum
  4. [4]Admin URL and credentials shown in container logs after setup
  5. [5]Elasticsearch required for catalog search functionality
  6. [6]Bitnami provides default admin: user@example.com / bitnami1

Individual Services(3 services)

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

magento
magento:
  image: bitnami/magento:latest
  container_name: magento
  restart: unless-stopped
  environment:
    MAGENTO_HOST: localhost
    MAGENTO_DATABASE_HOST: mysql
    MAGENTO_DATABASE_NAME: ${DB_NAME}
    MAGENTO_DATABASE_USER: ${DB_USER}
    MAGENTO_DATABASE_PASSWORD: ${DB_PASSWORD}
    ELASTICSEARCH_HOST: elasticsearch
  volumes:
    - magento_data:/bitnami/magento
  ports:
    - "8080:8080"
    - "8443:8443"
  depends_on:
    - mysql
    - elasticsearch
  networks:
    - magento
mysql
mysql:
  image: mysql:8.0
  container_name: magento-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:
    - magento
elasticsearch
elasticsearch:
  image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
  container_name: magento-es
  environment:
    - discovery.type=single-node
    - ES_JAVA_OPTS=-Xms512m -Xmx512m
  volumes:
    - es_data:/usr/share/elasticsearch/data
  networks:
    - magento

[>]Quick Start

[terminal]
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 magento:
5 image: bitnami/magento:latest
6 container_name: magento
7 restart: unless-stopped
8 environment:
9 MAGENTO_HOST: localhost
10 MAGENTO_DATABASE_HOST: mysql
11 MAGENTO_DATABASE_NAME: ${DB_NAME}
12 MAGENTO_DATABASE_USER: ${DB_USER}
13 MAGENTO_DATABASE_PASSWORD: ${DB_PASSWORD}
14 ELASTICSEARCH_HOST: elasticsearch
15 volumes:
16 - magento_data:/bitnami/magento
17 ports:
18 - "8080:8080"
19 - "8443:8443"
20 depends_on:
21 - mysql
22 - elasticsearch
23 networks:
24 - magento
25
26 mysql:
27 image: mysql:8.0
28 container_name: magento-mysql
29 environment:
30 MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
31 MYSQL_DATABASE: ${DB_NAME}
32 MYSQL_USER: ${DB_USER}
33 MYSQL_PASSWORD: ${DB_PASSWORD}
34 volumes:
35 - mysql_data:/var/lib/mysql
36 networks:
37 - magento
38
39 elasticsearch:
40 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
41 container_name: magento-es
42 environment:
43 - discovery.type=single-node
44 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
45 volumes:
46 - es_data:/usr/share/elasticsearch/data
47 networks:
48 - magento
49
50volumes:
51 magento_data:
52 mysql_data:
53 es_data:
54
55networks:
56 magento:
57 driver: bridge
58EOF
59
60# 2. Create the .env file
61cat > .env << 'EOF'
62DB_ROOT_PASSWORD=rootpassword
63DB_NAME=magento
64DB_USER=magento
65DB_PASSWORD=changeme
66EOF
67
68# 3. Start the services
69docker compose up -d
70
71# 4. View logs
72docker 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/magento/run | bash

[?]Troubleshooting

  • [!]Magento container shows 'Installation in progress' for extended time: Check container logs with 'docker logs magento' and ensure sufficient RAM allocation
  • [!]Elasticsearch connection errors in Magento admin: Verify elasticsearch container is running and increase ES_JAVA_OPTS memory if needed
  • [!]MySQL connection refused errors: Confirm database environment variables match between magento and mysql services
  • [!]Catalog search not working after product import: Reindex Elasticsearch from Magento admin System > Index Management
  • [!]Admin login credentials unknown after setup: Check magento container logs for auto-generated admin URL and password
  • [!]Performance issues during category browsing: Increase Elasticsearch memory allocation beyond default 512MB for large catalogs

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