Are you ready to take your first step into the cloud with Amazon Web Services (AWS)? Whether you’re building a portfolio site, an eCommerce shop, or an app backend, AWS gives you the power to deploy scalable, reliable, and secure solutions. In this guide, we’ll walk through the process of deploying a Node.js website on AWS, using key services like EC2, S3, and RDS.

Let’s get started.
What is AWS and Why Use It?
Amazon Web Services (AWS) is the most widely adopted cloud platform globally. It allows you to host websites and applications, scale infrastructure dynamically, and pay only for the resources you use. AWS also provides high performance, global reach, robust security, and access to cutting-edge services, including AI and machine learning.
Step 1: Create Your AWS Account
- Visit the AWS Website: Go to aws.amazon.com and click on Create a Free Account.
- Enter Your Email: This will be your root account login. You can add additional users later for better access control.
- Set a Password and Account Name.
- Provide Billing Information: Enter your credit card. You won’t be charged if you stay within the free tier.
- Verify Your Identity: Enter your phone number and confirm it via SMS.
- Select Support Plan: Choose the free basic support plan.
Once you complete the sign-up, you’ll be directed to the AWS Management Console.
Step 2: Choose the Right AWS Region
AWS services are hosted in data centers across the world, called regions. Select a region close to you or your customers to reduce latency and optimize costs. For example, you might select US East (N. Virginia).
Avoid regions like US West (N. California) if you’re trying to minimize expenses, as some services cost more there.
Step 3: Launch an EC2 Instance (Virtual Server)
- Open the EC2 Dashboard from the Services menu.
- Click Launch Instance.
- Name Your Instance (e.g., Mike’s Macaroon Market Website).
- Select OS Image: Stick with the default Amazon Linux 2 (free tier eligible).
- Choose Instance Type: Use t2.micro or t3.micro for the free tier.
- Key Pair: Proceed without one for now (though using SSH with a key pair is more secure).
- Network Settings: Leave defaults but ensure HTTP traffic will be allowed.
- Storage: 8 GB is enough for a small site.
Click Launch Instance.
Step 4: Configure Security Group for Port 8080
- Go to your instance’s Security tab.
- Click the Launch Wizard 1 group.
- Click Edit Inbound Rules > Add Rule:
- Type: Custom TCP
- Port: 8080
- Source: 0.0.0.0/0 (for demo purposes; use cautiously)
- Save the rule.
This allows external traffic to reach your Node.js application running on port 8080.
Step 5: Set Up S3 for Image Storage
- Go to S3 from the Services menu.
- Click Create Bucket.
- Bucket Name: Use a URL-safe name like
mikes-macaroon-market. - Region: Same as your EC2.
- Uncheck “Block All Public Access” and confirm.
- Add Tags:
- Key: app, Value: macaroon-market
- Key: environment, Value: production
- Click Create Bucket.
To make the bucket public:
- Go to the bucket > Permissions > Bucket Policy > Edit.
- Paste a policy that allows public read access (modify the resource name to match your bucket).
Step 6: Create Access Keys
- Click your account name > Security Credentials.
- Scroll to Access Keys > Create Access Key.
- Acknowledge the use of the root account.
- Save the Access Key ID and Secret Access Key securely.
These credentials allow your application to upload images to S3.
Step 7: Create a Postgres Database with RDS
- Open RDS under Database Services.
- Click Create Database.
- Choose Easy Create.
- Database Engine: Select PostgreSQL.
- Instance Name: e.g.,
mikes-macaroon-db. - Let AWS generate a password and save it.
- Scroll down to Set Up EC2 Connection, enable it, and select your EC2 instance.
This sets up secure network access between your app and the database.
After creation:
- Click View Credential Details to copy the DB username and password.
- Get the Database Endpoint from the connectivity section.
Step 8: Connect to EC2 and Deploy Your Website
- Go to EC2 > Select your instance > Connect.
- Use EC2 Instance Connect (browser-based SSH) and click Connect.
- In the terminal, install Git and Node.js:
sudo dnf install git -y
sudo dnf install nodejs -y
- Clone your project repository:
git clone https://github.com/yourusername/macaroon-market.git
cd macaroon-market
- Set environment variables:
export AWS_BUCKET_NAME=mikes-macaroon-market
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=your_access_key_id
export AWS_SECRET_ACCESS_KEY=your_secret_key
export DB_HOST=your-db-endpoint.rds.amazonaws.com
export DB_PASSWORD=your_db_password
- Install Node dependencies:
npm install
- Start the application:
npm start
To keep it running even after logout, use a process manager like PM2 or screen.
You’re Live!
Congratulations — your Node.js web application is now running on AWS! It’s connected to a database via RDS and storing images using S3. You’ve successfully leveraged some of the most popular AWS services to build and host a scalable web app.
Tags and Hashtags
Tags: AWS, Amazon Web Services, EC2, S3, RDS, Cloud Hosting, Web Hosting, Node.js, Cloud Deployment, AWS Tutorial, Website Deployment, Beginner Guide
Hashtags:
#AWS #NodeJS #WebDevelopment #CloudComputing #EC2 #S3 #RDS #FullStack #AWSTutorial #CloudHosting #WebAppDeployment #AmazonWebServices