search
HomeSystem TutorialLINUXAn easy tutorial to create and configure a Linux virtual machine on AWS

An easy tutorial to create and configure a Linux virtual machine on AWS

Feb 10, 2024 pm 07:42 PM
linuxlinux tutoriallinux systemlinux commandshell scriptembeddedlinuxGetting started with linuxlinux learning

Cloud computing is a hot topic in today's IT industry. It can provide users with flexible, scalable, and low-cost computing resources and services. Amazon's AWS (Amazon Web Services) is the world's largest cloud computing platform and supports multiple operating systems, including Linux. This article will teach you how to create and configure a Linux virtual machine on AWS, and how to use SSH and SCP for remote management and file transfer.

An easy tutorial to create and configure a Linux virtual machine on AWS

AWS (Amazon Web Services) is one of the world's leading cloud server providers. You can set up a server in under a minute using the AWS platform. On AWS, you can fine-tune many technical details of the server, such as the number of CPUs, memory and disk space, disk type (faster SSD or classic IDE), etc. The best thing about AWS is that you only pay for the services you use. Before you start, AWS provides a special account called "Free Tier". You can use AWS technical services for free for one year, but there will be some small restrictions. For example, you cannot use the server for more than 750 hours per month. Any more than that and they'll charge you. You can view all relevant rules on the aws official website.

Since my article is about creating a Linux server on AWS, having a “Free Tier” account is a prerequisite. Let’s assume you have created a “Free Tier” account.

Before proceeding, you must know some terminology in AWS to understand the setup:

  • EC2 (Elastic Compute Cloud): This term is used for virtual machines.
  • AMI (Amazon Machine Image): Represents an operating system instance.
  • EBS (Elastic Block Storage): A type of storage environment in AWS.

Log in to the AWS console via the following link: https://console.aws.amazon.com/ .

The AWS console will look like this:

An easy tutorial to create and configure a Linux virtual machine on AWS

Amazon AWS console

Setting up a Linux VM in AWS

1. Create an EC2 (virtual machine) instance: Before starting to install the system, you must create a virtual machine in AWS. To create a virtual machine, click EC2 under the "compute" menu:

An easy tutorial to create and configure a Linux virtual machine on AWS

Create an EC2 instance

2. Now click the "Launch Instance" button under Create instance.

An easy tutorial to create and configure a Linux virtual machine on AWS

Launch the EC2 instance

3. Now, when you are using a “Free Tier” account, then it is best to select the “Free Tier” radio button so that AWS can filter out the instances that can be used for free. This allows you to not pay for the use of AWS resources.

An easy tutorial to create and configure a Linux virtual machine on AWS

Select Free Tier instances only

4. To continue, please select the following options:

a. Select an AMI (Amazon Machine Image) in the classic instance wizard, and then choose to use Red Hat Enterprise Linux 7.2 (HVM), SSD storage

b. Select "t2.micro" as the instance details.

c. Configure instance details: Do not change anything, just click Next.

d. Add storage: Do not change anything, just click Next as we will use the default 10(GiB) hard drive at this time.

e. Add tags: Don’t change anything just click next.

f. Configure security group: Now select port 22 for ssh so that you can access this server from anywhere.

An easy tutorial to create and configure a Linux virtual machine on AWS

Configure AWS server

g. Select the "Review and Launch" button.

h. If all the details are correct, click the “Launch” button.

i. After clicking the "Launch" button, the system will pop up a window to create a "key pair" as shown below: Select the option "create a new key pair" and give the key pair name and download it. This key pair is required when connecting to the server using ssh. Finally, click the Launch Instance button.

An easy tutorial to create and configure a Linux virtual machine on AWS

Create Key pair

j. After clicking the "Launch Instance" button, go to the service in the upper left corner. Select "compute" –> "EC2". Now click on "Running Instances":

An easy tutorial to create and configure a Linux virtual machine on AWS

Go to the running EC2 instance

k. Now you can see that the status of your new VM is "running". Select the instance and note the Public DNS name required to log in to the server.

An easy tutorial to create and configure a Linux virtual machine on AWS

Public DNS value of the VM

Now you have finished creating a VM running Linux. To connect to the server, follow the steps below.

Connecting to an EC2 instance from Windows

1. First, you need putty gen and Putty exe to connect to the server from Windows (or SSH command on Linux). You can download putty via the link below.

2. Now open putty gen: puttygen.exe.

3. You need to click the “Load” button, browse and select the key pair file (pem file) you downloaded from Amazon.

