# Azure

> Create an Ubuntu VM for Grovs in your Azure subscription from the ARM template.

Source: https://docs.grovs.io/docs/self-hosting/clouds/azure

[Deploy to Azure](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fgrovs-io%2Fself-host%2Fmain%2Fdeploy%2Fazure%2Fazuredeploy.json)

## When to use

You want the full stack on one Ubuntu 24.04 VM in your Azure subscription. The template creates a virtual network, restricted SSH access, a static public IPv4 and a persistent disk. The default VM is `Standard_D4s_v5` with 4 vCPU, 16 GiB RAM and a 128 GiB disk. **Azure bills your subscription for these resources.**

## Prerequisites

| Requirement          | Notes                                                                                     |
| -------------------- | ----------------------------------------------------------------------------------------- |
| Permissions          | Create compute and network resources in a new resource group                              |
| SSH key              | The contents of your `.pub` file                                                          |
| A domain you control | For the [DNS records](https://docs.grovs.io/docs/self-hosting/get-started/deployment#dns) |

[Review the template](https://github.com/grovs-io/self-host/tree/main/deploy/azure) before you deploy. The form defaults to published release `2.3.1` and a pinned Compose source commit.

## 1. Prepare DNS and firewall

The template restricts SSH to the source you set in `sshSourceCidr`. Point the DNS records at the public IP from **Outputs** after step 2.

## 2. Create the server

### 1. Start the deployment

Select **Deploy to Azure**. Choose your subscription, a new resource group and a region where the VM size is available.

### 2. Fill in the form

Enter your app domain (such as `grovs.example.com`), administrator email and **SSH public key**. Set `sshSourceCidr` to your public IPv4 followed by `/32`. Leave `adminUsername` as `grovsadmin` unless you need another.

### 3. Create

Review the VM size, disk, image release and costs, then create. Open the deployment's **Outputs** for the IP address and SSH command.

## 3. Install Grovs

The VM installs Grovs with cloud-init. VM creation can finish before application setup does. Point the DNS records at the public IP.

## 4. Deploy and verify

SSH with the printed command, then:

```bash
sudo cloud-init status --wait
sudo tail -100 /var/log/cloud-init-output.log
sudo systemctl status grovs --no-pager
sudo docker compose --project-directory /opt/grovs ps -a
sudo cat /opt/grovs/.env
```

Open `https://dashboard.grovs.example.com` and sign in with `BOOTSTRAP_ADMIN_EMAIL` and `BOOTSTRAP_ADMIN_PASSWORD` from `.env`. Keep that file private. Create a project and a link, open the link, and confirm analytics before you connect your apps.

## Upgrades

`grovs.service` restarts the existing stack on reboot. Follow [Upgrades](https://docs.grovs.io/docs/self-hosting/operate/upgrades) and [Backups](https://docs.grovs.io/docs/self-hosting/operate/backups) from `/opt/grovs` as root.

## Gotchas

- A successful ARM deployment does not prove that migrations or DNS have completed. Run the checks above.
- Back up databases, uploads and `.env` outside the resource group before removal.
- Deleting only the VM detaches and retains its disk. Retained disks and IPs can keep billing.
- **Deleting the resource group deletes the disk and its Grovs data too.**
