Skip to main content

Multi-Cloud Linux Deployment on AWS and Azure

Updated 12 min readMarkdown
Multi-Cloud Linux Deployment on AWS and Azure

Introduction Have you ever wondered how the same website can be hosted on two different cloud platforms?

In this hands-on Multi-Cloud Linux Deployment project, we will deploy the same custom HTML website independently on AWS EC2 and Microsoft Azure using Ubuntu Linux, SSH, and NGINX. We will configure both cloud environments, host the website, and verify that it is accessible through a public IP address.

Cloud computing gives us the ability to provision virtual machines, configure networking, install software and host applications without maintaining physical servers.

For someone learning Cloud and DevOps, understanding these concepts through hands-on implementation is important.

In this project, I deployed the same custom HTML website independently on two cloud platforms:

Amazon Web Services (AWS)

Microsoft Azure

Both deployments use Ubuntu Linux virtual machines and NGINX as the web server.

The objective was to understand how cloud infrastructure works in practice, how remote Linux servers are managed, and how similar deployment tasks are performed using two different cloud providers.

This blog walks through the project, the implementation steps, the comparison and the key lessons learned.

Project Overview

The project demonstrates how to:

  • Provision an Ubuntu Linux virtual machine on AWS.
  • Provision another Ubuntu Linux virtual machine on Microsoft Azure.
  • Connect to both machines using SSH key authentication.
  • Configure inbound network rules for SSH and HTTP.
  • Install and manage NGINX.
  • Deploy the same custom HTML website on both servers.
  • Verify the website locally and through public IP addresses.
  • Compare the infrastructure and networking configurations of AWS and Azure.

Project architecture

The architecture is straightforward.

We have two independent cloud environments:

AWS environment

Amazon EC2

Ubuntu Linux

SSH access

NGINX

Custom HTML website

Azure environment

Azure Virtual Machine

Ubuntu Linux

SSH access

NGINX

The same custom HTML website

Each virtual machine hosts its own copy of the website. They are not synchronized, and there is no load balancing or automatic failover between them.

Tools and Technologies Used

AWS Deployment - Hosting the Website on Amazon EC2

The first phase involved creating an Ubuntu Linux virtual machine on AWS.

Step 1: Provision the EC2 instance

I created an EC2 instance with the following configuration:

During instance creation, I configured the inbound security rules:

SSH - TCP port 22 - My IP.

HTTP - TCP port 80 - Anywhere IPv4.

SSH allows us to administer the server remotely, while HTTP allows visitors to access the website.

Step 2: Connect to the EC2 instance

After the instance was running, I connected to it using SSH from WSL Ubuntu.

First, I configured the private key permissions:

chmod 400 /mnt/d/pem/multicloud-aws-key.pem 

Then I connected to the instance:

ssh -i /mnt/d/pem/multicloud-aws-key.pem ubuntu@<AWS_PUBLIC_IP>             

I verified the connection:

whoami 

Expected output:

ubuntu 

This confirmed that I had successfully logged in to the remote Ubuntu server.

Step 3: Inspect the Linux environment

Before installing NGINX, I checked the operating system and available resources.

cat /etc/os-release
uname -r
nproc
free -h
df -h

These commands helped me understand the operating system, kernel, CPU, memory and disk information.

Step 4: Update packages and install NGINX

I refreshed the Ubuntu package information:

sudo apt update 

Then I installed NGINX:

sudo apt install nginx -y 

To verify that NGINX was running:

sudo systemctl status nginx --no-pager 

I also checked whether the service was enabled:

sudo systemctl is-enabled nginx 

Expected output:

enabled 

Step 5: Test NGINX locally

Before deploying the custom website, I tested the web server from inside the EC2 instance.

curl -I http://localhost 

The response included:

HTTP/1.1 200 OK Server: nginx 

This confirmed that NGINX was responding to local HTTP requests.

Step 6: Deploy the custom website - Version 1

Instead of keeping the default NGINX welcome page, I used my own HTML dashboard.

The first AWS website file was:

aws-website-version-1.html

I opened the file locally, copied its complete HTML contents and connected to the EC2 instance using SSH.

Inside the remote server, I ran:

sudo tee /var/www/html/index.html > /dev/null <<'EOF' 

I pasted the complete HTML content and entered EOF on a new line to finish writing the file.

To verify the file:

sudo ls -lh /var/www/html/index.html 

The website was now available in the NGINX web root.

I tested it locally:

curl -I http://localhost 

Then I opened the EC2 public IP address in a browser:

http://<AWS_PUBLIC_IP>/ 

The first dashboard showed that NGINX was running and website deployment was in progress.

Step 7: Update the AWS website - Version 2

After verifying the initial website, I updated the dashboard to show that the AWS deployment was completed.

The second file was:

aws-website-version-2.html

I copied its complete contents and used the same sudo tee method to replace the existing index.html.

I verified the updated content:

curl -s http://localhost | head -20 

I then refreshed the public endpoint in the browser.

The AWS dashboard now showed that the website deployment was completed.

This completed the first cloud deployment.

Microsoft Azure Deployment - Hosting the Same Website

The second phase involved creating another Ubuntu Linux virtual machine on Microsoft Azure.

The goal was to repeat the website deployment process using Azure infrastructure.

Step 1: Create an Azure resource group

I created a resource group with the following configuration:

A resource group helps organize related Azure resources in one logical container.

Step 2: Create the Azure virtual machine

I provisioned an Ubuntu virtual machine with the following configuration:

I also configured auto-shutdown for 19:00 IST in the lab.

Step 3: Configure Azure Network Security Group rules

Azure uses a Network Security Group (NSG) to control inbound and outbound network traffic.

For this project, I configured the following inbound rules:

One important learning from this step was reviewing the SSH rule.

During configuration, I identified that SSH access was initially open to the entire internet. I corrected the rule to restrict access to my current public IP address.

For a new deployment, restricting SSH access from the beginning is the better approach.

Step 4: Connect to the Azure VM using SSH

I used Git Bash for the Azure connection.

First, I copied the downloaded private key into the SSH directory:

mkdir -p ~/.ssh
cp /d/pem/multicloud-azure-vm_key.pem ~/.ssh/
chmod 400 ~/.ssh/multicloud-azure-vm_key.pem 

Then I connected:

ssh -i ~/.ssh/multicloud-azure-vm_key.pem azureuser@<AZURE_PUBLIC_IP> 

I verified the logged-in user:

whoami 

Expected output:

azureuser 

I also checked the hostname:

hostname 

Step 5: Inspect Linux and install NGINX

As with AWS, I inspected the operating system and available resources:

cat /etc/os-release uname -r nproc free -h df -h verify-linux-environment

I updated the package information:

sudo apt update 

Then installed NGINX:

sudo apt install nginx -y 

I checked the service:

sudo systemctl status nginx --no-pager 

And verified that it was enabled:

sudo systemctl is-enabled nginx 

Step 6: Verify the default NGINX website

I tested the local web server:

curl -I http://localhost 

The server returned an HTTP 200 response.

Before replacing the default page, I inspected the NGINX web root:

ls -la /var/www/html/ 

I also inspected the NGINX configuration:

sudo nginx -T 2>/dev/null | grep -E 'root |index ' 

On this Azure VM, the default welcome page was index.nginx-debian.html.

I created a backup before deploying my custom website:

sudo cp /var/www/html/index.nginx-debian.html 
/var/www/html/index.nginx-debian.html.backup 

This provided a copy of the original page.

Step 7: Deploy the Azure website - Version 1

The initial Azure website file was:

azure-website-version-1.html

I opened the file locally, copied its complete HTML contents and connected to the Azure VM through SSH.

Inside the remote VM, I ran:

sudo tee /var/www/html/index.html > /dev/null <<'EOF' 

I pasted the complete HTML content and entered EOF on a new line.

I verified that the file existed:

sudo ls -lh /var/www/html/index.html 

The initial Azure dashboard showed that AWS deployment was completed and Azure deployment was in progress.

Step 8: Update the Azure website - Version 2

After verifying the initial Azure website, I updated it using:

azure-website-version-2.html

I copied the complete HTML contents and used the same sudo tee command to replace the existing website.

I verified the page locally:

curl -s http://localhost | head -20 

Then I opened the Azure public IP address in the browser:

http://<AZURE_PUBLIC_IP>/ 

The final dashboard showed that both AWS and Azure deployments were completed.

This completed the second cloud deployment.

Understanding the Four Website Versions

One interesting part of this project was using the website itself to communicate deployment progress.

I maintained four separate HTML files.

