Deploy Magento on AWS into a new VPC

View guide — HTML | PDF


This Quick Start automatically deploys Magento Open Source (formerly Community Edition) on the AWS Cloud.

Magento is an open-source content management system for e-commerce websites. This automated deployment builds a cluster that runs Magento along with optional sample data, which lets you experiment with custom themes and view the web store.

This Quick Start deploys Magento using AWS CloudFormation templates and offers two options: you can build a new AWS infrastructure for your Magento stack, or deploy Magento into your existing AWS infrastructure. The deployment uses your choice of Amazon Aurora or MySQL on Amazon RDS for database operations, Amazon EFS for shared storage between EC2 instances, and an Amazon ElastiCache cluster with the Redis cache engine to improve application load times.

To deploy Magento on AWS in less than an hour, follow the step-by-step instructions in the Quick Start deployment guide. For additional Quick Starts, see the complete catalog.

  • What you'll build

    • A virtual private cloud (VPC) that spans two Availability Zones, configured with two public and two private subnets. 
    • In a public subnet, a bastion host to provide Secure Shell (SSH) access to the Magento web servers. The bastion host is maintained by an Auto Scaling group that spans multiple Availability Zones, and is configured to ensure there is always one bastion host available.
    • AWS-managed network address translation (NAT) gateways deployed into the public subnets and configured with an Elastic IP address for outbound Internet connectivity. The NAT gateways are used for Internet access for all EC2 instances launched within the private network.
    • Either an Amazon RDS for MySQL or an Amazon Aurora database engine deployed via Amazon RDS in the first private subnet. If you choose Multi-AZ deployment, a synchronously replicated secondary database is deployed in the second private subnet. This provides high availability and built-in automated failover from the primary database.
    • An Amazon ElastiCache cluster with the Redis cache engine launched in the private subnets.
    • Amazon EC2 web server instances launched in the private subnets.
    • Elastic Load Balancing deployed to automatically distribute traffic across the multiple web server instances.
    • Amazon EFS created and automatically mounted on web server instances to store shared media files.
    • Auto Scaling enabled to automatically increase capacity if there is a demand spike, and to reduce capacity during low traffic times. The default installation sets up low and high CPU-based thresholds for scaling the instance capacity up or down. You can modify these thresholds during launch and after deployment.
    • An AWS Identity and Access Management (IAM) instance role with fine-grained permissions for accessing AWS services necessary for the deployment process.
    • Appropriate security groups for each instance or function to restrict access to only necessary protocols and ports. For example, access to HTTP server ports on Amazon EC2 web servers is limited to Elastic Load Balancing. The security groups also restrict access to Amazon RDS DB instances by web server instances.

    If you’re deploying Magento into an existing VPC, you'll need to make sure that your VPC has two private and two public subnets in different Availability Zones with NAT gateways in their route tables, to allow the instances to download packages and software without exposing them to the Internet.

    The Quick Start deploys Magento Community Edition version 2.1.9 with the following software:

    • Operating system: Amazon Linux x86-64
    • Web server: NGINX
    • Database: Amazon RDS for MySQL 5.6 tor Amazon Aurora
    • Programming language: PHP 7, including the required extensions
    • Optional sample data for experimenting with custom themes and vewing the web store.

    For details, see the Quick Start deployment guide.

  • Deployment details

    Deploy your Magento environment on AWS in 30-60 minutes, depending on whether you choose to download sample data:

    1. Prepare your AWS account.
    2. Download the Magento software.
    3. Launch the Quick Start. You can choose from two options:
      - Deploy into a new VPC, or 
      - Deploy into an existing VPC
    4. Test your deployment.

    To customize your deployment, you can configure your Magento, database, and Amazon ElastiCache settings, set the minimum and maximum number of web servers, and customize CIDR block sizes and instance types.   

    For complete details, see the Quick Start deployment guide.

  • Cost and licenses

    You are responsible for the cost of the AWS services used while running this Quick Start reference deployment. There is no additional cost for using the Quick Start. The cost will vary depending on the storage and compute configuration of the cluster you deploy. Prices are subject to change. See the pricing pages for each AWS service you will be using in this Quick Start for full details.

    This Quick Start uses Magento Open Source (formerly Community Edition), which is open-source software distributed under the Open Software License (OSL 3.0).