{"id":23674554,"url":"https://github.com/janisadhi/ec2_instance","last_synced_at":"2026-02-15T05:32:45.905Z","repository":{"id":269927632,"uuid":"908878525","full_name":"janisadhi/Ec2_Instance","owner":"janisadhi","description":"guide to create ec2 instance , ssh connection and nginx","archived":false,"fork":false,"pushed_at":"2024-12-27T07:33:29.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-27T08:28:01.726Z","etag":null,"topics":["aws","nginx","ssh"],"latest_commit_sha":null,"homepage":null,"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/janisadhi.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}},"created_at":"2024-12-27T07:28:49.000Z","updated_at":"2024-12-27T07:38:42.000Z","dependencies_parsed_at":"2024-12-27T08:38:08.495Z","dependency_job_id":null,"html_url":"https://github.com/janisadhi/Ec2_Instance","commit_stats":null,"previous_names":["janisadhi/ec2_instance"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janisadhi%2FEc2_Instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janisadhi%2FEc2_Instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janisadhi%2FEc2_Instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janisadhi%2FEc2_Instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janisadhi","download_url":"https://codeload.github.com/janisadhi/Ec2_Instance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239706980,"owners_count":19683984,"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","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":["aws","nginx","ssh"],"created_at":"2024-12-29T13:27:31.688Z","updated_at":"2025-10-05T09:55:51.062Z","avatar_url":"https://github.com/janisadhi.png","language":"HTML","readme":"\n# Deploying a Static Website on AWS EC2\n\nThis project demonstrates how to set up a Linux server on AWS EC2 and deploy a simple static website. Below are the steps I followed to complete this project.\n\n---\n\n## Requirements\n- **AWS Account**: Created and configured an AWS account.\n  - Logged in through the root account or IAM user.\n  - Created a key pair for secure SSH access.\n- **Instance Specifications**:\n  - **AMI**: Ubuntu Server\n  - **Instance Type**: t3.micro (Free Tier eligible)\n  - **Network**: Default VPC and subnet for your region\n  - **Inbound Rules**: Allowed traffic on ports 22 (SSH) and 80 (HTTP)\n  - **Key Pair**: Created a new key pair for SSH access\n  - **Public IP**: Assigned a public IP address to the instance\n\n---\n\n## Steps Taken\n\n### 1. Launching an EC2 Instance\n- Navigated to the AWS Management Console and launched a new EC2 instance with the specified configurations.\n- Configured the security group to allow:\n  - SSH (port 22) for remote access.\n  - HTTP (port 80) for web traffic.\n\n### 2. Connecting to the Instance via SSH\n- Used the private key file downloaded from AWS to connect to the instance:\n  ```bash\n  ssh -i \u003cpath-to-private-key\u003e ubuntu@\u003cpublic-ip\u003e\n  ```\n  Alternatively:\n  - Accessed the instance through:\n    ```bash\n    ssh -i \".pem file\" ubuntu@\u003cpublic-ip\u003e\n    ```\n  - Accessed the EC2 instance console through HTTP, added my public key to the instance at `~/.ssh/authorized_keys`, and connected using:\n    ```bash\n    ssh -i \"id_rsa\" ubuntu@\u003cpublic-ip\u003e\n    ```\n  - Created an SSH configuration file for simplified access with an alias and connected using:\n    ```bash\n    ssh \u003calias\u003e\n    ```\n\n### 3. Updating System Packages\n- Updated the instance's package list and installed necessary updates:\n  ```bash\n  sudo apt update\n  sudo apt upgrade -y\n  ```\n\n### 4. Installing a Web Server\n- Installed Nginx as the web server:\n  ```bash\n  sudo apt install nginx -y\n  ```\n- Verified that Nginx was running by visiting the public IP address in a browser.\n\n### 5. Creating a Static Website\n- Created a simple HTML file for the website:\n  ```bash\n  cd /var/www/html/\n  \n  sudo nano index.html \n  #then copy the html file to it \n  ```\n\n### 6. Deploying the Website\n- Restarted the Nginx service to ensure the new HTML file was served:\n  ```bash\n  sudo systemctl restart nginx\n  ```\n- Accessed the static website using the EC2 instance's public IP address.\n\n---\n\n\nThis project is part of [Janis Adhikari's](https://roadmap.sh/projects/ec2-instance)  DevOps projects.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanisadhi%2Fec2_instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanisadhi%2Fec2_instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanisadhi%2Fec2_instance/lists"}