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 name” as 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
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.
chmod 400 /path/to/your/private-key.pem
ssh -i /path/to/your/private-key.pem username@public-ip-address
10. Modify Nginx host file:
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:
http://<PUBLIC_IP>
http://<public-ip>/admin_136v9h
Credentials to access Magento admin panel are stored at path /database/creds
http://<public-ip>:8081/
Credentials to access phpmyadmin are stored at path /database/creds
As a Director of Eternal Web Private Ltd an AWS consulting partner company, Nirav is responsible for its operations. AWS, cloud-computing and digital transformation are some of his favorite topics to talk about. His key focus is to help enterprises adopt technology, to solve their business problem with the right cloud solutions.
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.