<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: olatunji olamide</title>
    <description>The latest articles on DEV Community by olatunji olamide (@olamide2758).</description>
    <link>https://dev.to/olamide2758</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3386232%2F63e4ded7-b3f5-48b5-98bb-4c5db58bddba.png</url>
      <title>DEV Community: olatunji olamide</title>
      <link>https://dev.to/olamide2758</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/olamide2758"/>
    <language>en</language>
    <item>
      <title>“Step-by-Step Guide: Attaching and Mounting an EBS Volume on Ubuntu EC2”</title>
      <dc:creator>olatunji olamide</dc:creator>
      <pubDate>Tue, 26 Aug 2025 23:27:52 +0000</pubDate>
      <link>https://dev.to/olamide2758/step-by-step-guide-attaching-and-mounting-an-ebs-volume-on-ubuntu-ec2-1cc6</link>
      <guid>https://dev.to/olamide2758/step-by-step-guide-attaching-and-mounting-an-ebs-volume-on-ubuntu-ec2-1cc6</guid>
      <description>&lt;p&gt;Cloud computing has changed how we manage storage and servers, making it easier to scale resources without worrying about physical hardware. One of the key components of Amazon Web Services (AWS) is Elastic Block Store (EBS), which provides reliable and persistent block storage for EC2 instances.&lt;/p&gt;

&lt;p&gt;Think of EBS as an external hard drive for your cloud server—you can attach it, format it, mount it, and start using it to store data, databases, logs, or application files. Unlike the temporary root storage that comes with an EC2 instance, an EBS volume remains intact even if the instance is stopped or restarted.&lt;/p&gt;

&lt;p&gt;In this guide, I’ll walk you through exactly how I attached and mounted an EBS volume to my Ubuntu EC2 instance, sharing the steps, commands, and best practices I used. By the end, you’ll have a clear roadmap to setting up persistent storage on AWS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Prerequisites&lt;/strong&gt;&lt;br&gt;
Before diving in, list what’s needed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An AWS account&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F854pj6btlqt7plobd7rr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F854pj6btlqt7plobd7rr.png" alt=" " width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An active EC2 instance running Ubuntu&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fli45zhxnz2oq6xjkook1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fli45zhxnz2oq6xjkook1.png" alt=" " width="800" height="63"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of the AWS Management Console or CLI&lt;/li&gt;
&lt;li&gt;SSH access to your EC2 inv2. Step 1: Create an EBS Volume&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Step 1: Create an EBS Volume&lt;/strong&gt;&lt;br&gt;
Explain how to create a new EBS volume from the AWS console:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to EC2 Dashboard
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvdi9pqahp6f28n46v0i.png" alt=" " width="800" height="263"&gt;
→ Elastic Block Store → Volumes
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0e33jnt1wimilg5ds5p0.png" alt=" " width="350" height="505"&gt;
&lt;/li&gt;
&lt;li&gt;Click Create Volume
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7aqcmk41x1wot7hah8qo.png" alt=" " width="800" height="34"&gt;
-&lt;strong&gt;Sieze&lt;/strong&gt;:5gb, &lt;strong&gt;availability zone&lt;/strong&gt;:must match your EC2 zone 
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtrn6xqp6osjd8seauhh.png" alt=" " width="800" height="322"&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F353acprf7wyd3cxvip57.png" alt=" " width="800" height="319"&gt;
&lt;/li&gt;
&lt;li&gt;Click Create
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F733hujyl2bss0vcrzn9b.png" alt=" " width="800" height="258"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.Step 2: Attach the Volume to Your EC2 Instance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the volume you just created
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdhzj55j2l6c35amw5ebn.png" alt=" " width="800" height="135"&gt;
&lt;/li&gt;
&lt;li&gt;Click Actions
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg8jkmop8560lagvvoi05.png" alt=" " width="800" height="118"&gt;
→ Attach Volume
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc37hthphotfzizr4tdlv.png" alt=" " width="734" height="553"&gt;
&lt;/li&gt;
&lt;li&gt;Choose your EC2 instance from the list&lt;/li&gt;
&lt;li&gt;Note the device name (e.g., /dev/xvdf)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tb9lr2madow2g6eztfd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tb9lr2madow2g6eztfd.png" alt=" " width="800" height="311"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;From here, the next steps would be:&lt;/strong&gt;&lt;br&gt;
Step 1: Log in to Your EC2 Instance&lt;/p&gt;

