AWS Builder Center
Scaling Web3 Infrastructure: Containerized Workloads on AWS

Scaling Web3 Infrastructure: Containerized Workloads on AWS

As Web3 applications grow in popularity, the need for scalable, reliable, and cost-effective infrastructure becomes critical. This guide explores how to leverage containerization and AWS EC2 to deploy, manage, and scale your Web3 workloads efficiently.

Founder & Director @ OmniAi Global Solutions | AWS UG Kolkata Leader, AWS Community Builder
Imagine a place where anything you create, earn, and buy truly belongs to you. That's what Web3 is all about!
I have been exploring the world of web3 for more than a decade. Now I think it's a good time to write something awesome on it. In this article I will show you how to combine web2 and web3 together using AWS Cloud to build an app or game that can be accessed by both users of web2 and web3 and by using any modern browser.
Also, I'm hosting a special 2-hour hands-on meetup as the organizer of AWS User Group Kolkata, in collaboration with Slack Community Kolkata and Crafty Edge, to teach Web3 deployment and containerization on AWS to 50–100 attendees. The session will walk participants step-by-step through containerizing, and deploying their first decentralized app (dApp) on AWS with live demos so everyone can follow along and complete a working deploy by the end. I'll cover essential cloud services, container tools, deployment patterns, and best practices for scaling and security, with time for questions and troubleshooting.

PREREQUISITES

  • Windows 10/11, Linux or MacOS
  • An AWS account
  • Node.js
  • GitHub Account

Step 1: Set Up AWS EC2 Instance

Create an AWS Account
Go to AWS Console and sign up if you don’t have an account.
https://signin.aws.amazon.com/signup?request_type=register
Click on services menu
Select Compute > EC2
Click “Launch Instance”
Name your instance: web360
Choose an AMI: Select Ubuntu Server 22.04 LTS.
Note: The default AMI is Amazon Linux (both images eligible for free tier)
Choose an Instance Type: t3.small (eligible for free tier).
Key Pair: Create a new key pair (e.g., webserver.pem) and download the .pem file.
Network Settings: Allow SSH (port 22), HTTP (port 80), and HTTPS (port 443) traffic.
Note: Default only ssh option is selected. Make sure to check http and https options.
Storage: Default 8GB is fine for a small project.

Summary of the instance

Click “Launch Instance”

Console-to-Code EC2 / Launch Instances

CreateSecurityGroup
1
aws ec2 create-security-group --group-name 'launch-wizard-2' --description 'launch-wizard-2 created 2025-10-22T08:57:00.387Z' --vpc-id 'vpc-04c2f3e54242a78bc'
AuthorizeSecurityGroupIngress
1
aws ec2 authorize-security-group-ingress --group-id 'sg-preview-1' --ip-permissions '{"IpProtocol":"tcp","FromPort":22,"ToPort":22,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}' '{"IpProtocol":"tcp","FromPort":443,"ToPort":443,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}' '{"IpProtocol":"tcp","FromPort":80,"ToPort":80,"IpRanges":[{"CidrIp":"0.0.0.0/0"}]}'
RunInstances
1
aws ec2 run-instances --image-id 'ami-0360c520857e3138f' --instance-type 't3.small' --key-name 'webserver' --block-device-mappings '{"DeviceName":"/dev/sda1","Ebs":{"Encrypted":false,"DeleteOnTermination":true,"Iops":3000,"SnapshotId":"snap-05ebf17f9a0bc77de","VolumeSize":8,"VolumeType":"gp3","Throughput":125}}' --network-interfaces '{"AssociatePublicIpAddress":true,"DeviceIndex":0,"Groups":["sg-preview-1"]}' --credit-specification '{"CpuCredits":"unlimited"}' --tag-specifications '{"ResourceType":"instance","Tags":[{"Key":"Name","Value":"web360"}]}' --metadata-options '{"HttpEndpoint":"enabled","HttpPutResponseHopLimit":2,"HttpTokens":"required"}' --private-dns-name-options '{"HostnameType":"ip-name","EnableResourceNameDnsARecord":true,"EnableResourceNameDnsAAAARecord":false}' --count '1'

Step 2: Connect to Your EC2 Instance

SSH into the Instance
  • Open a terminal and navigate to the folder with your .pem file.

Step 3: Set Up the Server Environment

Update Packages
sudo apt update && sudo apt upgrade -y
Install Docker
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
Add your user to the docker group
sudo usermod -aG docker $USER
newgrp docker
Verify Docker is running
docker --version
sudo systemctl status docker
Pull, run and console into the Debian instance
docker run -it debian -p 3000:3000 /bin/bash
Update Debian
apt update
Install curl
apt install curl -y
Install nodejs and npm
apt install nodejs
apt install npm

Step 4: Set Up Your Web3 App

Create a new web3 app
Open your terminal and run:
npx create-react-app web3-app
cd web3-app
Install required dependencies
npm install web3 @walletconnect/web3-provider ethers
  • web3: For interacting with the Ethereum blockchain.
  • @walletconnect/web3-provider: For WalletConnect support.
  • ethers: Alternative to web3.js, widely used for wallet connections.
Create the Main App Component
Note: I'm not providing any code snippet, because the project I'm working on was not yet completed. Once completed I'll share with everyone but until then you can get repos from GitHub
Run Your App
npm start
Your app will open at http://localhost:3000  or <aws ipv4>:3000
Modify Security Groups
  • Click Network & Security > Security Groups
  • Select the security group that was attached with the instance "launch-wizard-2"
  • Click on "Actions" button and select "Edit inbound rule"
  • Click on "Add Rule" button
  • The new rule as follows:
    • Type: Custom TCP
    • Protocol: TCP
    • Port range: 3000
    • Source: Anywhere-IPv4
  • Click "Save rules" button
That's it! You have successfully deployed your first web3 app.

App Preview

Remember the key steps: design your app, containerize with Docker, choose the right AWS service for deployment, secure credentials, and monitor for reliability. Keep experimenting—try different container orchestration options, add CI/CD, and explore AWS services that fit your app’s needs.
Happy building — deploy often, learn fast, and share what you create.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article