CareerByteCode
ByteBlogby CareerByteCode

Multi-Cloud Linux Deployment on AWS and Azure

🟢 Beginner
Multi-Cloud Linux Deployment on AWS and Azure

✍️ Translate this blog into Hindi, Tamil or Telugu

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.

🛍️✨ From the author · ByteStore1:1 DevOps Project & Learning Discussionโ‚น500View offer →

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.

aws-azure-public-website-deployment

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.

1. 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.

2. Tools and Technologies Used

TechnologyPurpose
Amazon EC2Provisioning the AWS Linux virtual machine
Microsoft Azure VMProvisioning the Azure Linux virtual machine
Ubuntu LinuxOperating system on both virtual machines
SSHSecure remote server access
SSH key pairsAuthentication
NGINXWeb server
HTMLWebsite content
WSL UbuntuLocal terminal for AWS operations
Git BashLocal terminal for Azure operations
GitHubSource code and project documentation

3. 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:

SettingConfiguration
Instance namemulticloud-aws-vm
RegionUS West (Oregon)
Region codeus-west-2
Operating systemUbuntu 26.04.1 LTS
Instance typet3.micro
vCPU2
Configured memory1 GiB
Storage8 GiB gp3
SSH key pairmulticloud-aws-key

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.

aws-configuration-review

Step 2: Connect to the EC2 instance

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

ec2-instance-has-launched-successfully

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.

test-the-web-server-locally

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.

the-complete-html

4. 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:

SettingValue
Resource groupmulticloud-linux-rg
RegionWest US 2
Environment tagLearning
Managed byManual

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

created-resource-manager-microsoft-azure

Step 2: Create the Azure virtual machine

I provisioned an Ubuntu virtual machine with the following configuration:

SettingConfiguration
VM namemulticloud-azure-vm
RegionWest US 2
Operating systemUbuntu 24.04.5 LTS
VM sizeStandard_B2ats_v2
vCPU1
Reported memoryApproximately 887 MiB
OS diskStandard SSD LRS
Usernameazureuser
SSH key pairmulticloud-azure-vm_key

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:

RuleProtocolPortSource
HTTPTCP80Any
SSHTCP22My public IP (/32)

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.

after-review-and-create-download-pem-file

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.

verify-the-local-web-server

test-the-azure-public-endpoint

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.

azure-website-version-2

5. 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.

Website fileWhat it communicates
AWS Version 1NGINX is running; AWS website deployment is in progress
AWS Version 2AWS website deployment is completed
Azure Version 1AWS is completed; Azure deployment is in progress
Azure Version 2Both AWS and Azure deployments are completed

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.

6. AWS vs Microsoft Azure - What Did I Learn?

After completing both deployments, I compared the configurations.

Virtual machine comparison

ConfigurationAWSMicrosoft Azure
Cloud serviceAmazon EC2Azure Virtual Machine
RegionUS West (Oregon)West US 2
Operating systemUbuntu 26.04.1 LTSUbuntu 24.04.5 LTS
VM sizet3.microStandard_B2ats_v2
vCPU21
Memory1 GiB configuredApproximately 887 MiB reported
Storage8 GiB gp3Standard SSD
Web serverNGINXNGINX

Network security comparison

ConfigurationAWSMicrosoft Azure
Network security serviceSecurity GroupNetwork Security Group
SSHTCP 22TCP 22
HTTPTCP 80TCP 80
AuthenticationSSH keySSH key

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.

One Website, Two Clouds

7. Verification Commands Used in the Project

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

CommandPurpose
whoamiVerify the logged-in user
hostnameCheck the VM hostname
cat /etc/os-releaseIdentify the operating system
uname -rCheck the kernel
nprocCheck CPU count
free -hInspect memory
df -hInspect disk usage
sudo apt updateRefresh package information
sudo systemctl status nginx --no-pagerCheck NGINX service status
sudo systemctl is-enabled nginxCheck whether NGINX starts automatically
curl -I http://localhostTest local HTTP connectivity
curl -s http://localhostInspect the served HTML content

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

8. 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.

The instance state should eventually show Terminated

On Azure:

  • Deleted the project resource group.

  • Confirmed the resource group deletion.

confirm-the-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.

9. 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.

10. Key Learnings

This project helped me gain practical experience with:

  1. Provisioning Linux virtual machines on two cloud platforms.

  2. Understanding EC2 and Azure VM configurations.

  3. Creating and using SSH key pairs.

  4. Configuring network security rules.

  5. Restricting SSH access to a specific client IP.

  6. Performing Linux system administration.

  7. Installing and managing NGINX.

  8. Understanding the NGINX web root.

  9. Backing up an existing website before replacing it.

  10. Deploying and updating a custom HTML website.

  11. Testing HTTP responses using curl.

  12. Comparing AWS and Azure infrastructure configurations.

  13. 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:

github.com/withmalathi/multi-cloud-linux-deployment

YouTube Project Walkthrough:

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.

📚 Sources
  1. docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html
  2. learn.microsoft.com/en-us/azure/virtual-machines/overview
  3. ubuntu.com/server/docs
  4. nginx.org/en/docs/

❓ Questions readers ask

What is Multi-Cloud Linux Deployment?

It is the practice of deploying and managing workloads across more than one cloud provider. In this project, we hosted the same custom HTML website independently on AWS EC2 and Microsoft Azure.

Why did we use Ubuntu Linux on both AWS and Azure?

Ubuntu provides a familiar Linux environment for installing software, managing services, and hosting websites on both cloud platforms.

What is NGINX used for in this project?

NGINX is the web server used to serve the custom HTML website over HTTP.

How do we connect to the cloud virtual machines?

We use SSH with the appropriate private key and username to securely access the remote Ubuntu virtual machines.

Does this project implement automatic failover or load balancing between AWS and Azure?

No. Both deployments are independent. This project does not implement load balancing, automatic failover, or website synchronization.

How did we verify that the website was deployed successfully?

We checked the NGINX service, tested the website locally using curl, and opened the public IP address in a browser.

Read next →Running Kubernetes Locally: kind vs minikube vs Docker Desktop⏱ 13 min

🛍️ Malathi Shetty's shelf

Courses, cohorts and more from the author
Malathi Shetty
Written by Malathi Shetty
Cloud & DevOps | AWS โ€ข Azure โ€ข Docker โ€ข Kubernetes โ€ข CI/CD
🏅 Contributor writer

Iโ€™m a Senior Software Quality Engineer learning and transitioning into Cloud & DevOps. Iโ€™m currently working hands-on with AWS, Azure, Linux, Docker, Kubernetes, CI/CD and DevSecOps. I share what I learn through practical projects and real-world examples.

Visit my ByteStoreLearning, building and sharing practical Cloud & DevOps experiences.

🌟 See Malathi Shetty's full profile: blogs, work and verified certificates

Get Malathi Shetty's next blog by email

One email a week when they publish. Add the weekly Best of ByteBlog too. No spam, unsubscribe with one click.

We email you once to confirm. By subscribing you agree to the privacy policy.

💬 Comments (0)

Top · Newest

Sign in to comment

Related blogs

🛍️✨ From the author · ByteStore1:1 DevOps Project & Learning Discussionโ‚น500View offer →