IT Career Guide
Search

AWS S3 Tutorial for Beginners: Step-by-Step Guide

Person working on a laptop to manage cloud storage

This AWS S3 tutorial for beginners shows you, step by step, how to create a bucket, upload and download files, control access and use the AWS CLI with Amazon S3. Amazon S3 (Simple Storage Service) is object storage: you store files, called objects, inside containers called buckets, and you reach them over the internet through the AWS console, the CLI or code. It is one of the first services every cloud beginner should learn, because almost every AWS architecture uses it somewhere.

Key takeaways

  • S3 stores data as objects inside buckets, and each object is identified by a key, which is its full path name.
  • Bucket names must be unique across AWS, and every bucket lives in one AWS Region that you choose.
  • New buckets have Block Public Access turned on by default, so your files stay private unless you deliberately open them.
  • The AWS CLI commands aws s3 mb, cp, ls and sync cover most day-to-day S3 work.
  • Storage classes, versioning and lifecycle rules help you control cost and protect data from accidental deletion.

What is Amazon S3?

Amazon S3 is a managed storage service. You do not manage disks or servers; AWS stores your data redundantly and you pay for what you store and transfer. Common uses include:

  • Storing images, videos and documents for websites and apps
  • Backups and log archives
  • Hosting static websites built with HTML, CSS and JavaScript
  • Data lakes for analytics with tools like Athena and Glue
  • Storing Terraform state files and build artifacts in DevOps pipelines

Key S3 terms

TermMeaning
BucketA top-level container for objects, created in one Region
ObjectA file plus its metadata
KeyThe unique name of an object inside a bucket, for example reports/2026/jan.csv
PrefixThe folder-like start of a key; S3 has no real folders, only keys with slashes
Storage classA pricing and availability tier such as S3 Standard or S3 Glacier

Before you start

  1. Create an AWS account. AWS free tier terms have changed over time, so check the official AWS Free Tier page for what is included for new accounts today.
  2. Set up a billing alarm or AWS Budgets alert so you are told if spending crosses a small amount.
  3. Do not use the root user for daily work. Create an IAM user or use IAM Identity Center with the permissions you need.

If you are completely new to AWS, read our AWS for beginners guide first.

Step 1: Create a bucket in the console

  1. Sign in to the AWS Management Console and open S3.
  2. Click Create bucket.
  3. Enter a bucket name in lowercase letters, numbers, dots or hyphens, for example radium-demo-files-2026. It must be unique across AWS.
  4. Choose a Region close to your users, such as Asia Pacific (Mumbai) ap-south-1.
  5. Leave Block all public access turned on.
  6. Optionally enable Bucket Versioning.
  7. Keep default encryption on, then click Create bucket.

Step 2: Upload and download a file

  1. Open your bucket and click Upload.
  2. Add a file, for example notes.txt, and click Upload.
  3. Click the object name to see its properties, including its key, size, storage class and S3 URI.
  4. Use the Download button to get it back.

If you try to open the object URL directly in a browser, you will get an Access Denied error. That is expected, because the bucket is private.

Step 3: Use the AWS CLI with S3

Install the AWS CLI version 2 from the official documentation and run aws configure to add your access keys and default Region. Then try these commands:

# create a bucket
aws s3 mb s3://radium-demo-files-2026 --region ap-south-1

# upload a file
aws s3 cp notes.txt s3://radium-demo-files-2026/docs/notes.txt

# list buckets and objects
aws s3 ls
aws s3 ls s3://radium-demo-files-2026/docs/

# download a file
aws s3 cp s3://radium-demo-files-2026/docs/notes.txt ./notes-copy.txt

# sync a whole local folder to S3
aws s3 sync ./website s3://radium-demo-files-2026/website/

# delete an object
aws s3 rm s3://radium-demo-files-2026/docs/notes.txt

The sync command only uploads new or changed files, which makes it useful for backups and deploying static sites.

Step 4: Share a private file safely with a presigned URL

Instead of making a file public, create a presigned URL that works for a limited time:

aws s3 presign s3://radium-demo-files-2026/docs/notes.txt --expires-in 3600

Anyone with that link can download the file for one hour, and the bucket stays private.

Step 5: Access S3 from Python with boto3

import boto3

s3 = boto3.client('s3')

s3.upload_file('notes.txt', 'radium-demo-files-2026', 'docs/notes.txt')

response = s3.list_objects_v2(Bucket='radium-demo-files-2026', Prefix='docs/')
for item in response.get('Contents', []):
    print(item['Key'], item['Size'])

On an EC2 instance or Lambda function, attach an IAM role with S3 permissions instead of storing access keys in code.

Controlling access to S3

IAM policies

IAM policies attach to users, groups and roles and say which S3 actions they can perform, such as s3:GetObject or s3:PutObject, on which buckets.

Bucket policies

A bucket policy is a JSON document attached to the bucket itself. It is used, for example, to allow another AWS account or a CloudFront distribution to read objects.

Block Public Access and ACLs

Block Public Access settings act as a safety switch over everything else. For new buckets, AWS also disables object ACLs by default and recommends using policies instead.

S3 storage classes in simple words

  • S3 Standard for data you use often.
  • S3 Intelligent-Tiering moves objects between tiers automatically based on access.
  • S3 Standard-IA and One Zone-IA for data you read rarely but need quickly.
  • S3 Glacier classes for archives, with retrieval times ranging from milliseconds to hours depending on the class.

Prices differ by class and Region, so check the official S3 pricing page instead of relying on figures in blog posts.

Versioning and lifecycle rules

With versioning on, overwriting or deleting an object keeps the older version, so you can recover from mistakes. Lifecycle rules then let you move old versions to cheaper storage or delete them after a number of days. A typical beginner rule is: move logs to Glacier after 30 days and delete them after one year.

Clean up to avoid charges

aws s3 rm s3://radium-demo-files-2026 --recursive
aws s3 rb s3://radium-demo-files-2026

If versioning is on, delete all object versions from the console first, or the bucket will not be removed.

Once you are comfortable with S3, see the AWS certification path to plan your next step, and test yourself with our AWS interview questions.

Frequently asked questions

Is Amazon S3 a database?

No. S3 is object storage for files. It does not run queries like a database, although services such as Athena can query data stored in S3.

Is S3 free to use?

S3 is a paid service, but new AWS accounts may get free tier credits or limits. The offer has changed in the past, so check the official AWS Free Tier page.

Can I host a website on S3?

Yes, S3 can host static websites made of HTML, CSS, JavaScript and images. Most teams put CloudFront in front of the bucket for HTTPS and better speed.

What is the difference between S3 and EBS?

S3 is object storage reached over an API from anywhere, while EBS is block storage attached to a single EC2 instance like a hard disk.

Find more cloud guides in our cloud category.

Other articles

Radium4 — IT training blog

Practical, plain-English guides for DevOps, cloud, data, Python, testing and security learners.