Launch a Magento2 instance from AWS Marketplace

Launch a Magento2 instance from AWS Marketplace

November 21, 2023 / Nirav Shah

1. Log in to your AWS Management Console using your AWS account credentials.

2. Once logged in, go to the EC2 dashboard by clicking on the “Services” dropdown menu and selecting “EC2” under the Compute section.

3. On the EC2 Dashboard, click the “Launch Instance” button to start the instance creation process. you will see page as below then click on the “Browse more AMIs”.

4. Search on the bar for “ Magento2 with phpMyAdmin on Ubuntu 22.04 by Eternal” it will automatically fetch the correct AMI name. Click on ‘select’ and then ‘continue’.

5. Now, you’ll select the hardware specifications for your instance, such as the number of vCPUs, memory, and network performance. Choose an instance type that best suits your requirements and click “Next. To run Magento, you need a server with at least 4GB RAM.

6. After selection of your desired instance type, we have to generate an SSH key to access the instance as shown in the image below. Click on “create new key pair”, enter the “key pair nameas per your choice. Please note that this key will be downloadable one time only, so keep it in a safe place otherwise you will not able to access the server.

7. After creating the key pair you have to configure the security group. You have two options

  1. create security group –which will create new security group.
  2. select existing security group –it is used to provide reference of any other security group that you have configured earlier with an existing instance.

Note: Please note that you have to allow ports and protocols for access and connectivity in security group as below:

Protocol Type Port Description
SSH TCP 22 For ssh connectivity
Custom TCP TCP 3306 Database Listener port for remote access
Custom TCP TCP 8080 Magento Site(nginx)
Custom TCP TCP 8081 Phpmyadmin
Custom TCP TCP 443 For https
Custom TCP TCP 9200 Elasticsearch
Custom TCP TCP 80 Varnish

8. Configure the storage options for your instance. You can add or modify the root volume and add additional EBS (Elastic Block Store) volumes, adjust the size and type of storage as needed.

9. Connect to the instance using SSH.

    • Open your terminal or command prompt.
    • Change the permissions of your private key file (if necessary) by running the following command:
    • chmod 400 /path/to/your/private-key.pem

    • Connect to the instance using SSH with the following command.
    • ssh -i /path/to/your/private-key.pem username@public-ip-address

10. Modify Nginx host file:

  • (i) Open file and add public IP/domain name of your magento server
  • sudo nano /etc/nginx/sites-enabled/magento.conf
  • server name = public_ip/domain name;
  • sudo systemctl restart nginx

11. Package configraution:
List of installed server components and their respective installation paths.

Component Version Location
Ubuntu 22.04.2 LTS
Elasticsearch 7
MySQL 8 8.0 /etc/mysql/mysql.conf.d/mysqld.cnf
Nginx nginx/1.18.0 (Ubuntu) /etc/nginx/nginx.conf
PHP-FPM 8.1.2 /etc/php/8.1/fpm/php.ini
Magento 2.4 /var/www/magento
Phpmyadmin 5.2.0 /var/www/html/phpmyadmin
Varnish 7 /etc/systemd/system/varnish.service

12. Database creds:
To access the MySQL root user and database user credentials, please refer to the following file:
/database/creds

The file mentioned above contains the necessary credentials for both the MySQL root user and the database user. Please locate this file to retrieve the required information.

13. To access the Magento front-end, follow the steps below:

    • To access the Magento site, open a web browser of your choice.Enter the following URL in the address bar:

http://<PUBLIC_IP>

    • To access Magento Admin panel, enter following URL in the address bar:

http://<public-ip>/admin_136v9h

Credentials to access Magento admin panel are stored at path /database/creds

    • To access phpmyadmin, enter following URL in the address bar:

http://<public-ip>:8081/

Credentials to access phpmyadmin are stored at path /database/creds

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let’s Talk About Your Needed AWS Infrastructure Management Services

    Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project