Your First Server (Azure)
We will do this as an interactive session. This guide targets Microsoft Azure — our team's main platform. The concepts transfer to other providers, but names and clicks refer to the Azure Portal.
Objectives
We are going to:
- Set up a server on a cloud provider
- Perform initial server setup
- Deploy a website on the internet using nginx
What you will need
- Credit card
- Cloud provider account
- SSH Key from the previous section
Free tiers
Azure offers free services and a trial credit for new accounts. Quotas and offers change — check the Azure free account page and set a billing alert + resource group cleanup reminder before you start.
Provisioning a server (Azure Portal)
We will walk you through provisioning an Azure Virtual Machine.
- Sign in to the Azure Portal.
- Create a dedicated Resource Group (e.g.
course-rg) in a UK region (e.g. UK South) — delete the group at the end to stop all charges. - Create a resource > Virtual Machine: image Ubuntu 22.04 LTS, size
B1s(1 vCPU / 1 GB RAM) for this tutorial. - Authentication: SSH public key, username e.g.
azureuser, paste yourazure_key.pubcontents. Reuse your one laptop key — do not create a new key per server. - Inbound ports: allow SSH (22) now; we will add HTTP (80) when we deploy nginx.
- Click
Review + Create>Create, then note the VM's public IP address.
Initial server setup
Once the server is created, you will need to perform some initial setup steps.
1. SSH into the server using the command below
| Bash | |
|---|---|
Replace <server-ip> with the public IP address of your Azure VM.
2. Update the server
| Bash | |
|---|---|
3. Install build tools
| Bash | |
|---|---|
4. Secure the server
Allow SSH and HTTP (HTTP is needed for the nginx demo below):
Note
Also check the Azure Network Security Group for your VM allows ports 22 and 80 — ufw alone is not enough on Azure.
5. Deploy a static website
Create a new directory for the website:
| Bash | |
|---|---|
Create a simple HTML file in the /var/www/html directory:
Copy this into the file:
| /var/www/html/index.html | |
|---|---|
Configure nginx to serve the website (Ubuntu already enables the default site — just test and reload):
Set up DNS records to point to the server IP address.
Visit the website and you should see the "Hello, World!" message.
6. What next?
Things you can try:
- Set up SFTP and upload files to this server
- Connect VSCode to this remote server and run jupyter notebooks on it
- Deploying more complex web applications
- Set up this machine as a head node for NextFlow
Warning
Remember to stop/deallocate (or delete the resource group) after this to avoid charges. On Azure, Stop alone may still incur compute charges — use Stop (deallocate) or delete course-rg.
Why did we set up a server from scratch?
Going through this exercise is useful because these concepts will be directly applicable when we move onto more advanced topics of containerization and infrastructure as code. Deploying this by hand will help you understand the underlying concepts of how servers work and how to configure them.
This exercise demonstrates the importance of environment management in creating reproducible workflows. In the past, it was common for the issue of "it works on my machine but not yours" to arise.
If you revisit the chapter on setting up python and python environments, you will see that we are essentially dealing with the same problem here, with a slightly different context.
Info
What we did in this tutorial in setting up the server is also known as ClickOps. This is where you manually click through the interfaces to set up the server. The next level to this is to automate the process of deploying servers using Infrastructure as Code (IaC) tools like Terraform and Ansible. If you are setting up more complex cloud infrastructure, you may wish to pick up these technologies.