Type something to search...
Introduction to AWS EC2: Building Your First Cloud Server

Introduction to AWS EC2: Building Your First Cloud Server

Amazon EC2 lets you rent a virtual server in AWS's data centers with a few clicks, and the free tier makes it practical for learning. Creating your first instance comes down to six settings (region, AMI, instance type, key pair, security group, storage), after which you connect over SSH from a terminal.

Why do you need a server for a web application?

An app that only runs on your computer's local host (localhost:3000) is only half complete. To let anyone in the world access it, you need a computer that is always on and connected to the Internet: a Server.

In the past, you had to buy your own server computer and connect network cables. Now, thanks to cloud computing, you can rent a powerful virtual server in about 5 minutes with just a few clicks. This guide covers EC2 (Elastic Compute Cloud), the most basic core service of Amazon Web Services (AWS), the world's No. 1 cloud service, and walks through creating an instance.

What is EC2 (Elastic Compute Cloud)?

EC2 is a flexibly sized virtual server hosting service provided by AWS. Simply put, it means "borrowing as much of the resources (CPU, RAM, disk) of high-performance computers in Amazon's huge data centers as you want".

Key features of EC2

  • Elasticity: You can optimize costs by raising server performance or adding servers (Scale-up/out) when traffic is high, and scaling back down (Scale-down/in) when traffic decreases.
  • Various operating systems: You can choose the operating system (AMI) you want, including Linux (Ubuntu, Amazon Linux, etc.) and Windows Server.
  • Billing per second: It uses a pay-as-you-go model where you pay only for the time the server is running, so there is no upfront infrastructure cost.
  • Free Tier: New subscribers can use t2.micro instances for 750 hours per month (effectively an entire month) for free for one year. Perfect for learning!

How do you create an EC2 instance?

The AWS console screens change frequently and can look complex, but the core setup steps are always the same:

1. Select region

Choose the physical location of the AWS data center. If Korean users are your main target, select 'Asia Pacific (Seoul) - ap-northeast-2' in the upper right corner to minimize network latency.

2. Select AMI (Amazon Machine Image)

Just as you choose between Android and iOS when buying a smartphone, this step chooses the server's operating system. For beginners, the latest LTS version of Ubuntu Server is recommended because it has the largest community support and is easy to use. Check for the 'Free Tier Available' mark.

3. Select Instance Type

Decide the server's hardware specifications (number of CPU cores, memory capacity). Select t2.micro, which the free tier covers. (In some regions t3.micro is the free tier option, so check the mark.)

4. Generate and download key pair

This is the most important step for security! Create a master key (used instead of a password) for remote SSH access to the EC2 server. Select the RSA method and download it in .pem format. Caution: This key file can only be downloaded once, so keep it in a safe place where it cannot be lost or leaked. Be extremely careful not to accidentally upload it to GitHub.

5. Network and Security Group Settings

A security group is a virtual firewall around the server that decides which ports accept incoming traffic.

  • SSH (port 22): Must be open so you can access and manage the server remotely. Where possible, set the source type to 'My IP' so only you can connect.
  • HTTP (port 80) / HTTPS (port 443): To run a web server that general users can reach, open these ports to 'Anywhere'.

6. Storage (EBS) configuration

Set the server's hard disk (SSD) capacity. The Free Tier allows up to 30GB for free, so it is a good idea to raise it from the default (8GB) to 30GB.

How do you connect to an EC2 instance from a terminal (Mac/Linux)?

Once the instance status is 'Running', note its assigned 'Public IPv4 Address', open a terminal, and connect using the downloaded key pair (.pem).

# 1. Change the permissions of the key pair file so that only you can read it. (Very important!)
chmod 400 my-key-pair.pem

# 2. Connect to the server using the SSH command. (The default username for Ubuntu AMI is ubuntu.)
ssh -i /path/my-key-pair.pem ubuntu@public_IP_address

On the first connection, enter yes when asked whether to continue with the fingerprint. If your terminal prompt changes to ubuntu@ip-172-xx-xx-xx:~$, congratulations: you are connected to your own cloud server.

What should you do after connecting?

You can now install Node.js on this empty Ubuntu server, pull your code with Git, and launch your app. EC2 is the most basic service, but it is the first step to understanding cloud infrastructure. Don't forget to 'stop' or 'terminate (delete)' your instance when not in use to avoid a huge bill!

Related Post

Complete CI/CD pipeline automation starting with GitHub Actions

Complete CI/CD pipeline automation starting with GitHub Actions

CI/CD replaces error-prone manual deployment with automated builds, tests, and releases, and GitHub Actions is one of the easiest ways to set it up because it runs directly inside your GitHub reposit

Summary of essential Linux terminal commands for backend developers

Summary of essential Linux terminal commands for backend developers

To manage a cloud server or Docker environment, you need a small set of core Linux terminal commands: navigation (pwd, ls, cd), file manipulation (mkdir, cp, mv, rm), reading logs (`cat

Cloud Native Architecture Essential Guide: From MSA to Kubernetes

Cloud Native Architecture Essential Guide: From MSA to Kubernetes

Cloud native is a paradigm in which an application's design method and operational culture are rebuilt from the beginning for the cloud, so that its flexibility, scalability and elasticity can be ful

WebAssembly Innovation: Beyond the Browser to Cloud Native

WebAssembly Innovation: Beyond the Browser to Cloud Native

WebAssembly (Wasm) has moved beyond the browser: with WASI, it now runs on servers, edge platforms, and plugin systems as a lightweight, sandboxed, portable alternative or complement to Docker contai

Zero Trust Architecture (ZTA): A security paradigm shift in the cloud era

Zero Trust Architecture (ZTA): A security paradigm shift in the cloud era

Zero Trust Architecture (ZTA) replaces the old "safe inside, dangerous outside" model with one rule: trust no user, device, or application by default, and verify every request. In 2026 that means con

Platform Engineering: The Next Evolutionary Step in DevOps

Platform Engineering: The Next Evolutionary Step in DevOps

Platform engineering is the practice of building a self-service Internal Developer Platform (IDP) that hides infrastructure complexity behind a "golden path," so application developers can ship safel

The Rise of Edge Computing: Ultra-Low Latency Architecture Overcoming the Limits of Cloud

The Rise of Edge Computing: Ultra-Low Latency Architecture Overcoming the Limits of Cloud

What Is Edge Computing and Why Does It Matter? Edge Computing moves computation from the central cloud to the "edge," close to where data is generated, so devices can act in milliseconds inst

Cloud Repatriation: Why Companies are Ditching AWS for Bare Metal in 2026

Cloud Repatriation: Why Companies are Ditching AWS for Bare Metal in 2026

Cloud repatriation is the move of workloads off hyperscale clouds like AWS and Azure and back to bare metal servers or colocation facilities. In 2026, companies are doing it mainly to cut cos

Mastering Kubernetes: Container Orchestration Beyond Docker

Mastering Kubernetes: Container Orchestration Beyond Docker

Kubernetes (k8s) is a container orchestration tool that automates deploying, scaling, and managing dozens or hundreds of containers across many servers. Where Docker packages a single application, Ku

Tips for using Google Drive

Tips for using Google Drive

The fastest ways to work smarter in Google Drive are offline mode, shortcut keys, advanced search, and version history—plus real-time co-editing and Google Drive for Desktop. Used together, these tur