4. You need to select the “ssh2-RSA” option and click the Save Private Key button. Please select "yes" in the next pop-up window.

5. Save the file with the extension .ppk.

6. Now you need to open putty.exe. Click "connect" in the left menu, then select "SSH" and then "Auth." You need to click the Browse button to select the .ppk file we created in step 4.

7. Now click on the “session” menu and in “host name” paste the DNS value from step “k” in this tutorial and click on the “open” button.

8. When asked for a username and password, enter ec2-user and a blank password, and then enter the following command.

$ sudo su - 

Haha, you are now the owner of a Linux server hosted on the AWS cloud.

An easy tutorial to create and configure a Linux virtual machine on AWS

The above is the detailed content of An easy tutorial to create and configure a Linux virtual machine on AWS. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:良许Linux教程网. If there is any infringement, please contact admin@php.cn delete
What are the differences in virtualization support between Linux and Windows?What are the differences in virtualization support between Linux and Windows?Apr 22, 2025 pm 06:09 PM

The main differences between Linux and Windows in virtualization support are: 1) Linux provides KVM and Xen, with outstanding performance and flexibility, suitable for high customization environments; 2) Windows supports virtualization through Hyper-V, with a friendly interface, and is closely integrated with the Microsoft ecosystem, suitable for enterprises that rely on Microsoft software.

What are the main tasks of a Linux system administrator?What are the main tasks of a Linux system administrator?Apr 19, 2025 am 12:23 AM

The main tasks of Linux system administrators include system monitoring and performance tuning, user management, software package management, security management and backup, troubleshooting and resolution, performance optimization and best practices. 1. Use top, htop and other tools to monitor system performance and tune it. 2. Manage user accounts and permissions through useradd commands and other commands. 3. Use apt and yum to manage software packages to ensure system updates and security. 4. Configure a firewall, monitor logs, and perform data backup to ensure system security. 5. Troubleshoot and resolve through log analysis and tool use. 6. Optimize kernel parameters and application configuration, and follow best practices to improve system performance and stability.

Is it hard to learn Linux?Is it hard to learn Linux?Apr 18, 2025 am 12:23 AM

Learning Linux is not difficult. 1.Linux is an open source operating system based on Unix and is widely used in servers, embedded systems and personal computers. 2. Understanding file system and permission management is the key. The file system is hierarchical, and permissions include reading, writing and execution. 3. Package management systems such as apt and dnf make software management convenient. 4. Process management is implemented through ps and top commands. 5. Start learning from basic commands such as mkdir, cd, touch and nano, and then try advanced usage such as shell scripts and text processing. 6. Common errors such as permission problems can be solved through sudo and chmod. 7. Performance optimization suggestions include using htop to monitor resources, cleaning unnecessary files, and using sy

What is the salary of Linux administrator?What is the salary of Linux administrator?Apr 17, 2025 am 12:24 AM

The average annual salary of Linux administrators is $75,000 to $95,000 in the United States and €40,000 to €60,000 in Europe. To increase salary, you can: 1. Continuously learn new technologies, such as cloud computing and container technology; 2. Accumulate project experience and establish Portfolio; 3. Establish a professional network and expand your network.

What is the main purpose of Linux?What is the main purpose of Linux?Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

Does the internet run on Linux?Does the internet run on Linux?Apr 14, 2025 am 12:03 AM

The Internet does not rely on a single operating system, but Linux plays an important role in it. Linux is widely used in servers and network devices and is popular for its stability, security and scalability.

What are Linux operations?What are Linux operations?Apr 13, 2025 am 12:20 AM

The core of the Linux operating system is its command line interface, which can perform various operations through the command line. 1. File and directory operations use ls, cd, mkdir, rm and other commands to manage files and directories. 2. User and permission management ensures system security and resource allocation through useradd, passwd, chmod and other commands. 3. Process management uses ps, kill and other commands to monitor and control system processes. 4. Network operations include ping, ifconfig, ssh and other commands to configure and manage network connections. 5. System monitoring and maintenance use commands such as top, df, du to understand the system's operating status and resource usage.

Boost Productivity with Custom Command Shortcuts Using Linux AliasesBoost Productivity with Custom Command Shortcuts Using Linux AliasesApr 12, 2025 am 11:43 AM

Introduction Linux is a powerful operating system favored by developers, system administrators, and power users due to its flexibility and efficiency. However, frequently using long and complex commands can be tedious and er

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor