Host a Secure Website on AWS EC2 with Route 53 & SSL (Step-by-Step Guide)
Setting up a website on AWS can feel complicated at first — especially when DNS, SSL certificates, and server configuration come into the picture.
When I initially started learning cloud and DevOps, I struggled to connect all these pieces together.
So in this guide, I’ll walk through a practical setup process I used to:
- Purchase a domain
- Configure AWS Route 53
- Launch an EC2 server
- Point the domain correctly
- Enable HTTPS using SSL
This setup is simple, practical, and gives you a good understanding of how real-world hosting works.
What We’re Building
By the end of this setup, you’ll have:
- A custom domain connected to AWS
- An Ubuntu EC2 instance running Nginx
- HTTPS enabled using SSL
- A production-style cloud setup
Step 1: Purchase a Domain
The first step is getting a domain name.
For this setup, I used a domain from GoDaddy.
If you’re learning or testing, affordable domains like:
.shop.online.site.in
can be a good option.
Domain Purchase Tip
At the time of writing this guide, some .in domains on GoDaddy are available at discounted introductory pricing.
For example, promotional coupon codes like:
GOINDIA
may reduce the first-year registration cost significantly during promotional periods.
👉 Always check the latest pricing before purchasing, since offers and discounts can change over time.
Step 2: Create a Hosted Zone in AWS Route 53
After purchasing the domain, the next step is configuring DNS.
Go to:
- AWS Console
- Route 53
- Create Hosted Zone
Choose:
- Public Hosted Zone
Step 3: Update Name Servers in GoDaddy
Once the hosted zone is created, AWS provides Name Servers.
Example:
ns-xxxx.awsdns.com
Now update these inside your GoDaddy domain settings.
This connects your domain to AWS Route 53.
DNS changes may take a little time to propagate globally.
Step 4: Launch EC2 Instance
Next, launch an Ubuntu server on AWS EC2.
Recommended:
- Ubuntu AMI
- t2.micro (Free Tier eligible)
Bootstrap Script for Nginx
While launching the instance, I used a simple user-data script to automatically install Nginx.
#!/bin/bash
apt update -y
apt install nginx -y
systemctl enable nginx
systemctl start nginx
This saves time and automates the initial setup.
Step 5: Configure Security Group
Allow these ports:
| Port | Purpose |
|---|---|
| 22 | SSH |
| 80 | HTTP |
| 443 | HTTPS |
Without opening these ports, the website won’t work properly.
Step 6: Create DNS Records
Now connect your domain to the EC2 server.
A Record
Maps the domain to the EC2 public IPv4 address.
Example:
aws365.shop → EC2 Public IP
AAAA Record
Used for IPv6 mapping if needed.
CNAME Record
Useful for subdomains.
Example:
www.aws365.shop → aws365.shop
TXT and MX Records
These are commonly used for:
- Domain verification
- Email configuration
Understanding these record types helps a lot when working with cloud infrastructure.
Step 7: Setup SSL Certificate (HTTPS)
One of the most important parts of hosting a website is enabling HTTPS.
Modern websites should always use SSL for secure communication.
For SSL setup, I used Certbot.
Install Certbot
sudo apt install certbot python3-certbot-nginx -y
Generate SSL Certificate
sudo certbot --nginx
Certbot automatically:
- Generates SSL certificate
- Configures Nginx
- Redirects HTTP traffic to HTTPS
This makes the website secure and browser-friendly.
Verify HTTPS
After setup:
- Open your domain
- Check for the HTTPS lock icon in the browser
At this point, your website is running securely with SSL enabled.
Why This Setup is Valuable
This setup teaches several real-world DevOps and cloud concepts together:
- DNS management
- Linux server setup
- Cloud hosting
- Nginx basics
- SSL configuration
Instead of learning these separately, you understand how they connect in practical deployments.
Common Beginner Mistakes
Here are a few common issues beginners face:
- Forgetting to open port 443
- Wrong DNS records
- SSL setup before DNS propagation
- Incorrect security group configuration
If the domain doesn’t work immediately, give DNS some time to update globally.
Full Practical Video Walkthrough
I also recorded the complete hands-on walkthrough covering:
- Domain purchase
- Route 53 setup
- EC2 launch
- DNS records
- SSL configuration
You can watch it here:
Why Learning This Matters
Even if you are a beginner, understanding this setup gives you strong foundational knowledge for:
- DevOps
- Cloud engineering
- Web hosting
- Production deployments
These are practical concepts widely used in real environments.
Final Thoughts
Cloud and DevOps become much easier when you build things yourself instead of only watching tutorials.
Even a simple setup like this teaches:
- Networking
- Security
- DNS
- Server management
Once you practice it hands-on, the concepts become much clearer.
What You Should Do Next
Try this setup yourself:
- Launch a small EC2 instance
- Configure Route 53
- Enable SSL
- Host a simple website
Practical experience is one of the best ways to learn cloud technologies.
👉 Bonus Tip
Once you’re comfortable with this setup, try:
- Docker deployment
- Reverse proxy configuration
- Kubernetes hosting
That’s where cloud and DevOps become even more interesting.
Want a More Scalable Production Setup?
While hosting websites directly on an EC2 instance is a great way to learn Linux, Nginx, DNS, and SSL configuration, many modern frontend and static websites are hosted using a different architecture.
A common real-world setup uses:
- Amazon S3 for static file hosting
- CloudFront as a global CDN
- Route 53 for domain management
- HTTPS with SSL support
This approach is lightweight, scalable, and widely used for production frontend deployments.
👉 Read the complete guide here:
AWS S3 + CloudFront Setup Explained | Real-World Static Website Hosting Architecture
In that guide, I cover:
- S3 static website hosting
- CloudFront CDN integration
- Route 53 configuration
- HTTPS setup
- Cache invalidation and content updates
It’s a great next step if you want to understand modern cloud hosting architectures.
Here you can read:
About the Author
Madhukar Reddy is a DevOps engineer focused on AWS, Kubernetes, Docker, cloud infrastructure, and cyber security. He shares practical cloud and security content based on hands-on experience, real-world projects, and DevOps learning journeys.