&lt;p&gt;First, connect to your EC2 instance using SSH from your local computer:&lt;br&gt;
ssh -i your-key.pem ubuntu@your-ec2-public-ip&lt;br&gt;
your-key.pem = your private key file&lt;br&gt;
your-ec2-public-ip = the public IP of your EC2 server&lt;/p&gt;

&lt;p&gt;👉 This puts you inside your Ubuntu server, where you’ll run the next commands.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp9vhl07oxk6xb5dlh6r1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp9vhl07oxk6xb5dlh6r1.png" alt=" " width="800" height="622"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Step 2: Confirm the New EBS Volume is Attached&lt;/strong&gt;&lt;br&gt;
After creating and attaching the volume in the AWS console, check if the system sees it:&lt;br&gt;
lsblk&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ydlnl9wk5xel4l6s1we.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ydlnl9wk5xel4l6s1we.png" alt=" " width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;p&gt;xvda1 = root volume (where Ubuntu is installed)&lt;/p&gt;

&lt;p&gt;xvdbb = the new EBS volume you just attached (unformatted, empty)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Format the New Volume&lt;/strong&gt;&lt;br&gt;
sudo mkfs -t ext4 /dev/nvme1n1&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8idplk0s73wjqzt1c41.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb8idplk0s73wjqzt1c41.png" alt=" " width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Create a Mount Point&lt;/strong&gt;&lt;br&gt;
sudo mkdir /data&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu72floz77j3vmzemu9cs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu72floz77j3vmzemu9cs.png" alt=" " width="650" height="65"&gt;&lt;/a&gt;&lt;br&gt;
*&lt;em&gt;Step 5: mount it *&lt;/em&gt;&lt;br&gt;
sudo mount /dev/nvme1n1/data&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpeijgiovi13nrrmbso9t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpeijgiovi13nrrmbso9t.png" alt=" " width="681" height="58"&gt;&lt;/a&gt;&lt;br&gt;
**&lt;br&gt;
Create a new file,like writting something into it**&lt;br&gt;
bash&lt;br&gt;
echo "Hello from EBS!" | sudo tee /data/hello.txt&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctshkj5hgfaom3940b4m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctshkj5hgfaom3940b4m.png" alt=" " width="800" height="70"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Verify the file was created *&lt;/em&gt;&lt;br&gt;
bash&lt;br&gt;
cat /data/hello.txt&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl22d0gxgo7g13kx40p6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl22d0gxgo7g13kx40p6b.png" alt=" " width="581" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop and Start the EC2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go back to EC2 console→stop the instance&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp7hrl9ob3bfo1k2bnrvv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp7hrl9ob3bfo1k2bnrvv.png" alt=" " width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wait→start it again&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frizpa14fbz4gcv9k9iem.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frizpa14fbz4gcv9k9iem.png" alt=" " width="800" height="362"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;SSH back in&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwc984rbihgn9p1afi7p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffwc984rbihgn9p1afi7p.png" alt=" " width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;check your data:&lt;/strong&gt;&lt;br&gt;
bash&lt;br&gt;
copy Edit&lt;br&gt;
sudo mount /dev/nvme1n1 /data&lt;br&gt;
cat /data/hello.txt&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvkwo3p5fdbcvi0gbogn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxvkwo3p5fdbcvi0gbogn.png" alt=" " width="678" height="88"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Data is still there.because EBS is persistent&lt;br&gt;
to know the number of gb used&lt;br&gt;
df -h&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9wplwa1010s9yomalsw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9wplwa1010s9yomalsw.png" alt=" " width="750" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 Conclusion&lt;/p&gt;

&lt;p&gt;In this guide, we walked through the full process of adding and configuring an EBS volume on an Ubuntu EC2 instance. You learned how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create and attach a new EBS volume from the AWS Management Console&lt;/li&gt;
&lt;li&gt;Verify that the volume is visible inside your EC2 instance&lt;/li&gt;
&lt;li&gt;Format and mount it to a directory for use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these steps, you’ve expanded your instance’s storage and ensured that it’s properly configured for long-term use.&lt;/p&gt;

&lt;p&gt;💡 Pro Tip: Regularly back up your data with EBS snapshots, and remember that volumes can be resized or moved across instances if your needs grow.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ubuntu</category>
      <category>cloud</category>
      <category>ebs</category>
    </item>
    <item>
      <title>Beginner’s Journey: Hosting My First Website on AWS EC2</title>
      <dc:creator>olatunji olamide</dc:creator>
      <pubDate>Tue, 12 Aug 2025 21:46:38 +0000</pubDate>
      <link>https://dev.to/olamide2758/beginners-journey-hosting-my-first-website-on-aws-ec2-leo</link>
      <guid>https://dev.to/olamide2758/beginners-journey-hosting-my-first-website-on-aws-ec2-leo</guid>
      <description>&lt;p&gt;&lt;strong&gt;My First EC2 Project&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Hosting a Website on AWS as a Beginner Cloud computing has always fascinated me, but I never took the leap—until now.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Recently, I decided to dive into Amazon Web Services (AWS) and try hosting my first live website using EC2 (Elastic Compute Cloud). In this post, I’ll share how I did it, what I learned, and tips for anyone starting their AWS journey.&lt;/p&gt;

