DEV Community

Cover image for Deploying a Web Application on AWS EC2: From Localhost to Public Access (Day 3)
Avinash wagh
Avinash wagh

Posted on

Deploying a Web Application on AWS EC2: From Localhost to Public Access (Day 3)

When I started my transition from .NET development to Cloud Engineering, I knew one thing:

Reading documentation wouldn’t be enough.

I had to deploy something real.

Today, I successfully deployed my web application to a live cloud server using a Linux EC2 instance and Nginx β€” and accessed it publicly from both my laptop and mobile device using a public IP address.

This was the moment my application left localhost.

πŸš€ The Objective

Deploy a static web application on a cloud-based Linux server and make it accessible over the internet.

  • No managed platforms.
  • No deployment shortcuts.
  • Just core infrastructure.

πŸ— Step 1: Provisioning the Cloud Server

I launched a t3.micro Linux instance using
Amazon Elastic Compute Cloud
on
Amazon Web Services

Configured:

  • Key Pair for secure SSH access
  • Security Group allowing HTTP (Port 80)
  • Default EBS storage

At this point, I had a virtual machine running in the Mumbai region β€” ready to host my application.

πŸ” Step 2: Secure Remote Access

Using SSH and key-based authentication, I connected to the instance from my terminal.

This was the first mindset shift.

This wasn’t localhost anymore.
This was a remote server running inside AWS infrastructure.

βš™ Step 3: Installing and Configuring Nginx

I installed
Nginx
to act as the web server.

After verifying the service was running, I:

  • Removed the default Nginx welcome page
  • Copied my application files into /var/www/html/
  • Restarted the Nginx service

Then I opened the public IP in my browser.

And it worked.

🌍 The First Real Test – Laptop Browser

Below is my application successfully running via EC2 Public IP in a desktop browser:

πŸ“Έ Screenshot 1 – Application Running on Laptop

Application deployed on EC2 and accessible publicly via Public IP address.

At this moment, the deployment was successful.

But I wanted one more confirmation.

πŸ“± The Real Validation – Mobile Access

To ensure it wasn’t dependent on my system:

  • I disconnected my laptop.
  • Switched to mobile internet.
  • Entered the Public IP in my phone browser.

And it loaded instantly.

πŸ“Έ Screenshot 2 – Application Running on Mobile

Application accessible globally via mobile browser β€” independent of local system.

That’s when it truly clicked.

The server runs independently of my laptop.
The application lives in the cloud.

🧠 Key Technical Takeaways

This hands-on deployment reinforced several important cloud fundamentals:

  • Difference between localhost and public IP
  • How Security Groups act as firewalls
  • Why opening Port 80 is necessary
  • How Nginx serves static content
  • Understanding instance lifecycle and cost awareness
  • Importance of Elastic IP for production stability

Most importantly, I started thinking in terms of infrastructure β€” not just application logic.

πŸ’° Cost Awareness

Using a t3.micro under AWS Free Tier:

  • 750 hours per month available
  • Suitable for continuous hands-on learning
  • Encourages cost-conscious cloud usage

Cloud engineering is not only about scalability.
It’s about efficiency and responsible architecture.

🎯 Reflection

As a developer transitioning into cloud engineering, today felt like a milestone.

Writing code is powerful.

But deploying that code to a live cloud server β€” configuring compute, networking, and services β€” builds a completely different level of understanding.

This wasn’t just hosting a webpage.

It was building a small, real-world infrastructure setup from scratch.

And this is only Day 3.

On to the next challenge πŸš€

Top comments (0)