> For the complete documentation index, see [llms.txt](https://docs.hivel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivel.ai/self-managed-hivel-deployment/virtual-private-cloud/azure/hivel-on-premises-deployment-guide-azure/azure-infrastructure-setup-and-cli-configuration.md).

# Azure Infrastructure Setup and CLI Configuration

### **Provision a Virtual Machine in Azure Portal**

Go to the Azure Portal and create a new Virtual Machine with these specifications:

1. Image: Ubuntu Server 22.04 LTS
2. VM Size: Standard\_D4s\_v5 (4 vCPU, 16GB RAM)
3. Storage: 50GB Premium SSD managed disk
4. Network Security Group: Allow inbound traffic on ports 22, 80, 443, 3000, 4317 (required only while integrating Claude Code) and 5432 (Database access from application server only, no public or external access permitted).
5. After creation, note the public and private IP addresses

### **Install Prerequisites on the VM**

Connect to your VM via SSH and run the commands below. This installs Docker, Docker Compose, Azure CLI, and AWS CLI.

On the VM, run:

{% code expandable="true" %}

```
# Update system
sudo apt update && sudo apt upgrade -y
sudo apt install -y postgresql postgresql-contrib
sudo apt install -y unzip

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

# Install Azure CLI (for managing your Azure resources and Key Vault, if used)
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

# Install AWS CLI (required - Hivel's container registry and installer package are hosted on AWS)
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

# Verify installations
docker --version
docker-compose --version
az --version
aws --version

# Log out and back in for Docker group changes to take effect

```

{% endcode %}

**Verify:** Each `--version` command prints a version string with no error; `docker ps` runs without a permissions error after logging back in.

**If it fails:** If `docker ps` still asks for sudo after logging back in, run `newgrp docker` or reboot the VM. The group membership change didn't take effect in your current shell session.

**Next step:** configure the AWS CLI below, then continue to ECR Access Configuration.

### **Configure AWS CLI on the VM**

Hivel's Docker images and installer package are hosted on AWS (ECR and S3), even though your infrastructure runs on Azure. AWS CLI must be configured to authenticate and pull container images.

On the VM, run:

```
aws configure
```

Enter these values when prompted:

* AWS Access Key ID: \[Hivel-provided access key]
* AWS Secret Access Key: \[Hivel-provided secret key]
* Default region name: `ap-south-1`
* Default output format: `json`

**Verify AWS CLI Configuration:**

```
aws sts get-caller-identity
```

**Expected result:** A JSON object with Account, UserId, and Arn fields appears with no error.

**Troubleshooting:** If you see "Unable to locate credentials," re-run `aws configure` and verify with `cat ~/.aws/credentials`.

**Next step:** Your VM is now provisioned and set up. Head to [Prerequisites and Virtual Machine Requirements](/self-managed-hivel-deployment/virtual-private-cloud/azure/hivel-on-premises-deployment-guide-azure/prerequisites-overview.md) to confirm it's installed correctly, then continue with the rest of the deployment process.<br>

{% columns %}
{% column %} <a href="/self-managed-hivel-deployment/virtual-private-cloud/azure/hivel-on-premises-deployment-guide-azure/overview.md" class="button primary" data-icon="backward">Back to Overview</a>
{% endcolumn %}

{% column %}

{% endcolumn %}

{% column %} <a href="/self-managed-hivel-deployment/virtual-private-cloud/azure/hivel-on-premises-deployment-guide-azure/prerequisites-overview.md" class="button primary" data-icon="forward">Prerequisites - Overview</a>
{% endcolumn %}
{% endcolumns %}
