{"id":30883245,"url":"https://github.com/chintanboghara/ec2-instance-roadmap.sh","last_synced_at":"2026-02-13T05:05:51.611Z","repository":{"id":312510154,"uuid":"967192704","full_name":"chintanboghara/EC2-Instance-roadmap.sh","owner":"chintanboghara","description":"Create an EC2 instance on AWS and connect to it using SSH.","archived":false,"fork":false,"pushed_at":"2025-08-31T05:24:47.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T07:13:23.518Z","etag":null,"topics":["devops","roadmap-sh"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chintanboghara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-04-16T04:35:10.000Z","updated_at":"2025-08-31T05:24:48.000Z","dependencies_parsed_at":"2025-08-31T07:13:29.441Z","dependency_job_id":"20034ac5-7bad-4bad-9017-0be372181545","html_url":"https://github.com/chintanboghara/EC2-Instance-roadmap.sh","commit_stats":null,"previous_names":["chintanboghara/ec2-instance-roadmap.sh"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chintanboghara/EC2-Instance-roadmap.sh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FEC2-Instance-roadmap.sh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FEC2-Instance-roadmap.sh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FEC2-Instance-roadmap.sh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FEC2-Instance-roadmap.sh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chintanboghara","download_url":"https://codeload.github.com/chintanboghara/EC2-Instance-roadmap.sh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chintanboghara%2FEC2-Instance-roadmap.sh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166915,"owners_count":25233959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devops","roadmap-sh"],"created_at":"2025-09-08T09:43:43.911Z","updated_at":"2026-02-13T05:05:51.585Z","avatar_url":"https://github.com/chintanboghara.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploy a Static Website on AWS EC2\n\nlaunching an AWS EC2 instance, setting up an Ubuntu Linux server, and deploying a simple static website using Nginx.\n\n## Prerequisites\n- An AWS account (sign up at [aws.amazon.com](https://aws.amazon.com) if needed).\n- Basic familiarity with terminal commands (on macOS/Linux) or an SSH client like PuTTY (on Windows).\n- A web browser to test the site.\n\n**Note**: While this project uses Free Tier-eligible resources (e.g., t2.micro instance), monitor your AWS usage to avoid unexpected charges. AWS Free Tier limits apply for the first 12 months.\n\n## Repository Structure\n\n```\nEC2-Instance-roadmap.sh/\n├── website/\n│   └── index.html      # Sample static website HTML file\n└── README.md           # This documentation file\n```\n\n## Setup Instructions\n\n### Step 1: Launch an EC2 Instance\n1. Log in to the [AWS Management Console](https://console.aws.amazon.com).\n2. Navigate to **EC2** under the **Compute** section.\n3. Click **Launch Instances** and configure as follows:\n   - **Name and tags**: Add a name like `My-Ubuntu-Server` for easy identification.\n   - **Application and OS Images (AMI)**: Search for and select **Ubuntu Server 22.04 LTS** (or 20.04 LTS; ensure it's \"Free tier eligible\").\n   - **Instance type**: Choose `t2.micro` (Free Tier eligible).\n   - **Key pair (login)**: Create a new key pair (e.g., `ubuntu-key`), select `.pem` format, and download it. Store securely.\n   - **Network settings**:\n     - Use default VPC and subnet.\n     - Create a new security group (e.g., `WebServerSG`).\n     - Add inbound rules:\n       - **SSH**: Type: SSH, Protocol: TCP, Port: 22, Source: My IP (for security; use `0.0.0.0/0` if testing from multiple locations, but this is less secure).\n       - **HTTP**: Type: HTTP, Protocol: TCP, Port: 80, Source: `0.0.0.0/0` (for public web access).\n   - **Configure storage**: Keep the default 8 GiB gp2 (General Purpose SSD).\n4. Review and launch the instance.\n5. Wait for the instance status to show \"Running\" in the EC2 dashboard. Note the **Public IPv4 address** (e.g., `54.123.45.67`).\n\n### Step 2: Connect to the EC2 Instance\n1. On your local machine, open a terminal (macOS/Linux) or PuTTY (Windows).\n2. Set restrictive permissions on your key file:\n   ```bash\n   chmod 400 /path/to/ubuntu-key.pem\n   ```\n3. Connect via SSH:\n   ```bash\n   ssh -i /path/to/ubuntu-key.pem ubuntu@\u003cpublic-ip-address\u003e\n   ```\n   - Replace `\u003cpublic-ip-address\u003e` with your instance's IP.\n   - Accept the host key fingerprint if prompted (`yes`).\n\n**Troubleshooting**:\n- Ensure the instance is running and reachable.\n- Verify security group rules allow SSH from your IP.\n- Check key file permissions (must be 400).\n- If using PuTTY, convert `.pem` to `.ppk` format.\n\n### Step 3: Install and Configure Nginx\n1. Update package lists and upgrade installed packages:\n   ```bash\n   sudo apt update \u0026\u0026 sudo apt upgrade -y\n   ```\n2. Install Nginx:\n   ```bash\n   sudo apt install nginx -y\n   ```\n3. Start Nginx and enable it to run on boot:\n   ```bash\n   sudo systemctl start nginx\n   sudo systemctl enable nginx\n   ```\n4. Verify Nginx status:\n   ```bash\n   sudo systemctl status nginx\n   ```\n   - Look for \"Active: active (running)\".\n\n**Troubleshooting**: If installation fails, retry `sudo apt update`. Ensure you're connected as the `ubuntu` user.\n\n### Step 4: Deploy the Static Website\nChoose one option below.\n\n#### Option 1: Clone This Repository (Recommended)\n1. Install Git:\n   ```bash\n   sudo apt install git -y\n   ```\n2. Clone the repository:\n   ```bash\n   git clone https://github.com/chintanboghara/EC2-Instance-roadmap.git\n   ```\n   (Adjust the URL if your repo differs.)\n3. Copy the sample HTML file to Nginx's web directory:\n   ```bash\n   sudo cp EC2-Instance-roadmap/website/index.html /var/www/html/index.html\n   ```\n\n#### Option 2: Manually Create the HTML File\n1. Edit the default index file:\n   ```bash\n   sudo nano /var/www/html/index.html\n   ```\n2. Paste the following content:\n   ```html\n   \u003c!DOCTYPE html\u003e\n   \u003chtml lang=\"en\"\u003e\n   \u003chead\u003e\n       \u003cmeta charset=\"UTF-8\"\u003e\n       \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\u003e\n       \u003ctitle\u003eMy Static Website\u003c/title\u003e\n   \u003c/head\u003e\n   \u003cbody\u003e\n       \u003ch1\u003eHello, World!\u003c/h1\u003e\n       \u003cp\u003eThis is my simple static website hosted on AWS EC2.\u003c/p\u003e\n   \u003c/body\u003e\n   \u003c/html\u003e\n   ```\n3. Save and exit (in nano: Ctrl+O, Enter, Ctrl+X).\n\n4. Restart Nginx to apply changes:\n   ```bash\n   sudo systemctl restart nginx\n   ```\n\n### Step 5: Access the Website\n1. Open a web browser.\n2. Visit `http://\u003cpublic-ip-address\u003e`.\n3. You should see the \"Hello, World!\" page.\n\n**Troubleshooting**:\n- Page not loading? Check Nginx status, security group (HTTP port 80 open), and file location (`/var/www/html/index.html`).\n- Use `curl http://localhost` on the instance to test locally.\n- If the IP changes (e.g., after reboot), check the EC2 dashboard for the new public IP.\n\n## Cleanup\nTo avoid charges:\n1. In the EC2 dashboard, select your instance.\n2. Choose **Instance state** \u003e **Terminate instance**.\n3. Confirm termination. This deletes the instance and stops billing (data on the root volume is lost unless snapshotted).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchintanboghara%2Fec2-instance-roadmap.sh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchintanboghara%2Fec2-instance-roadmap.sh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchintanboghara%2Fec2-instance-roadmap.sh/lists"}