Part 4 of 12 — 12 Hands-On AWS Projects
Introduction
You know the Netflix home page — a big hero section, rows of movie cards, and a clean dark look. In this project I will build a landing page in that style and host it on an EC2 instance with Nginx. It is a simple project, but it teaches the core of web hosting: a server, a web server program, some files, and a public link anyone can open.
What you will build
- An EC2 instance running Nginx
- A Netflix-style landing page built with plain HTML and CSS
- The page served from the Nginx folder
/usr/share/nginx/html - A public link anyone can open in a browser
Architecture
You upload your page files to the EC2 instance, Nginx serves them, and the browser shows the landing page.
Prerequisites
- An AWS account (the free tier works for this project)
- An EC2 Linux instance running, with your key pair
- An SSH client (Git Bash, Command Prompt, PuTTY or MobaXterm)
- Your HTML and CSS files ready on your laptop
- Basic comfort with the terminal
Steps
1. Launch the EC2 instance
Launch an Amazon Linux instance. Your security group must allow port 22 for SSH and port 80 for HTTP traffic. Port 80 is the one the browser will use, so do not skip it.
2. Connect over SSH
Connect to the instance the way you learned in Project 3:
ssh -i my-key.pem ec2-user@<Public-IP> 3. Install Nginx
Install and start Nginx with these three commands:
sudo yum install nginx sudo systemctl start nginx sudo systemctl enable nginx The first command installs it, the second starts it now, and the third makes it start again automatically if the server restarts.
4. Check the welcome page
Open http://<Public-IP> in your browser. You should see the Nginx welcome page. That means the web server is running and port 80 is open.
5. Build your landing page
On your laptop, create a small page called index.html with a hero section, a headline, and a few rows of movie cards. Add a style.css for the dark background and layout. Keep it simple — a headline, a button, and some coloured cards are enough to learn the flow.
Note: make your own design inspired by a streaming homepage. Do not copy the Netflix logo, artwork or movie posters — use your own text and simple placeholder cards.
6. Upload the files
Copy your files to the server with scp:
scp -i my-key.pem -r netflix-ui/* ec2-user@<Public-IP>:/home/ec2-user/ This copies everything from your local netflix-ui folder to the home folder on the server.
7. Move the files into the Nginx folder
Nginx serves files from /usr/share/nginx/html. Move yours there:
sudo cp -r /home/ec2-user/* /usr/share/nginx/html/ sudo systemctl reload nginx The reload makes Nginx pick up the new files without stopping the server.
8. Open your page
Open http://<Public-IP> again. This time you should see your own landing page instead of the Nginx welcome page. Share the link with a friend and let them open it too.
9. Make it yours
Change the headline, add another row of cards, or change the colours, then upload again and reload Nginx. Edit, upload, reload — that is the whole cycle.
If the page does not load
- Nginx welcome page still showing: your files did not reach
/usr/share/nginx/html, or the file name is notindex.html. Check the folder withls /usr/share/nginx/html/. - Page never loads: the security group is missing port 80, or Nginx is not running. Check with
sudo systemctl status nginx. - Permission error on upload: you are copying into a folder your user cannot write to. Copy to your home folder first, then move the files with
sudo cpas in step 7.
What you learned
- How a web server serves files from a folder
- How to move files to a server with
scp - Why port 80 must be open in the security group
- How a landing page is just HTML, CSS and a server
- How install, start and enable work together on Linux
Cleanup
When you are done, terminate the EC2 instance from the console so it stops billing. If you want to keep the page, save your HTML and CSS files on your laptop first — the server copy goes away with the instance.
Try next
In Project 5, we take the same Netflix page and host it free on GitHub Pages with Nginx-style hosting, no server to manage at all.
About Cloud Messenger — Learn • Build • Visualize • Troubleshoot • Grow | cloudmessenger.in | linkedin.com/in/cloud-messenger | github.com/Cloud-Messenger | #buildwithCloudMessenger
