---
title: "How To Create An AWS EC2 Instance Using AWS CLI"
lang: "en"
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/post/how-to-create-an-aws-ec2-instance-using-aws-cli
---

![Blog post image for How To Create An AWS EC2 Instance Using AWS CLI - How to build a VPC, subnets, an internet gateway, a NAT gateway, a route table, and a security group with the AWS CLI, then launch an EC2 instance whose user data installs Apache, PHP, MariaDB, and WordPress.](/_astro/hero.Dh2x9Phr_1WtywK.webp)

[Home](/)›[Blog](/blog)›[All Categories](/blog/categories)›[AWS](/blog/categories/aws)

Blog

[Prev in AWSHow To Create a DynamoDB Table Using AWS CLI](/blog/post/how-to-create-a-dynamodb-table-using-aws-cli)[Next in AWSHow to Deploy a Spring Boot Application to AWS CloudFormation](/blog/post/how-to-deploy-a-spring-boot-application-to-aws-cloudformation)

[AWS](/blog/categories/aws)[EC2](/blog/categories/ec2)[VPC](/blog/categories/vpc)[AWS CLI](/blog/categories/aws-cli)[WordPress](/blog/categories/wordpress)[Linux](/blog/categories/linux)

# How To Create An AWS EC2 Instance Using AWS CLI

[Mohammad Abu Mattar](/authors/mohammad-abu-mattar)Published: 30 Oct 202205 Mins read05 Mins listen

[Markdown for AI(opens in a new tab)](/post/how-to-create-an-aws-ec2-instance-using-aws-cli/index.md "Open the plain-Markdown version of this page, for pasting into an AI tool")

TL;DR

How to build a VPC, subnets, an internet gateway, a NAT gateway, a route table, and a security group with the AWS CLI, then launch an EC2 instance whose user data installs Apache, PHP, MariaDB, and WordPress.

Series

[AWS CLI Guides](/series/aws-cli-guides)2/4

[PreviousHow To Create A Custom VPC Using AWS CLI](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)[NextHow To Create a DynamoDB Table Using AWS CLI](/blog/post/how-to-create-a-dynamodb-table-using-aws-cli)

All posts in this series (4)

Blog4

