AWS Free Website Hosting

Abhishek Jaiswal
4 min readNov 24, 2024

--

Photo by Carlos Muza on Unsplash

Yes you heard that right, with AWS(Amazon Web Services) you can host your website free-of-cost, unless you have a AWS free tier account*

So, to give you a little hint about how we are going to do this, but before that forget not to SUBSCRIBE to my newsletter, this will keep me motivated 🙂

But why AWS Elastic Beanstalk ?

  1. Offers Quicker Deployment : ready to use infrastructure
  2. Supports Multi-Tenant Architecture : share your applications across different devices
  3. Simplifies Operations : auto configure servers, databases, firewalls, networks and many more
  4. Offers Complete Resource Control : freedom to select the AWS resources, like EC2 instance type.

What are AWS Elastic Beanstalk Components ?

  1. Application : Conceptually similar to a folder
  2. Application Version : labeled iteration of deployed code, points to an Amazon S3 object that contains the deployable code such as a Java WAR file
  3. Environment : environment where the current version of the application will be active
  4. Environment Tier : they are of 2 types
    - Web Server Environment: Handles HTTP requests from clients
    - Worker Environment: Processes background tasks which are resource consuming and time intensive

How to go with the deployment ?

Prerequisites

  1. Your code that needs to be deployed
  2. Your free tier account of AWS
  3. A cup of Coffee/Tea on the table 😁

Let’ssss gooooo!!!

Step 1 : Head to AWS Sign Up/Sign In console to be logged in to start the process.

Step 2 : Navigate to All Services and look for Elastic Beanstalk

Step 3 : Click on Create Application

Step 4 : Select the Web Server Environment, input the Application Name

Step 5 : Enter the platform type, and your required versions

Step 6 : Run the below command and create a zip of the project

Step 7 : Upload the zip of the file, select instance and click NEXT

Step 8 : Create and use new service role

Step 9 : Next we need to create EC2 key and EC2 instance profile using https://console.aws.amazon.com/ec2

Step 10 : Create a IAM role for EC2 instance profile

Step 11 : Under Add permission for EC2, select

  1. AWSElasticBeanstalkWebTier
  2. AWSElasticBeanstalkWorkerTier
  3. AWSElasticBeanstalkMulticontainerDocker

Step 12 : Create autoScale Group

Step 13 : Give name and create New Template

Step 14 : Select Key-value pair that you created with the free instance type

Step 15 : SKIP TO REVIEW and Create AutoScaling group

Step 16 : Head back to Elastic beanstalk website and refresh the section to select the Key Value pair and EC2 role we just created

Step 17 : Optionally you can add data servers, and other settings to your application, or maybe you can SKIP TO REVIEW and move to SUBMIT

Hurray!! you have published your first static Website and it’s live

--

--

No responses yet