
The Complete Guide: Deploying a Static Site on AWS using Nginx and User Data
Introduction In this guide, you’ll learn how to deploy a static website on an AWS Ubuntu server using Nginx. Instead of manually installing Nginx and copying files each time, we’ll use EC2 user data to automate everything when the instance launches. We’ll use the Graphite Creative template from Tooplate: Template 📌 Project Prerequisites Before starting, make sure you have: An active AWS account Basic understanding of EC2 A created EC2 key pair (for SSH access) Security group allowing: SSH (Port 22) HTTP (Port 80) Internet access enabled on your EC2 instance (public subnet + internet gateway) 🧠 What We’re Automating When the EC2 instance launches, it will: Update packages Install Nginx Install wget & unzip Download the website template Extract it Move files into /var/www/html Start and enable Nginx All automatically via User Data. Step 1: Launch an Ubuntu EC2 Instance Go to AWS Console → EC2 Click Launch Instance Choose: Ubuntu Server 24.04 LTS Select instance type: t2.micro (Free Tier
Continue reading on Dev.to
Opens in a new tab