1.  [How To Create A Custom VPC Using AWS CLI](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)
2.  [How To Create An AWS EC2 Instance Using AWS CLIYou are here](/blog/post/how-to-create-an-aws-ec2-instance-using-aws-cli)
3.  [How To Create a DynamoDB Table Using AWS CLI](/blog/post/how-to-create-a-dynamodb-table-using-aws-cli)
4.  [How To Create a AWS S3 Bucket Using AWS CLI](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

### How To Create An AWS EC2 Instance Using AWS CLI

Contents

[Introduction](#introduction)[Prerequisites](#prerequisites)[Create an AWS VPC](#create-an-aws-vpc)[Create a VPC](#create-a-vpc)[Modify your custom VPC to enable DNS hostname and DNS support](#modify-your-custom-vpc-to-enable-dns-hostname-and-dns-support)[Create a public subnet](#create-a-public-subnet)[Create a private subnet](#create-a-private-subnet)[Enable auto-assign public IP on the subnet](#enable-auto-assign-public-ip-on-the-subnet)[Create an internet gateway](#create-an-internet-gateway)[Create a NAT gateway](#create-a-nat-gateway)[Attach the internet gateway to your VPC](#attach-the-internet-gateway-to-your-vpc)[Create a custom route table](#create-a-custom-route-table)[Create a custom route table association](#create-a-custom-route-table-association)[Associate the subnet with route table, making it a public subnet](#associate-the-subnet-with-route-table-making-it-a-public-subnet)[Associate the NAT gateway with the route table, making it a private subnet](#associate-the-nat-gateway-with-the-route-table-making-it-a-private-subnet)[Create a security group](#create-a-security-group)[Add a rule to the security group](#add-a-rule-to-the-security-group)[Create an AWS EC2 instance](#create-an-aws-ec2-instance)[Get the latest AMI ID](#get-the-latest-ami-id)[Create a key pair](#create-a-key-pair)[Create an EC2 instance](#create-an-ec2-instance)[Check the status of the EC2 instance](#check-the-status-of-the-ec2-instance)[Get the public IP address of your instance](#get-the-public-ip-address-of-your-instance)[SSH into the EC2 instance](#ssh-into-the-ec2-instance)[Show the WordPress website](#show-the-wordpress-website)[Conclusion](#conclusion)[References](#references)

## [Introduction](#introduction)

In this tutorial we will create an AWS EC2 instance with the AWS CLI. We will build the network around it first, then launch the instance with a user data script that installs the Apache web server and brings up a working WordPress site.

## [Prerequisites](#prerequisites)

To follow along with this tutorial, you will need:

-   An AWS account.
-   An AWS IAM user with the following permissions:
    -   AmazonEC2FullAccess
    -   AmazonVPCFullAccess
-   An AWS CLI installed on your computer.
-   An SSH client installed on your computer.

## [Create an AWS VPC](#create-an-aws-vpc)

Before we create an AWS EC2 instance using AWS CLI, we need to create a VPC. We will also create a public and private subnet, an internet gateway, and a route table.

### [Create a VPC](#create-a-vpc)

To create a VPC, run the following command:

Terminal window

```
1# Create a VPC2AWS_VPC=$(aws ec2 create-vpc \3--cidr-block 10.0.0.0/16 \4--query 'Vpc.{VpcId:VpcId}' \5--output text)6
7# Add a name tag to the VPC8aws ec2 create-tags \9--resources $AWS_VPC \10--tags Key=Name,Value=DevOpsVPC
```

### [Modify your custom VPC to enable DNS hostname and DNS support](#modify-your-custom-vpc-to-enable-dns-hostname-and-dns-support)

To modify your custom VPC and turn on both DNS hostname support and DNS support, run the following command:

Terminal window

```
1# Enable DNS hostnames2aws ec2 modify-vpc-attribute \3--vpc-id $AWS_VPC \4--enable-dns-hostnames "{\"Value\":true}"5
6# Enable DNS support7aws ec2 modify-vpc-attribute \8--vpc-id $AWS_VPC \9--enable-dns-support "{\"Value\":true}"
```

### [Create a public subnet](#create-a-public-subnet)

To create a public subnet, run the following command:

Terminal window

```
1# Create a public subnet2AWS_PUBLIC_SUBNET=$(aws ec2 create-subnet \3--vpc-id $AWS_VPC \4--cidr-block 10.0.1.0/24 \5--availability-zone us-east-1a \6--query 'Subnet.{SubnetId:SubnetId}' \7--output text)8
9# Add a name tag to the public subnet10aws ec2 create-tags \11--resources $AWS_PUBLIC_SUBNET \12--tags Key=Name,Value=DevOpsPublicSubnet
```

### [Create a private subnet](#create-a-private-subnet)

To create a private subnet, run the following command:

Terminal window

```
1# create a private subnet2AWS_PRIVATE_SUBNET=$(aws ec2 create-subnet \3--vpc-id $AWS_VPC \4--cidr-block 10.0.2.0/24 \5--availability-zone us-east-1a \6--query 'Subnet.{SubnetId:SubnetId}' \7--output text)8
9# Add a name tag to the private subnet10aws ec2 create-tags \11--resources $AWS_PRIVATE_SUBNET \12--tags Key=Name,Value=DevOpsPrivateSubnet
```

### [Enable auto-assign public IP on the subnet](#enable-auto-assign-public-ip-on-the-subnet)

To enable auto-assign public IP on the subnet, run the following command:

Terminal window

```
1# Enable auto-assign public IP on the public subnet2aws ec2 modify-subnet-attribute \3--subnet-id $AWS_PUBLIC_SUBNET \4--map-public-ip-on-launch
```

### [Create an internet gateway](#create-an-internet-gateway)

To create an internet gateway, run the following command:

Terminal window

```
1AWS_INTERNET_GATEWAY=$(aws ec2 create-internet-gateway \2--query 'InternetGateway.{InternetGatewayId:InternetGatewayId}' \3--output text)4
5# Add a name tag to the Internet Gateway6aws ec2 create-tags \7--resources $AWS_INTERNET_GATEWAY \8--tags Key=Name,Value=DevOpsInternetGateway
```

### [Create a NAT gateway](#create-a-nat-gateway)

To create a NAT gateway, run the following command:

Terminal window

```
1# Get Elastic IP2AWS_ELASTIC_IP=$(aws ec2 allocate-address \3--domain vpc \4--query 'AllocationId' \5--output text)6
7# Create a NAT gateway8AWS_NAT_GATEWAY=$(aws ec2 create-nat-gateway \9--subnet-id $AWS_PUBLIC_SUBNET \10--allocation-id $AWS_ELASTIC_IP \11--query 'NatGateway.{NatGatewayId:NatGatewayId}' \12--output text)13
14# Add a name tag to the NAT gateway15aws ec2 create-tags \16--resources $AWS_NAT_GATEWAY \17--tags Key=Name,Value=DevOpsNATGateway
```

### [Attach the internet gateway to your VPC](#attach-the-internet-gateway-to-your-vpc)

To attach the internet gateway to your VPC, run the following command:

Terminal window

```
1# Attach the Internet gateway to your VPC2aws ec2 attach-internet-gateway \3--vpc-id $AWS_VPC \4--internet-gateway-id $AWS_INTERNET_GATEWAY \5--query 'InternetGateway.{InternetGatewayId:InternetGatewayId}' \6--output text
```

### [Create a custom route table](#create-a-custom-route-table)

To create a route table, run the following command:

Terminal window

```
1# Create a custom route table2AWS_ROUTE_TABLE=$(aws ec2 create-route-table \3--vpc-id $AWS_VPC \4--query 'RouteTable.{RouteTableId:RouteTableId}' \5--output text)6
7# Add a name tag to the route table8aws ec2 create-tags \9--resources $AWS_ROUTE_TABLE \10--tags Key=Name,Value=DevOpsRouteTable
```

### [Create a custom route table association](#create-a-custom-route-table-association)

To create a custom route table association, run the following command:

Terminal window

```
1# Create a custom route table association2aws ec2 associate-route-table \3--route-table-id $AWS_ROUTE_TABLE \4--subnet-id $AWS_PUBLIC_SUBNET \5--output text
```

### [Associate the subnet with route table, making it a public subnet](#associate-the-subnet-with-route-table-making-it-a-public-subnet)

To associate the subnet with route table, making it a public subnet, run the following command:

Terminal window

```
1# Associate the subnet with route table, making it a public subnet2aws ec2 create-route \3--route-table-id $AWS_ROUTE_TABLE \4--destination-cidr-block 0.0.0.0/0 \5--gateway-id $AWS_INTERNET_GATEWAY \6--output text
```

### [Associate the NAT gateway with the route table, making it a private subnet](#associate-the-nat-gateway-with-the-route-table-making-it-a-private-subnet)

To associate the NAT gateway with the route table, making it a private subnet, run the following command:

Terminal window

```
1# Associate the NAT gateway with the route table, making it a private subnet2aws ec2 create-route \3--route-table-id $AWS_ROUTE_TABLE \4--destination-cidr-block 10.2.0.0/24 \5--nat-gateway-id $AWS_NAT_GATEWAY \6--output text
```

### [Create a security group](#create-a-security-group)

To create a security group, run the following command:

Terminal window

```
1# Create a security group2AWS_SECURITY_GROUP=$(aws ec2 create-security-group \3--group-name DevOpsSG \4--description "DevOps Security Group" \5--vpc-id $AWS_VPC \6--query 'GroupId' \7--output text)8
9# Add a name tag to the security group10aws ec2 create-tags \11--resources $AWS_SECURITY_GROUP \12--tags Key=Name,Value=DevOpsSG
```

### [Add a rule to the security group](#add-a-rule-to-the-security-group)

To add a rule to the security group, run the following command:

Terminal window

```
1# Add a rule to the security group2
3# Add SSH rule4aws ec2 authorize-security-group-ingress \5--group-id $AWS_SECURITY_GROUP \6--protocol tcp \7--port 22 \8--cidr 0.0.0.0/0 \9--output text10
11# Add HTTP rule12aws ec2 authorize-security-group-ingress \13--group-id $AWS_SECURITY_GROUP \14--protocol tcp \15--port 80 \16--cidr 0.0.0.0/0 \17--output text
```

## [Create an AWS EC2 instance](#create-an-aws-ec2-instance)

### [Get the latest AMI ID](#get-the-latest-ami-id)

To get the latest AMI ID, run the following command:

Terminal window

```
1# Get the latest AMI ID2AWS_AMI=$(aws ec2 describe-images \3  --owners 'amazon' \4  --filters 'Name=name,Values=amzn2-ami-hvm-2.0.*' \5  'Name=state,Values=available' \6  --query 'sort_by(Images, &CreationDate)[-1].[ImageId]' \7  --output 'text')
```

### [Create a key pair](#create-a-key-pair)

To create a key pair, run the following command:

Terminal window

```
1# Create a key pair2aws ec2 create-key-pair \3--key-name DevOpsKeyPair \4--query 'KeyMaterial' \5--output text > DevOpsKeyPair.pem6
7# Change the permission of the key pair8chmod 400 DevOpsKeyPair.pem
```

### [Create an EC2 instance](#create-an-ec2-instance)

Before creating an EC2 instance, you need to create a user data script. That script automates the previous three blog posts:

-   [How to Install Apache Web Server on Amazon Linux 2](/blog/post/how-to-install-apache-web-server-on-amazon-linux-2)
-   [How to Install PHP and MariaDB on Amazon Linux 2](/blog/post/how-to-install-php-and-mariadb-on-amazon-linux-2)
-   [How to Install and Setup FireWall on Amazon Linux 2](/blog/post/how-to-install-and-setup-firewall-on-amazon-linux-2)

You can find the user data script in the [GitHub repository](https://github.com/MKAbuMattar/install-and-setup-wordpress-on-amazon-linux-2)

Terminal window

```
1# Create a bash script to update packages, install git and clone the repo, and run the script2cat <<EOF > install.sh3#!/bin/bash4
5# Update packages6sudo yum update -y7
8# Install git9sudo yum install git -y10
11# Clone the repo12git clone https://github.com/MKAbuMattar/install-and-setup-wordpress-on-amazon-linux-2.git13
14# Run the script15bash install-and-setup-wordpress-on-amazon-linux-2/script.sh mkabumattar 121612 121612 wordpressdb wordpressuser password16EOF
```

To create an EC2 instance, run the following command:

Terminal window

```
1# Create an EC2 instance2AWS_EC2_INSTANCE=$(aws ec2 run-instances \3--image-id $AWS_AMI \4--instance-type t2.micro \5--key-name DevOpsKeyPair \6--monitoring "Enabled=false" \7--security-group-ids $AWS_SECURITY_GROUP \8--subnet-id $AWS_PUBLIC_SUBNET \9--user-data file://install.sh \10--private-ip-address 10.0.1.10 \11--query 'Instances[0].InstanceId' \12--output text)13
14# Add a name tag to the EC2 instance15aws ec2 create-tags \16--resources $AWS_EC2_INSTANCE \17--tags "Key=Name,Value=DevOpsInstance"
```

### [Check the status of the EC2 instance](#check-the-status-of-the-ec2-instance)

To check the status of the EC2 instance, run the following command:

Terminal window

```
1# Check the status of the EC2 instance2aws ec2 describe-instances \3--instance-ids $AWS_EC2_INSTANCE \4--query 'Reservations[*].Instances[*].[InstanceId,State.Name,PublicIpAddress]' \5--output text
```

### [Get the public IP address of your instance](#get-the-public-ip-address-of-your-instance)

To get the public IP address of your instance, run the following command:

Terminal window

```
1# Get the public ip address of your instance2AWS_PUBLIC_IP=$(aws ec2 describe-instances \3--instance-ids $AWS_EC2_INSTANCE \4--query 'Reservations[*].Instances[*].[PublicIpAddress]' \5--output text)6
7echo $AWS_PUBLIC_IP
```

### [SSH into the EC2 instance](#ssh-into-the-ec2-instance)

To SSH into the EC2 instance, run the following command:

Terminal window

```
1# SSH into the EC2 instance2ssh -i DevOpsKeyPair.pem ec2-user@$AWS_PUBLIC_IP
```

### [Show the WordPress website](#show-the-wordpress-website)

![WordPress on Amazon Linux 2](/assets/blog/0015-how-to-create-an-aws-ec2-instance-using-aws-cli/wordpress-on-amazon-linux-2-1.png)

## [Conclusion](#conclusion)

In this blog post, you learned how to create a VPC, a public subnet, a private subnet, a NAT gateway, a route table, a security group, and an EC2 instance. You also learned how to SSH into the EC2 instance.

## [References](#references)

-   [AWS CLI Command Reference - EC2](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/index.html)
-   [AWS CLI Command Reference - `ec2 create-vpc`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-vpc.html)
-   [AWS CLI Command Reference - `ec2 create-subnet`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-subnet.html)
-   [AWS CLI Command Reference - `ec2 create-internet-gateway`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-internet-gateway.html)
-   [AWS CLI Command Reference - `ec2 create-nat-gateway`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-nat-gateway.html)
-   [AWS CLI Command Reference - `ec2 create-route-table`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-route-table.html)
-   [AWS CLI Command Reference - `ec2 create-security-group`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-security-group.html)
-   [AWS CLI Command Reference - `ec2 run-instances`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/run-instances.html)
-   [AWS CLI Command Reference - `ec2 create-key-pair`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-key-pair.html)
-   [Amazon EC2 User Guide for Linux Instances - User Data](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html)
-   [Amazon VPC User Guide](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)
-   [WordPress Official Website](https://wordpress.org/)
-   [Tutorial: Installing a LAMP Web Server on Amazon Linux 2](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html)
-   [GitHub Repository for User Data Script](https://github.com/MKAbuMattar/install-and-setup-wordpress-on-amazon-linux-2)
-   [AWS Identity and Access Management (IAM) User Guide](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html)

Was this useful?

## Tags

[#AWS CLI EC2](/blog/tags/aws-cli-ec2)[#AWS CLI VPC](/blog/tags/aws-cli-vpc)[#VPC Configuration](/blog/tags/vpc-configuration)[#NAT Gateway](/blog/tags/nat-gateway)[#Security Groups](/blog/tags/security-groups)[#EC2 User Data](/blog/tags/ec2-user-data)[#Amazon Linux 2](/blog/tags/amazon-linux-2)[#WordPress Setup](/blog/tags/wordpress-setup)[#Apache](/blog/tags/apache)[#MariaDB](/blog/tags/mariadb)[#AWS Automation](/blog/tags/aws-automation)

## Share

[Facebook](https://facebook.com/sharer/sharer.php?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli "Share on Facebook")[Twitter](https://twitter.com/intent/tweet/?text=How%20To%20Create%20An%20AWS%20EC2%20Instance%20Using%20AWS%20CLI&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli "Share on Twitter")[LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli&title=How%20To%20Create%20An%20AWS%20EC2%20Instance%20Using%20AWS%20CLI&summary=How%20to%20build%20a%20VPC%2C%20subnets%2C%20an%20internet%20gateway%2C%20a%20NAT%20gateway%2C%20a%20route%20table%2C%20and%20a%20security%20group%20with%20the%20AWS%20CLI%2C%20then%20launch%20an%20EC2%20instance%20whose%20user%20data%20installs%20Apache%2C%20PHP%2C%20MariaDB%2C%20and%20WordPress.&source=https://mkabumattar.com "Share on LinkedIn")[WhatsApp](https://wa.me/?text=How%20To%20Create%20An%20AWS%20EC2%20Instance%20Using%20AWS%20CLI%20https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli "Share on WhatsApp")[Telegram](https://t.me/share/url?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli&text=How%20To%20Create%20An%20AWS%20EC2%20Instance%20Using%20AWS%20CLI "Share on Telegram")[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli&title=How%20To%20Create%20An%20AWS%20EC2%20Instance%20Using%20AWS%20CLI "Share on Reddit")[Hacker News](http://news.ycombinator.com/submitlink?u=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli&t=How%20To%20Create%20An%20AWS%20EC2%20Instance%20Using%20AWS%20CLI "Share on Hacker News")[Pinterest](https://pinterest.com/pin/create/button/?url=https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli&media=&description=How%20to%20build%20a%20VPC%2C%20subnets%2C%20an%20internet%20gateway%2C%20a%20NAT%20gateway%2C%20a%20route%20table%2C%20and%20a%20security%20group%20with%20the%20AWS%20CLI%2C%20then%20launch%20an%20EC2%20instance%20whose%20user%20data%20installs%20Apache%2C%20PHP%2C%20MariaDB%2C%20and%20WordPress. "Share on Pinterest")[Email](<mailto:?subject=How%20To%20Create%20An%20AWS%20EC2%20Instance%20Using%20AWS%20CLI&body=Check out this article: https%3A%2F%2Fmkabumattar.com%2Fblog%2Fpost%2Fhow-to-create-an-aws-ec2-instance-using-aws-cli>)

## Comments

## You might also enjoy

More posts on similar topics

[![How To Create A Custom VPC Using AWS CLI](/_astro/hero.BWXhtVCk_Z2s3b7P.webp)](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)

## [How To Create A Custom VPC Using AWS CLI](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [VPC](/blog/categories/vpc)
-   [AWS CLI](/blog/categories/aws-cli)
-   [Cloud Networking](/blog/categories/cloud-networking)
-   [Infrastructure as Code](/blog/categories/infrastructure-as-code)

Introduction The example below creates a VPC with an IPv4 CIDR block, a public subnet, and a private subnet, all with AWS CLI commands. Once the VPC and subnets are configured, you can run an inst

[#AWS VPC](/blog/tags/aws-vpc)[#AWS CLI Commands](/blog/tags/aws-cli-commands)[#Virtual Private Cloud](/blog/tags/virtual-private-cloud)+7 tags

[read more](/blog/post/how-to-create-a-custom-vpc-using-aws-cli)

[![How To Create a AWS S3 Bucket Using AWS CLI](/_astro/hero.CDw8keBv_tv9MO.webp)](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

## [How To Create a AWS S3 Bucket Using AWS CLI](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [S3](/blog/categories/s3)
-   [AWS CLI](/blog/categories/aws-cli)
-   [Cloud Storage](/blog/categories/cloud-storage)

Introduction In this post, I will show you how to create an AWS S3 bucket using AWS CLI. Prerequisites You need to have:AWS CLI installed and configured AWS S3 bucket nameAWS S3 bu

[#AWS S3 Bucket](/blog/tags/aws-s3-bucket)[#AWS CLI Commands](/blog/tags/aws-cli-commands)[#S3 Management](/blog/tags/s3-management)+3 tags

[read more](/blog/post/how-to-create-a-aws-s3-bucket-using-aws-cli)

[![How To Create a DynamoDB Table Using AWS CLI](/_astro/hero.DFm0nlBr_ZmQrVw.webp)](/blog/post/how-to-create-a-dynamodb-table-using-aws-cli)

## [How To Create a DynamoDB Table Using AWS CLI](/blog/post/how-to-create-a-dynamodb-table-using-aws-cli)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [DynamoDB](/blog/categories/dynamodb)
-   [AWS CLI](/blog/categories/aws-cli)
-   [NoSQL Databases](/blog/categories/nosql-databases)

Introduction In this article, we will learn how to create a DynamoDB table using AWS CLI. We will also learn how to add items to the table and how to query the table. Prerequisites To follow

[#AWS DynamoDB](/blog/tags/aws-dynamodb)[#AWS CLI Commands](/blog/tags/aws-cli-commands)[#NoSQL](/blog/tags/nosql)+4 tags

[read more](/blog/post/how-to-create-a-dynamodb-table-using-aws-cli)

[![How to Install WordPress on Amazon Linux 2](/_astro/hero.CFnKBY7F_2mvbUb.webp)](/blog/post/how-to-install-wordpress-on-amazon-linux-2)

## [How to Install WordPress on Amazon Linux 2](/blog/post/how-to-install-wordpress-on-amazon-linux-2)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [WordPress](/blog/categories/wordpress)
-   [LAMP Stack](/blog/categories/lamp-stack)
-   [Linux](/blog/categories/linux)

Introduction This tutorial installs WordPress on Amazon Linux 2 and configures it to run with Apache, PHP, and MariaDB. Prerequisites To follow along with this tutorial, you will need:An

[#WordPress Installation](/blog/tags/wordpress-installation)[#Amazon Linux 2](/blog/tags/amazon-linux-2)[#Apache Setup](/blog/tags/apache-setup)+5 tags

[read more](/blog/post/how-to-install-wordpress-on-amazon-linux-2)

[![How to Install and Configure Node.js on EC2 Instance Amazon Linux 2](/_astro/hero.CIYv_zEL_2aFueX.webp)](/blog/post/how-to-install-and-configure-nodejs-on-ec2-instance-amazon-linux-2)

## [How to Install and Configure Node.js on EC2 Instance Amazon Linux 2](/blog/post/how-to-install-and-configure-nodejs-on-ec2-instance-amazon-linux-2)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [Node.js](/blog/categories/nodejs)
-   [Linux](/blog/categories/linux)

Introduction Node.js does not exist in the default Amazon Linux 2 repository. So, we need to add the Node.js repository to the system. In this post, we will learn how to install and configure Node

[#Node.js Installation](/blog/tags/nodejs-installation)[#Amazon Linux 2](/blog/tags/amazon-linux-2)[#AWS EC2 Setup](/blog/tags/aws-ec2-setup)+3 tags

[read more](/blog/post/how-to-install-and-configure-nodejs-on-ec2-instance-amazon-linux-2)

[![How To Connect A Two EC2 Instances Data Transfer Using AWS CLI Without AWS EFS](/_astro/hero.WG5UXtzN_2uuusz.webp)](/blog/post/how-to-connect-a-two-ec2-instances-data-transfer-using-aws-cli-without-aws-efs)

## [How To Connect A Two EC2 Instances Data Transfer Using AWS CLI Without AWS EFS](/blog/post/how-to-connect-a-two-ec2-instances-data-transfer-using-aws-cli-without-aws-efs)

-   [Mohammad Abu Mattar](/authors/mohammad-abu-mattar)
-   [AWS](/blog/categories/aws)
-   [EC2](/blog/categories/ec2)
-   [S3](/blog/categories/s3)
-   [Data Transfer](/blog/categories/data-transfer)
-   [AWS CLI](/blog/categories/aws-cli)

Introduction In this post, I will show you how to transfer data between two EC2 instances using AWS CLI, without AWS EFS. We will use an AWS S3 bucket as the middleman. We will create an AWS S3 b

[#AWS S3 Sync](/blog/tags/aws-s3-sync)[#EC2 Data Transfer](/blog/tags/ec2-data-transfer)[#AWS CLI Automation](/blog/tags/aws-cli-automation)+5 tags

[read more](/blog/post/how-to-connect-a-two-ec2-instances-data-transfer-using-aws-cli-without-aws-efs)

6 related posts
