Deploying an Nginx Web Server through ARM templates
Table of contents
In this blog, we'll cover:
How to create a VM using templates
Deploying Nginx via SSH or MobaXterm
Step 1: Set Up Your Azure Account
Ensure you have an Azure free-tier account set up before proceeding.
Step 2: GitHub Repository
Open your GitHub repository or fork any repository you prefer. In this case, I’m using Kodecloud's repository. You can clone it using GitHub Desktop.
Step 3: Create Your VM
Open the ARM template and parameters.json
file in VS Code.
Log in to your Azure account, navigate to the Virtual Machines (VM) section, and choose the option to deploy using a template and parameters.
Copy the relevant code from VS Code and paste it into Azure to create your VM.
Check the deployment
Step 4 (Optional): Configure DNS
If desired, set up a DNS for your public IP address. Copy the DNS name or IP address for future reference.
Step 5: Connect to Your VM
Connect to your VM via SSH using the Azure portal's "Connect" option or with MobaXterm (download it here). To connect using MobaXterm:
-
Open the 'Session' menu
Select 'SSH'
Enter the DNS name
Provide your username
You will be prompted for your password. Once entered, you’ll be connected to your VM.
Step 6: Deploy NGINX
Switch to the root user by typing sudo su
. Clone the GitHub repository with the command:
git clone [
repository link
]
Follow the commands:
Check whether everything is installed or not!
Create nginx pod and run the image
Get the status of kubernetes by using the command shown below
Open your browser and navigate to the URL along with the port number.
Congratulations! You’ve successfully deployed your Nginx web server.
Happy Deploying :)
Subscribe to my newsletter
Read articles from Alla Yasheela directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Alla Yasheela
Alla Yasheela
I'm Yasheela, an undergraduate with a deep interest in DevOps, and cloud technologies. Currently working on exciting projects on all things DevOps. I’m passionate about simplifying complex concepts and sharing practical insights. Through my Hashnode blog, I document my learning journey, from building scalable applications to mastering cloud services, with the goal of empowering others to grow their tech skills. Let's Learn Together !!