# Connect a cloud provider

> An Unrent owner or admin adds the account under Settings → Integrations. A cloud administrator applies the generated trust or supplies a scoped provider credential. After verification, Unrent can create and enroll servers in that account.

URL: https://unrent.dev/docs/cloud-providers/

## Before you start

Choose the Unrent organisation, cloud account or project, and permitted regions. Use a dedicated project or resource group where possible. If you already own a suitable Linux server, use **Servers → Add a server** to enroll it directly. See [Install the agent](https://unrent.dev/docs/install/).

In Unrent, open **Settings → Integrations**, select the provider and name the connection. Use keyless setup for AWS EC2, Amazon Lightsail, Google Cloud and Azure when available. Enter provider secrets only in Integrations. Connecting an account gives Unrent the scoped permissions to provision there. Review the server region, quota and expected charges before provisioning.

## AWS EC2 and Amazon Lightsail

1. Select **AWS EC2** or **Amazon Lightsail**. Enter the 12-digit AWS account ID and the permitted regions. Select the keyless connection option.
2. Open AWS CloudShell in that account. Review the generated CloudFormation template and run the setup command shown in Integrations. The AWS principal needs permission to deploy the stack and create its IAM role and OIDC provider. If this account already has an IAM OIDC provider for the exact Unrent issuer, pass its ARN as the template’s `ExistingOidcProviderArn` parameter.
3. Wait for the stack to finish, then press **Check** on the matching Unrent connection. Before creating EC2 servers, check that the selected region has a default VPC and usable default subnets. Lightsail shows its own availability zones.

- [AWS IAM OIDC setup](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html)
- [AWS CloudFormation deploy](https://docs.aws.amazon.com/cli/latest/reference/cloudformation/deploy.html)
- [AWS default VPCs](https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html)

## Google Cloud

1. Select **Google Cloud**, enter the project ID and numeric project number, then create the keyless connection. Use a Compute Engine project with billing enabled.
2. Open Google Cloud Shell with an account authorised to enable APIs, create workload identity pools and providers, create the custom IAM role and change that project’s IAM policy. Review the generated script and run the command for the project you entered.
3. After the script completes, press **Check** on the same connection. Before provisioning, check that the project has the default VPC network Unrent uses, plus sufficient zone capacity and quota. If an organisation policy disallows that network, ask your administrator about enrolling an existing host on an approved network.

- [Google Cloud Workload Identity Federation](https://docs.cloud.google.com/iam/docs/workload-identity-federation-with-deployment-pipelines)

## Microsoft Azure

1. Select **Azure**. Enter the tenant ID, subscription ID and existing resource group name, then create the keyless connection.
2. Open **Deploy to Azure** from the connection row. Select the same directory, subscription and resource group. The person deploying needs permission to deploy the managed identity and write role assignments at that scope. Review the template’s VM and Network Contributor role assignments. If Azure policy blocks the default managed identity region, select a permitted identity region. The connection’s VM location still follows the resource group location.
3. Wait for the Azure deployment to report success. Open its **Outputs**, copy the public `clientId` value and paste it into **clientId (deployment output)** in that same Unrent connection row. Press **Check**. If the new role assignment is still propagating, wait briefly and check again.
4. For VM provisioning, verify `Microsoft.Compute` and `Microsoft.Network` under **Subscriptions → Resource providers**. If Azure reports a missing registration, have a subscription administrator register the missing provider in that subscription. The scoped Unrent connection remains at the resource-group boundary.
5. Check that Unrent offers a VM size for the connected resource group. Azure can verify the identity even when a subscription or region has no eligible VM sizes. If the list is empty, compare the subscription’s available sizes in Azure or enroll an existing host on an approved network.

- [Azure portal template deployment](https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-portal)
- [Azure role assignment permissions](https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-steps)
- [Azure resource provider registration](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types)
- [Microsoft Entra workload identity federation](https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation)

## Hetzner and other token-based providers

Create the credential in the intended provider account, then select the provider in Integrations. Enter it there and select **Connect**. Match its permissions to the features you want Unrent to manage.

Provider credential setup

| Provider | Setup |
| --- | --- |
| Hetzner | Open the intended Hetzner project. Under **Security → API tokens**, generate a project token with **Read & Write**. [Hetzner API token guide](https://docs.hetzner.com/cloud/api/getting-started/generating-api-token/) |
| DigitalOcean | Under **API → Tokens**, create a personal access token with the required Droplet, firewall, SSH key, tag and action scopes. [DigitalOcean token guide](https://docs.digitalocean.com/reference/api/create-personal-access-token/) |
| Akamai (Linode) | Under your profile’s **API Tokens**, create a token with read/write access to Linodes and Firewalls. [Akamai token guide](https://techdocs.akamai.com/cloud-computing/docs/manage-personal-access-tokens) |
| Scaleway | Create an IAM API key with InstancesFullAccess on the intended project and SSHKeysFullAccess if you will import an SSH public key. Enter the secret key and project ID. [Scaleway key guide](https://www.scaleway.com/en/docs/iam/how-to/create-api-keys/) |
| UpCloud | In your account’s **API tokens** settings, create an API token for an account with permission to manage servers. [UpCloud token guide](https://upcloud.com/docs/guides/managing-api-tokens/) |
| Vultr | Under **Account → API**, enable API access and create a key. This connection uses dynamic IPv4 and IPv6 egress. If your policy requires a stable source allowlist, enroll an existing server instead. [Vultr API access guide](https://docs.vultr.com/platform/other/api/enable-user-api-access) |
| OVHcloud | Create an OAuth service account with IAM access to the intended Public Cloud project. In Integrations, select the account’s API region and enter its project ID and the service account credentials. [OVHcloud service accounts](https://docs.ovhcloud.com/en/guides/manage-and-operate/api/manage-service-account) |

## Verify the connection and use it from MCP

**Setup needed** means the keyless connection is still pending. Finish the provider deployment and press **Check** on its original row. **Refused** means the provider rejected verification. Check the provider error, identity permissions, account scope and regional policies. **Connected** confirms the connection check. To confirm provisioning, open **Servers → Add a server → Create on…** and verify that Unrent can list suitable locations, images and VM sizes.

1. Ask your coding agent to load the **connect-cloud** skill. The agent can list your organisation’s connections with `get_cloud_options`. With the connection ID and `setup_only: true`, it can show the account scope, generated setup and your Integrations link. The authorised person completes the provider and Console steps.
2. The agent rechecks the connection status, then calls `get_cloud_options` with the ID alone for live VM options. For Hetzner, the agent can use `plan_server` and `create_server` to request a quoted server. You approve the purchase with a passkey in the Console. Use the Console to create a server when MCP quotes are unavailable.
3. Wait for the server and Unrent agent to be ready before deploying a database. Check the database engine, network path, backup location and data residency separately. A working cloud connection confirms provider access. The database has its own readiness checks.

- [Connect your coding agent](https://unrent.dev/docs/mcp/)
- [Set up databases and backups](https://unrent.dev/docs/databases/)