&lt;p&gt;Amazon Web Services (AWS) is one of the most popular cloud platforms in the world. It offers reliable, scalable, and inexpensive computing services — and with AWS EC2, you can host your own website like a pro.&lt;/p&gt;

&lt;p&gt;In this article, I’ll Walk you step-by-step through hosting a website on AWS, from setting up your account to accessing your site live on the internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What You’ll Learn&lt;/strong&gt;&lt;br&gt;
By the end of this tutorial, you’ll know how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create and configure an AWS EC2 instance&lt;/li&gt;
&lt;li&gt;Install a web server (Apache or Nginx)&lt;/li&gt;
&lt;li&gt;Upload and serve your website files&lt;/li&gt;
&lt;li&gt;Secure and manage your instance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;** Steps I Followed**&lt;br&gt;
1️⃣ Creating an AWS Account&lt;br&gt;
I started by signing up for an AWS Free Tier account. This gave me enough credits to run my instance without worrying about costs.&lt;br&gt;
&lt;a href="https://aws.amazon.com/console" rel="noopener noreferrer"&gt;https://aws.amazon.com/console&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuu1fnw8jhhslrxpb7td.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxuu1fnw8jhhslrxpb7td.png" alt=" " width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to AWS Free Tier and click Create a Free Account.&lt;/li&gt;
&lt;li&gt;Follow the signup process (you’ll need a valid email and payment method).&lt;/li&gt;
&lt;li&gt;Once done, log into the AWS Management Console. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step – Launching a Linux EC2 Instance&lt;/strong&gt;&lt;br&gt;
1.Log in to your AWS Management Console.&lt;br&gt;
2.In the search bar at the top, type EC2.&lt;br&gt;
3.Click on EC2 to go to the EC2 dashboard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsgalpv62jpwudypu5gg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsgalpv62jpwudypu5gg.png" alt=" " width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Launch a New EC2 Instance&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Click on the Launch Instance button.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtzw9627od4049nxq4bl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtzw9627od4049nxq4bl.png" alt=" " width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Name your instance: You can name it something like student-webserver.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcr97t6yiokvt647c6p1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcr97t6yiokvt647c6p1w.png" alt=" " width="800" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Choose an AMI (Amazon Machine Image):
a.  Select Amazon Linux 2023 or Amazon Linux 2. These are free and beginner-friendly.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj1kd2xaqmglhgv4qaljs.png" alt=" " width="800" height="508"&gt;
&lt;/li&gt;
&lt;li&gt; Choose an Instance Type:
a.  Select t2.micro. This is eligible for the AWS free tier.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9c1n20bqvs06nnc5qi91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9c1n20bqvs06nnc5qi91.png" alt=" " width="800" height="254"&gt;&lt;/a&gt;&lt;br&gt;
5.Proceed to the next step&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Create a Key Pair (Very Important)&lt;/strong&gt;&lt;br&gt;
This key pair will help you securely connect to your EC2 instance.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsajnjinbrg1stpjdsk0l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsajnjinbrg1stpjdsk0l.png" alt=" " width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Under Key pair (login), click Create new key pair.&lt;/li&gt;
&lt;li&gt; Key pair name: Type my-ec2-key&lt;/li&gt;
&lt;li&gt; Key pair type: RSA&lt;/li&gt;
&lt;li&gt; Private key file format: Select .pem&lt;/li&gt;
&lt;li&gt; Click Create key pair&lt;/li&gt;
&lt;li&gt; Your browser will automatically download a file named my-ec2-key.pem. Save it in your Downloads folder.
Important: Never lose this file. You cannot connect to your instance without it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Configure Security Group (Firewall Settings)&lt;/strong&gt;&lt;br&gt;
A security group acts like a firewall that controls who can access your instance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Create a new security group.&lt;/li&gt;
&lt;li&gt; Add these inbound rules:
Type    Port    Source  Purpose
SSH 22  0.0.0.0/0   To connect to your server
HTTP    80  0.0.0.0/0   To view your website in browser
Step 5: Configure Storage
• Leave the default 8 GB SSD storage.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzpuo5kxsdv1zpubpkzy.png" alt=" " width="800" height="322"&gt;
• This is enough for our basic project.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Launch the Instance&lt;/strong&gt;&lt;br&gt;
• Click Launch Instance&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0awx1e7di1avs2h6mkgt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0awx1e7di1avs2h6mkgt.png" alt=" " width="593" height="193"&gt;&lt;/a&gt;&lt;br&gt;
• Wait for the instance to enter the Running state (this takes a few seconds)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 3: Connect to EC2 Using SSH via Git Bash&lt;/strong&gt;&lt;br&gt;
To manage your server, you’ll need to log in to it from your computer using SSH.&lt;br&gt;
What You Need:&lt;br&gt;
• The .pem key file you downloaded earlier&lt;br&gt;
• Your EC2 Public IPv4 address&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa7a0m5prdfge5v9kp605.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa7a0m5prdfge5v9kp605.png" alt=" " width="800" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;o   Go to EC2 &amp;gt; Instances&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fanev3o06qpohbrw8t3wh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fanev3o06qpohbrw8t3wh.png" alt=" " width="337" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;o   Look under the Public IPv4 address column&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4lwqzquvo85ywavsfvzk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4lwqzquvo85ywavsfvzk.png" alt=" " width="800" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Install Git Bash (if you don’t already have it):
&lt;a href="https://git-scm.com/downloads" rel="noopener noreferrer"&gt;https://git-scm.com/downloads&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open Git Bash on your computer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to your Downloads folder (where your .pem file is located):&lt;br&gt;
bash&lt;br&gt;
CopyEdit&lt;br&gt;
cd Downloads&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdxpi4gfszie9zgf1ckc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdxpi4gfszie9zgf1ckc.png" alt=" " width="800" height="780"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Make the key file secure (this is required):&lt;br&gt;
bash&lt;br&gt;
CopyEdit&lt;br&gt;
chmod 400 ~/Downloads/my-ec2-key.pem&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect to your EC2 instance using SSH:&lt;br&gt;
bash&lt;br&gt;
CopyEdit&lt;br&gt;
ssh -i ~/Downloads/my-ec2-keypair.pem ec2-user@&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Replace  with your actual IP address (example: 18.120.23.45).&lt;br&gt;
If prompted with a yes/no question, type yes and press Enter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffgggbm4fcv2052uqusd6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffgggbm4fcv2052uqusd6.png" alt=" " width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdq0v44az5wrk76gnuww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdq0v44az5wrk76gnuww.png" alt=" " width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Part 4: Install Apache Web Server on EC2&lt;/strong&gt;&lt;br&gt;
Now that you're inside your Linux EC2 instance, follow these steps to install and start the Apache web server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Update all packages:
bash
CopyEdit
sudo yum update -y&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0fuwq8xs061ccbfsx5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0fuwq8xs061ccbfsx5i.png" alt=" " width="800" height="694"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Install Apache:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;sudo yum install -y httpd&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eq6u67dgvyju2vhbozr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eq6u67dgvyju2vhbozr.png" alt=" " width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Start Apache:
sudo systemctl start httpd&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09kpkyfzwho84c8cso71.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F09kpkyfzwho84c8cso71.png" alt=" " width="730" height="89"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Enable Apache to start automatically on reboot:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;sudo systemctl enable httpd&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76hi6y3mlh8dq97szq0q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76hi6y3mlh8dq97szq0q.png" alt=" " width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; View Your Server in a Browser:
• Open your browser
• Visit: http://
• You should see the Apache test page&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bcos2gn1wa6eloglobf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bcos2gn1wa6eloglobf.png" alt=" " width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Part 5: Create Your Own Web Page&lt;br&gt;
Let’s change the default Apache test page to your own custom message.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a simple HTML page:&lt;br&gt;
bash&lt;br&gt;
CopyEdit&lt;br&gt;
echo "&lt;/p&gt;
&lt;h1&gt;Hello from EC2!&lt;/h1&gt;" | sudo tee /var/www/html/index.html&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check your browser:&lt;br&gt;
• Refresh http://&lt;br&gt;
• You should now see "Hello from EC2!" displayed&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmiyb2nzc561xeua5znqz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmiyb2nzc561xeua5znqz.png" alt=" " width="800" height="503"&gt;&lt;/a&gt;&lt;br&gt;
Hosting a website on AWS EC2 can seem intimidating at first, but once you go through it step-by-step, it’s a powerful skill to have.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>webhosting</category>
      <category>cloudcomputing</category>
    </item>
  </channel>
</rss>
