This Magento AMI walks you through using the Magento auto-installer script (magento_installer.sh) to deploy a Magento site with Apache, MySQL, and SSL on an AWS EC2 instance.
Prerequisites For Magento AMI Installer
This AMI comes pre-configured with all required software and Magento source code. Before using the installer, ensure the following:
- You launch the EC2 instance using the Magento AMI.
- The auto-installer script is available at: /home/ubuntu/magento_installer.sh
- The system pre-installs and configures Apache, PHP (8.1 or 8.2), MySQL, and the required PHP extensions.
- The system has already placed the Magento source code under: /var/www/html/
- DNS: Your domain must point to the EC2 public IP (A record set)
Installation Steps
Step 1: Run the Script
1 |
sudo bash magento_installer.sh |

The system will prompt you to enter the following inputs:
- MySQL Credentials
- Database user (e.g. magento_user)
- Database password
- Database name (e.g. magento_db)

Additionally, the script will create the DB and user automatically if they don’t exist.
- Domain Validation
- Enter your domain (e.g. example.com)
- The script will check if the domain points to this server’s public IP.

If domain matches, installation proceeds.
If the domain doesn’t match, the system will ask you to try again.
Step 2: Magento Installation
Once the domain check passes:
- Magento setup will run silently in the background.
- A spinner will indicate progress.
- It typically takes few minutes.

Step 3: Apache Virtual Host & SSLPath
- A VirtualHost config will be created for port 80 and 443.
- Apache will reload.
- Let’s Encrypt SSL will be automatically issued using Certbot.
- Your site will be accessible over HTTPS.
Step 4: Credentials Path
At the end, the following will be saved in:
/home/ubuntu/magento_admin_credentials_<your-domain>.txt
Contents include:
- Magento Admin Username & Password
- Magento Admin URL (e.g. https://yourdomain.com/admin_xxxxxx)
- OpenSearch Admin Initial Password

Example Output
Magento has been installed successfully.
Site URL: https://example.com
Admin URL: https://example.com/admin_Kf93pL
Credentials saved to: /home/ubuntu/example.com.txt
Be the first to comment.