The files were updated manually by copying and pasting their HTML contents into the respective Linux virtual machines.

This was a visual way to demonstrate the project milestones.

It was not an automated deployment pipeline or a synchronization mechanism between the two clouds.

AWS vs Microsoft Azure - What Did I Learn?

After completing both deployments, I compared the configurations.

Virtual machine comparison

Network security comparison

Important similarities

  • Both platforms provide cloud-based Linux virtual machines.
  • Both support SSH key authentication.
  • Both allow us to configure inbound network rules.
  • Both support NGINX.
  • Both successfully hosted the same custom HTML website.

Important differences

  • AWS uses EC2, whereas Azure provides Virtual Machines.
  • AWS uses Security Groups, whereas Azure uses Network Security Groups.
  • The virtual machine sizes and available resources differ.
  • Storage configuration options differ.
  • The cloud portals and resource management workflows are different.

The most important takeaway was that Linux administration and NGINX concepts remain largely familiar even when we move between cloud providers.

Verification Commands Used in the Project

These were some of the commands I used throughout the implementation.

These basic commands are useful when troubleshooting a Linux web server hosted on a cloud virtual machine.

Cleanup and Cost Awareness

After completing the deployments and capturing the project evidence, I performed resource cleanup.

On AWS:

  • Terminated the EC2 instance.
  • Deleted the project-specific key pair from AWS.
  • Deleted the project-specific security group.

On Azure:

  • Deleted the project resource group.
  • Confirmed the resource group deletion.

There are additional checks that should be performed before considering the entire environment fully cleaned up.

For example:

  • Review remaining EBS volumes and snapshots.
  • Check for any allocated Elastic IP addresses.
  • Review AWS Billing and Cost Management.
  • Review Azure Cost Management.

Cloud resources can incur charges depending on their type, region, configuration and usage. Deleting a virtual machine does not necessarily remove every associated resource or previously incurred charge.

It is important to review the remaining resources and billing information after completing a cloud lab.

What This Project Does Not Implement

This project focuses on the fundamentals of cloud VM provisioning, Linux administration and website hosting.

It does not implement:

  • Automated CI/CD pipelines.
  • Load balancing between AWS and Azure.
  • Automatic failover.
  • Website synchronization between clouds.
  • HTTPS or TLS configuration.
  • Domain name configuration.
  • Centralized monitoring.

These are possible areas for future learning and improvement.

Key Learnings

This project helped me gain practical experience with:

  • Provisioning Linux virtual machines on two cloud platforms.
  • Understanding EC2 and Azure VM configurations.
  • Creating and using SSH key pairs.
  • Configuring network security rules.
  • Restricting SSH access to a specific client IP.
  • Performing Linux system administration.
  • Installing and managing NGINX.
  • Understanding the NGINX web root.
  • Backing up an existing website before replacing it.
  • Deploying and updating a custom HTML website.
  • Testing HTTP responses using curl.
  • Comparing AWS and Azure infrastructure configurations.
  • Reviewing cloud resource cleanup and cost considerations.

The biggest lesson was that learning cloud computing is not just about creating a virtual machine. We also need to understand connectivity, security, operating system administration, application deployment and verification.

Conclusion

In this hands-on project, I successfully deployed the same custom HTML website independently on AWS EC2 and Microsoft Azure virtual machines.

Both servers used Ubuntu Linux and NGINX. I configured SSH access, reviewed network security rules, installed the web server, deployed the website and verified both public endpoints.

Working with two cloud providers helped me understand how their infrastructure services differ while reinforcing the Linux administration concepts that are common to both.

For anyone starting their Cloud and DevOps learning journey, I recommend building small projects like this one. Provisioning infrastructure, connecting to servers, deploying something and verifying the result can make theoretical concepts much easier to understand.

Project Resources

GitHub Repository: https://github.com/withmalathi/multi-cloud-linux-deployment

YouTube Project Walkthrough: https://youtu.be/P-l0E6OUANw

Feel free to explore the repository, review the screenshots and follow the implementation steps.

Building practical cloud skills through hands-on deployment, verification and continuous learning.

About the author

  • QA Engineer transitioning into DevOps with 13+ years of experience in software testing, automation, CI/CD, Docker, Kubernetes, and cloud technologies. Sharing real-world DevOps learning, hands-on projects, and career transformation experiences.

No comments yet. Be the first to comment.