How to Deploy Web Apps in S3?
Last Updated :
23 Jul, 2025
Amazon S3 is an Object storage service owned by AWS which offers high availability, security, scalability, and performance. Customers across all industries and sizes can use Amazon S3 to back up and restore, archive, create enterprise applications, connect IoT devices, and create big data analytics from any amount of data.
Using Amazon S3, you can optimize, organize, and configure access to your data to meet your business, organizational, and compliance needs.
Advantages of S3
There are plenty of advantages with S3, a few of them are:
- Highly Scalable: AWS S3 provides unlimited storage space and is highly scalable, allowing you to easily increase or decrease your storage capacity as needed.
- Durability and Availability : AWS S3 stores data in multiple locations and provides a high level of redundancy, ensuring that your data is always available, even in the event of hardware failures or other disasters.
- Cost-Effective : AWS S3 offers a pay-as-you-go pricing model, so you only pay for the storage you use. It also offers cost-effective storage tiers for infrequently accessed data.
- Easy to Use : AWS S3 is easy to use and provides a simple web interface and APIs for storing and retrieving data.
- Security : AWS S3 provides advanced security features, such as encryption, access controls, and multi-factor authentication, to help protect your data.
- Integrations : AWS S3 integrates seamlessly with other AWS services, making it easy to build complex applications and workflows.
Use Cases of S3
S3 is generally used for the below purposes:
- Store and backup data
- Host static websites
- Share data
- Stream data
- Archive data
Here in this article we gonna learn how to use S3 Bucket as Static Website .
Prerequisites
- An AWS Account to create an S3 website
- Basic knowledge about AWS S3, Route53 (optional)
Terminology
- Static Website: A Static website consists of numerous files (static), which will be rendered as it is, without any dynamic content.
- S3 Website: It is a service provided by AWS which allows hosting a static website using AWS S3.
Steps To Deploy WebApp in S3
Create S3 Bucket
- Login to your AWS console by visiting https://console.aws.amazon.com/console/home
- Open S3 Bucket Page
- Create Bucket, here bucket_name is unique across AWS.
Create S3 Bucket Upload Files
- Our new bucket is ready, now we can upload our static files to our bucket.
- Click on the Upload button and choose the directory/files to upload.
Upload Files to S3 Bucket Configure S3 Static Website
To use our S3 bucket as a static website, we need to enable the static website hosting feature.
- Click on Properties
- Navigate to Static website hosting , and click on edit
- Enable static website hosting and configure different settings available.
Edit Static Website Hosting Config
Enable Static Website Hosting Configure Index Document
- Index document: default path of the website, here generally we place index.html
Configure Error Document
- Error document: It is the page that will be displayed if there is an error, for example, if a client accessed a path that doesn't exist.
Configure Redirection Rules
- Redirection rules : We can also configure the redirection rules, the below redirection rules will redirect the abc/test.html to xyz/test.html :
Customizing static website After saving the S3 bucket website setting, you'll get the endpoint similar to below.
http://<bucket_name>.s3-website
.<region>.amazonaws.com
Update S3 Permissions
By default s3 bucket will be private, to make our website accessible to the public, we've to update S3 bucket permissions, we can update this through 2 methods,
1. By using the S3 bucket policy (to be able to access via website endpoint)
2. Bucket ACLs (to be able to access via S3 console)
Before the below steps, we need to uncheck the Block all public access option, (this should not be unchecked unless there is a requirement like this)
Uncheck "Block Public Access" Using Bucket Policy
Add the below policy statement in bucket policy statements:
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "PublicReadAccess",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<bucket-name>/*"
}]
}
This allows everyone (the public) to access the S3 objects using the S3 website endpoint.
By using ACLs
Note : Make sure ACLs are enabled for the bucket.
Enable ACLs - Open Bucket -> Properties Tab
- Under the access control list (ACL), Click on Edit
- Check Everyone (public access) -> Read
This will allow any AWS user to access the bucket objects via the console.
Allow Public Read Access through ACLs Custom Domain (optional)
We can now configure the custom domain for our S3 website, to set up a custom domain follow the below steps:
Note : You can do this only if you have a domain owned and the bucket name is the same as the custom domain you want to configure.
- Open route53.
- Open the host-zone associated with your domain.
- Specify the subdomain (same as the bucket name)
- Add the route53 A record as Alias to the S3 website endpoint
- Choose the region the same as the bucket region (or check the S3 website endpoint).
- Then if you've enabled static website hosting, you'll get a suggestion under S3 Endpoint as s3-website.ap-south-1.amazonaws.com (your bucket name), and value s3-website.ap-south-1.amazonaws.com will be set if you choose that option.
Add Route53 Record for S3 Website Endpoint Note: The record name should match the bucket name if your domain name is example.com if your bucket name is test.example.com , your subdomain should be test , if your bucket name is example.com , leave the subdomain empty.
Similar Reads
DevOps Tutorial DevOps is a combination of two words: "Development" and "Operations." Itâs a modern approach where software developers and software operations teams work together throughout the entire software life cycle.The goals of DevOps are:Faster and continuous software releases.Reduces manual errors through a
7 min read
Introduction
What is DevOps ?DevOps is a modern way of working in software development in which the development team (who writes the code and builds the software) and the operations team (which sets up, runs, and manages the software) work together as a single team.Before DevOps, the development and operations teams worked sepa
10 min read
DevOps LifecycleThe DevOps lifecycle is a structured approach that integrates development (Dev) and operations (Ops) teams to streamline software delivery. It focuses on collaboration, automation, and continuous feedback across key phases planning, coding, building, testing, releasing, deploying, operating, and mon
10 min read
The Evolution of DevOps - 3 Major Trends for FutureDevOps is a software engineering culture and practice that aims to unify software development and operations. It is an approach to software development that emphasizes collaboration, communication, and integration between software developers and IT operations. DevOps has come a long way since its in
7 min read
Version Control
Continuous Integration (CI) & Continuous Deployment (CD)
Containerization
Orchestration
Infrastructure as Code (IaC)
Monitoring and Logging
Microsoft Teams vs Slack Both Microsoft Teams and Slack are the communication channels used by organizations to communicate with their employees. Microsoft Teams was developed in 2017 whereas Slack was created in 2013. Microsoft Teams is mainly used in large organizations and is integrated with Office 365 enhancing the feat
4 min read
Security in DevOps