<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[My AWS Adventures]]></title><description><![CDATA[Adventures in AWS from a developer's perspective. Breaking down complex cloud concepts, sharing practical tutorials, and learning in public.]]></description><link>https://aws-adventures.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 23:00:45 GMT</lastBuildDate><atom:link href="https://aws-adventures.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Stop Paying for EC2: Create AWS-Like Instances Locally with Multipass]]></title><description><![CDATA[It's very unpredictable how quickly cloud charges spike in AWS Cloud, especially when you're using it for developmental purpose or when you want to spin up virtual instances that can be disposed after your work is completed. However, one needs to be ...]]></description><link>https://aws-adventures.hashnode.dev/stop-paying-for-ec2-create-aws-like-instances-locally-with-multipass</link><guid isPermaLink="true">https://aws-adventures.hashnode.dev/stop-paying-for-ec2-create-aws-like-instances-locally-with-multipass</guid><category><![CDATA[Devops]]></category><category><![CDATA[AWS]]></category><category><![CDATA[Docker]]></category><category><![CDATA[Kubernetes]]></category><category><![CDATA[minikube]]></category><category><![CDATA[#Multipass]]></category><category><![CDATA[#prometheus]]></category><category><![CDATA[Linux]]></category><dc:creator><![CDATA[Sneha Madhuri]]></dc:creator><pubDate>Thu, 04 Sep 2025 12:09:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1756983740583/3b7f8806-07eb-4858-9199-855e3937ee4f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It's very unpredictable how quickly cloud charges spike in AWS Cloud, especially when you're using it for developmental purpose or when you want to spin up virtual instances that can be disposed after your work is completed. However, one needs to be aware of the <em>time</em> and <em>cost</em> that comes with it. And for students, both of them are equally important.</p>
<p>Don't get me wrong - AWS EC2 has its benefits, and if you're just starting out, definitely learn it. But cleaning up after yourself is a pain. You've got to remember to terminate instances, delete security groups, remove key pairs, and make sure you're not getting charged for forgotten EBS volumes. Not to forget, everything that comes with VPC as well.</p>
<p>☁️ If you need quick, disposable instances for testing and development, you're in the right place.</p>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756985422781/28cb2e46-12ec-4b24-b68b-bba338737c6e.png" alt class="image--center mx-auto" /></p>
<p>For those new to AWS, EC2 (Elastic Compute Cloud) lets you rent virtual servers in Amazon's data centres. You pick your server specs, operating system, and pay by the hour. It's incredibly powerful. You can scale up or down, access your instances from anywhere, and tap into Amazon's massive infrastructure. But all that convenience comes with a price tag.</p>
<p>What if instead of renting compute power, you used your own? And your <mark>own server is your laptop</mark>! That MacBook Pro or gaming laptop you're using? It's probably got more RAM and processing power than most basic EC2 instances. The difference is location: AWS runs in their data centre, but your machine runs locally, for free.</p>
<p>Before we dive into Multipass, let's talk specs. If you've got at least 8GB RAM and decent storage, you can run multiple virtual instances that would cost you $50-100+ monthly on AWS.</p>
<p><strong>Multipass</strong> is nothing but a lightweight tool that lets you launch and manage Ubuntu instances locally, mimicking the EC2 experience without the cost. It is a powerful tool for developers who want the flexibility of cloud instances without the ongoing costs. Next time you need a quick Ubuntu VM, skip the EC2 dashboard and try Multipass on your own machine!</p>
<p>🚀 <strong>To summarise :</strong></p>
<ul>
<li><p>Cost Savings: No more hourly EC2 bills for dev and test environments.</p>
</li>
<li><p>Speed: Instantly launch and destroy VMs on your laptop or desktop.</p>
</li>
<li><p>Simplicity: Multipass uses simple commands, similar to AWS CLI.</p>
</li>
<li><p>Isolation: Each instance is a clean Ubuntu VM, just like a fresh EC2 instance.</p>
</li>
</ul>
<p>In this article, we'll use a <strong>Linux</strong> operating system for easy installation steps. You can however do this on Windows and MacOS as well, though the commands will differ slightly. This guide is intended for DevOps engineers, students, and developers who want to experiment with containers, Kubernetes, and monitoring tools without the cost and complexity of cloud infrastructure. Our goal is to deploy Prometheus, the most popular monitoring tool, and access it via the VM that Multipass provides. Let’s get started!</p>
<hr />
<h3 id="heading-step-1-check-your-available-memory">Step 1 → Check Your Available Memory 💻</h3>
<p>Before we start spinning up virtual instances, let's see what we're working with. You'll want at least 4-8GB of free RAM to comfortably run virtual machines.</p>
<p><strong>Command used :</strong></p>
<pre><code class="lang-bash">free -h
<span class="hljs-comment">#or</span>
df -h
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756883212382/425c00fa-d50b-4843-b94b-b07e3f1171e4.png" alt class="image--center mx-auto" /></p>
<p>Used (active programs) 2.4GB <strong>+</strong> Available (free + reclaimable cache) 4.4GB <strong>\=</strong> 6.8GB (Enough to run our VM’s)</p>
<hr />
<h3 id="heading-step-2-system-update">Step 2 → System Update</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash">sudo apt update &amp;&amp; sudo apt-get upgrade
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756886972416/c20f4dae-381e-4175-a4f9-c824719b8b9b.png" alt class="image--center mx-auto" /></p>
<p>We are ensuring the system is current and package lists are fresh, which helps avoid potential conflicts or outdated package information when installing Multipass.</p>
<hr />
<h3 id="heading-step-3-install-multipass">Step 3 → Install Multipass</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash">sudo snap install multipass
multipass version
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756887972800/ab957565-753d-40e9-8756-33557cce343e.png" alt class="image--center mx-auto" /></p>
<p>This is where we install the multipass and check its version.</p>
<hr />
<h3 id="heading-step-4-launch-your-first-virtual-machine">Step 4 → Launch Your First Virtual Machine</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-comment"># specified resources</span>
multipass launch --name first-vm --cpus 2 --mem 3G --disk 20G
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756888827417/704cffa8-01ed-473d-8961-2c0aedbdd827.png" alt class="image--center mx-auto" /></p>
<p>By specifying resources, you get full control over how much CPU, RAM, and storage your VM uses. If you don’t prefer it, use the default instead : <strong>multipass launch --name first-vm</strong></p>
<hr />
<h3 id="heading-step-5-view-instance-information">Step 5 → View Instance Information</h3>
<p><strong>Command used :</strong></p>
<pre><code class="lang-bash">multipass info first-vm
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756889669075/b6388d76-267b-459a-885d-744c5a3e73d2.png" alt class="image--center mx-auto" /></p>
<p>Let's double-check that your VM was created with the resources you requested :</p>
<ul>
<li><p><strong>CPU(s): 2</strong> ✅ (matches our <code>--cpus 2</code> request)</p>
</li>
<li><p><strong>Memory usage: 350.5MiB out of 2.9GiB</strong> ✅ (shows ~3GB total as requested with <code>--mem 3G</code>)</p>
</li>
<li><p><strong>Disk usage: 1.9GiB out of 19.3GiB</strong> ✅ (shows ~20GB total as requested with <code>--disk 20G</code>)</p>
</li>
</ul>
<p>Your VM is running exactly as specified → 2 CPUs, 3GB RAM, and 20GB disk space.</p>
<hr />
<h3 id="heading-step-6-list-all-your-virtual-machines">Step 6 → List All Your Virtual Machines</h3>
<p><strong>Command used :</strong></p>
<pre><code class="lang-bash">multipass list
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756890041867/92883c0a-382c-4b83-afb5-1f47804b41d3.png" alt class="image--center mx-auto" /></p>
<p><strong>NOTE :</strong> It is important to remember your VM’s IP. In my case, it is <code>10.246.162.180</code></p>
<p>This command shows you every VM you've created, their current status, and IP addresses. Think of it as your local server dashboard!</p>
<hr />
<h3 id="heading-step-7-connect-to-your-virtual-machine">Step 7 → Connect to Your Virtual Machine 🖥️</h3>
<p><strong>Command used :</strong></p>
<pre><code class="lang-bash">multipass shell first-vm
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756890294520/5b249fd4-b151-49ef-a6d4-9921f8b53f3a.png" alt class="image--center mx-auto" /></p>
<p>See how seamless Multipass is compared to EC2 instances? Multipass dropped you directly into your Ubuntu instance with just <code>multipass shell first-vm</code>. No SSH keys to generate, no .pem files to download and manage, no complicated connection strings like <code>ssh -i &lt;key_pair&gt;.pem ubuntu@&lt;ec2_public_ ip_address&gt;</code> and no security group configurations to worry about. Just instant access to your virtual server!</p>
<hr />
<h3 id="heading-step-8-test-your-vm">Step 8 → Test Your VM</h3>
<p><strong>Command used :</strong></p>
<pre><code class="lang-bash">cat /etc/os-release
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756892723793/d934e595-57d7-4fce-91c4-aced890e9e52.png" alt class="image--center mx-auto" /></p>
<p><em>Experiment freely. This environment is completely separate from your host machine. Here are some basic Linux commands you can try further :</em></p>
<pre><code class="lang-bash">whoami
hostname  
uname -a
df -h
free -h
</code></pre>
<hr />
<h3 id="heading-step-9-update-your-virtual-machine">Step 9 → Update Your Virtual Machine</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash">sudo apt update &amp;&amp; sudo apt upgrade
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756895923929/e25ea7fd-924f-4d36-87d5-c79195981d42.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-10-install-docker">Step 10 → Install Docker <strong>🐳</strong></h3>
<p>Docker is required and is a prerequisite to run your minikube cluster.</p>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-comment"># docker commands</span>
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
<span class="hljs-built_in">echo</span> \
  <span class="hljs-string">"deb [arch=<span class="hljs-subst">$(dpkg --print-architecture)</span> signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  <span class="hljs-subst">$(. /etc/os-release &amp;&amp; echo <span class="hljs-string">"<span class="hljs-variable">$UBUNTU_CODENAME</span>"</span>)</span> stable"</span> | \
  sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null
sudo apt-get -y update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
sudo usermod -aG docker ubuntu
newgrp docker

<span class="hljs-comment"># check if docker is running</span>
sudo systemctl status docker
docker --version
docker ps

<span class="hljs-comment"># if it is not running</span>
sudo systemctl start docker
sudo systemctl <span class="hljs-built_in">enable</span> docker
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756913202126/ba8061ec-f8cd-425e-ae22-9ccec2b26f60.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-11-install-kubernetes-cli-kubectl">Step 11 → Install Kubernetes CLI (kubectl)</h3>
<p>Kubectl is the command-line tool you'll use to interact with your Kubernetes cluster. Think of it as your remote control for managing pods, services, and deployments.</p>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash">curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.33.3/2025-08-03/bin/linux/amd64/kubectl
curl -O https://s3.us-west-2.amazonaws.com/amazon-eks/1.33.3/2025-08-03/bin/linux/amd64/kubectl.sha256
sha256sum -c kubectl.sha256
chmod +x ./kubectl
mkdir -p <span class="hljs-variable">$HOME</span>/bin &amp;&amp; cp ./kubectl <span class="hljs-variable">$HOME</span>/bin/kubectl &amp;&amp; <span class="hljs-built_in">export</span> PATH=<span class="hljs-variable">$HOME</span>/bin:<span class="hljs-variable">$PATH</span>
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756914575660/881a7ed4-57db-464f-804a-646a5b837042.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-12-install-and-start-minikube">Step 12 → Install and Start Minikube</h3>
<p>The official docs have an interactive installer guide that lets you pick your exact setup. Here's what we'll use for this tutorial, but feel free to customise.</p>
<p>Access the minikube <a target="_blank" href="https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download">documentation</a>.</p>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-comment"># Installer type: Debian package</span>
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb

minikube start
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756914949355/f9b32db0-239a-4fa5-bb05-67c350991dd4.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-13-install-helm-package-manager">Step 13 → Install Helm Package Manager</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-comment"># Install helm</span>
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

<span class="hljs-comment"># Verify installation</span>
helm version
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756915680258/7c85d13c-dc42-455b-a46a-9dd5bc558ff5.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756915726062/13b93edf-9549-4bc4-9728-00c96d056e52.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-14-deploy-prometheus-with-helm">Step 14 → Deploy Prometheus with Helm</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-comment"># add Prometheus Helm repository</span>
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update

<span class="hljs-comment"># install Prometheus</span>
helm install prometheus prometheus-community/prometheus

<span class="hljs-comment"># check if pods are running</span>
kubectl get pods
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756915831897/a3b0d9fa-f197-41e5-b6fa-6e92a01ca15e.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756915875169/40cc25f4-ee04-45d7-befd-ae122c028fea.png" alt class="image--center mx-auto" /></p>
<hr />
<h3 id="heading-step-15-access-prometheus-dashboard">Step 15 → Access Prometheus Dashboard</h3>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-comment"># Get the Prometheus server service name</span>
kubectl get svc

<span class="hljs-comment"># Port-forward to access from host browser</span>
kubectl port-forward --address 0.0.0.0 svc/prometheus-server 9090:80
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756915985109/97d1e135-0ad5-41a6-83db-55b274fe56d0.png" alt class="image--center mx-auto" /></p>
<p>🔴 <strong>LIVE :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756916104913/fd415f7a-06c2-4b04-abd6-a226dd237207.png" alt class="image--center mx-auto" /></p>
<p>We're accessing our Prometheus dashboard through the VM's IP address at <a target="_blank" href="http://10.246.162.180:9090">http://10.246.162.180:9090</a>. Prometheus itself is running inside the Kubernetes cluster (which is inside the VM), but we're using kubectl port-forwarding to make it accessible on the VM's network interface.</p>
<p>Your IP would be different than mine. Understand the format :</p>
<p><strong>http://_____________:9090</strong> (the blank space that you see must use your VM's IP).</p>
<hr />
<h3 id="heading-step-16-exit-your-virtual-machine">Step 16 → Exit Your Virtual Machine</h3>
<p>When you're done working, logout from your instance.</p>
<p><strong>Command used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-built_in">exit</span>
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756916271189/1a0fd7bd-53e6-4356-bff9-fcc23ee49433.png" alt class="image--center mx-auto" /></p>
<p>You'll return to your host machine, but your VM continues running in the background with all services intact.</p>
<hr />
<h3 id="heading-step-17-clean-up-your-virtual-machines">Step 17 → Clean Up Your Virtual Machines</h3>
<p>When you no longer need your instance, destroy it.</p>
<p><strong>Commands used :</strong></p>
<pre><code class="lang-bash"><span class="hljs-comment"># Check if your instance is running</span>
multipass list

<span class="hljs-comment"># Stop a running VM (keeps it for later)</span>
multipass stop first-vm

<span class="hljs-comment"># Delete a VM (removes it completely)</span>
multipass delete first-vm

<span class="hljs-comment"># Permanently remove deleted VMs</span>
multipass purge

<span class="hljs-comment"># Verify if it's deleted</span>
multipass list
</code></pre>
<p><strong>Demonstration :</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1756918347374/84781e53-b8eb-4e02-ab65-b1510239e2e5.png" alt class="image--center mx-auto" /></p>
<p>With Multipass, you can experiment fearlessly, break things, delete everything, and start fresh as many times as you want. Perfect for learning, testing different configurations, or just wanting a clean development environment!</p>
<hr />
<p><strong>Recreate/destroy as much as you want with your specified resources according to your needs. It's a playground you create to learn and try new things. Break it, fix it, start over. That's how real learning happens.</strong></p>
<p><strong>If you found this article helpful, share it with your friends, peers, or anyone who would find this useful!</strong> 🌱</p>
]]></content:encoded></item></channel></rss>