---
title: "Getting started with Load Balancer on Public Cloud"
description: "Discover how to launch a Load Balancer on Public Cloud"
url: https://docs.ovhcloud.com/en/guides/public-cloud/network-services/getting-started-load-balancer
lang: en
lastUpdated: 2026-06-10
---
# Getting started with Load Balancer on Public Cloud

## Objective

Our Public Cloud Load Balancer is based on [OpenStack Octavia](https://wiki.openstack.org/wiki/Octavia) and is fully integrated into the Public Cloud universe.

**Learn how to configure an OVHcloud Load Balancer with the help of this guide.**

## Requirements

- A [Public Cloud project](/en/guides/public-cloud/cross-functional/create-a-public-cloud-project.md) in your OVHcloud account
- Understanding the [Load Balancer concepts](/en/guides/public-cloud/network-services/load-balancer-concepts.md)
- Understanding the [Public Cloud Networking concepts](/en/guides/public-cloud/network-services/concepts.md)
- A Load Balancer requires a subnet, read the [Getting started with vRack](/en/guides/public-cloud/network-services/vrack.md#create-pn-in-vrack) guide for more information
- (Optional): This guide explains the load balancer configuration through Graphical Interface & Command Line Interface. If you want to use the latter, then install the [OpenStack Command Line environment](/en/guides/public-cloud/cross-functional/compute-prepare-openstack-api-environment.md)

## Instructions


***

### OVHcloud Control Panel Access

- **Direct link:** <ManagerLink to="/#/pci/projects">Public Cloud Projects</ManagerLink>
- **Navigation path:** <code className="action">Public Cloud</code> > Select your project

***


### Creating the Load Balancer


**Via the OVHcloud Control Panel**

Click <code className="action">Load Balancer</code> (under **Network**) in the left menu, then click the <code className="action">Create a Load Balancer</code> button.
The configuration page will open.
**Step 1: Region choice**
1. **Select the zone type:**

   - 1AZ: Deployment in a single availability zone.
   - 3AZ: Deployment spread across three availability zones for high availability.

2. **Choose the region:** Only regions where you have a private network and at least one subnet can be selected. Select the region and click <code className="action">Next</code>.
**Step 2: Size choice**
The interface contains a link to the website on which the characteristics / benchmark of all size are provided. Once you have chosen your size, click <code className="action">Next</code>.
**Step 3: Attach a public IP (or not)**
At this stage, you need to know if your Load Balancer will be receiving public traffic or not (for more details, read our [Public Cloud Networking concepts](/en/guides/public-cloud/network-services/concepts.md) page).
If your Load Balancer is processing public traffic, you have 2 options:
- `New Public IP`: This option will create a new Floating IP for your Load Balancer.
- If you already have a Floating IP, the interface will offer you to pick one.
If your Load Balancer is processing private traffic, choose <code className="action">No Public IP</code>.
**Step 4: Select the private network and the subnet where the Load Balancer will be spawned**
The interface will inform you if the private network / subnet is not compliant with the prerequisites (see [Public Cloud Networking concepts](/en/guides/public-cloud/network-services/load-balancer-concepts.md#network-prerequisites)).
**Step 5 (optional): Define the listener(s) and the members**
![Listener choice](/images/public-cloud/network-services/getting-started-01-create-lb-service/listener.png)- First, choose the listener protocol & the port according to the traffic you will receive. Note that a specific listener called `Prometheus` is available to monitor your Load Balancer. In that case, it is not possible to add members. For more information on this listener, read the [Load Balancer monitoring with Prometheus](/en/guides/public-cloud/network-services/loadbalancer-monitoring-prometheus.md) guide.
- Then, choose the Health Monitor type. Note that since some health monitor types are not compatible with some protocols, the user interface filters those types so that you can only choose compatible items. For more information on the health monitor compatibility, read the [Public Cloud Networking concepts](/en/guides/public-cloud/network-services/concepts.md) guide.
- Finally, from the instances of your region, choose the member IP & port that will be part of the pool. Note that in order to simplify the configuration workflow, it is only possible to have a pool with the same protocol as the listener, and that the member can only be chosen from the instance. Those limitations can be bypassed by skipping this part of configuration and use the pool / member configuration once the Load Balancer is created.
:::info
In order to simplify the Load Balancer configuration workflow, it is only possible to have a pool with the same protocol as the listener and the member can only be chosen from the instance. Furthermore the pool load balancing algorithm is by default set to `ROUND_ROBIN`.
Those limitations can be bypassed by skipping this part of configuration and use the pool / member configuration once the Load Balancer is created.
:::
**Step 6: Define the name of Load Balancer**
You can update the name according to your choice and click on <code className="action">Create a Load Balancer</code>.
You will be redirected to the Load Balancer listing page. Among the attributes that are displayed, the `Operating status` and `Provisioning status` provide information on the state of your load balancer. Find more information on the "[Load Balancer concepts](/en/guides/public-cloud/network-services/load-balancer-concepts.md#operating-provisioning-status)" page.


**Via the OpenStack CLI**

Another way to create a Load Balancer is through the OpenStack Command Line Interface. Before you begin, consult the following guides:
- [Preparing an environment for using the OpenStack API](/en/guides/public-cloud/cross-functional/compute-prepare-openstack-api-environment.md).
- [Setting OpenStack environment variables](/en/guides/public-cloud/cross-functional/compute-set-openstack-environment-variables.md).
**Configuring your private network**
Before creating a Load Balancer, you will need to set up a private network:
```bash
openstack network create my_network

openstack subnet create my_subnet --subnet-range <my_private_ip_range/mask> --network my_network --no-dhcp

openstack router create my_router

openstack router add subnet my_router my_subnet

openstack router set --external-gateway Ext-Net my_router
```
You can now attach your instances to the new network. We recommend following our guide to [integrate an instance into vRack](/en/guides/public-cloud/network-services/vrack.md#instance-integration).
List the addresses of your instances in your network with the following command:
```bash
openstack server list
```
In the next step, configure the network interfaces of your instances according to this output.
**Creating the Load Balancer**
You can view a list of the different Load Balancer flavors we offer with this command:
```bash
openstack loadbalancer flavor list
```
You can now create your Load Balancer with the following command. In this example, we will create a "Small" Load Balancer.
```bash
openstack loadbalancer create --name my_load_balancer --flavor small --vip-subnet-id my_subnet
```
Your Load Balancer will be configured with an IP address of the private network. If you want to have access from the internet, you will need to attach a Floating IP address.
**Attaching a Floating IP address to a Load Balancer**
This is how to attach a Floating IP address to a Load Balancer:
```bash
openstack floating ip create Ext-Net
openstack floating ip set --port <my_load_balancer_vip_port_id> <floating_ip>
```
:::info
To retrieve the VIP port ID of your Load Balancer, use `openstack loadbalancer show my_load_balancer`.
:::
**Configuring your Load Balancer**
In this example we will configure an HTTP Load Balancer. In order to listen on port 80 of the Load Balancer, create a Listener with this command:
```bash
openstack loadbalancer listener create --name my_listener_http --protocol HTTP --protocol-port 80 my_loadbalancer
```
Once the Listener has been created, you need to add each instance that can respond to external requests. To do this, you must create an Instance Pool:
```bash
openstack loadbalancer pool create --name my_pool_http --lb-algorithm ROUND_ROBIN --listener my_listener --protocol HTTP
```
Add your instances to the Instance Pool:
```bash
openstack loadbalancer member create --subnet-id my_subnet --address <private_ip_instance_1> --protocol-port 80 my_pool
openstack loadbalancer member create --subnet-id my_subnet --address <private_ip_instance_2> --protocol-port 80 my_pool
```
You can now access your Load Balancer via the Floating IP or private IP address from an instance in your private network.


**Via the OVHcloud API**

Use the [OVHcloud API](/en/guides/manage-and-operate/api/first-steps.md) to create a Load Balancer programmatically.
**Retrieve available flavors**

🇪🇺EU▾

[GET/cloud/project/{serviceName}/region/{regionName}/loadbalancing/flavor](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#get-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/flavor)

**Create the Load Balancer**

🇪🇺EU▾

[POST/cloud/project/{serviceName}/region/{regionName}/loadbalancing/loadbalancer](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#post-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/loadbalancer)

```json
{
  "flavorId": "<flavor_id>",
  "name": "my-load-balancer",
  "network": {
    "private": {
      "network": {
        "id": "<network_id>",
        "subnetId": "<subnet_id>"
      }
    }
  }
}
```
**Attach a Floating IP (for public traffic)**

🇪🇺EU▾

[POST/cloud/project/{serviceName}/region/{regionName}/loadbalancing/loadbalancer/{loadBalancerId}/floatingIp](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#post-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/loadbalancer/-loadBalancerId-/floatingIp)

**Create a listener**

🇪🇺EU▾

[POST/cloud/project/{serviceName}/region/{regionName}/loadbalancing/listener](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#post-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/listener)

```json
{
  "loadbalancerId": "<loadbalancer_id>",
  "name": "my-listener",
  "port": 80,
  "protocol": "http"
}
```
**Create a pool**

🇪🇺EU▾

[POST/cloud/project/{serviceName}/region/{regionName}/loadbalancing/pool](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#post-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/pool)

```json
{
  "algorithm": "roundRobin",
  "listenerId": "<listener_id>",
  "loadbalancerId": "<loadbalancer_id>",
  "name": "my-pool",
  "protocol": "http"
}
```
**Add members to the pool**

🇪🇺EU▾

[POST/cloud/project/{serviceName}/region/{regionName}/loadbalancing/pool/{poolId}/member](https://eu.api.ovh.com/console/?section=/cloud&branch=v1#post-/cloud/project/-serviceName-/region/-regionName-/loadbalancing/pool/-poolId-/member)

```json
{
  "members": [
    { "address": "<private_ip_1>", "name": "member-1", "protocolPort": 80 },
    { "address": "<private_ip_2>", "name": "member-2", "protocolPort": 80 }
  ]
}
```


**Via the OVHcloud CLI**

Use the [OVHcloud CLI](https://github.com/ovh/ovhcloud-cli) to manage your Load Balancer. Set your cloud project with `--cloud-project <project_id>` or configure it in your profile.
**Create the Load Balancer**
```bash
ovhcloud cloud loadbalancer create <region> \
  --name my-load-balancer \
  --size small \
  --network-id <network_id> \
  --subnet-id <subnet_id>
```
**Attach a Floating IP (for public traffic)**
```bash
ovhcloud cloud loadbalancer create-floating-ip <loadbalancer_id>
```
**Create a listener**
```bash
ovhcloud cloud loadbalancer listener create <region> \
  --loadbalancer-id <loadbalancer_id> \
  --name my-listener \
  --port 80 \
  --protocol http
```
**Create a pool**
```bash
ovhcloud cloud loadbalancer pool create <region> \
  --loadbalancer-id <loadbalancer_id> \
  --listener-id <listener_id> \
  --name my-pool \
  --algorithm roundRobin \
  --protocol http
```
**Add members to the pool**
```bash
ovhcloud cloud loadbalancer pool member create <pool_id> \
  --address <private_ip_1> --name member-1 --protocol-port 80
ovhcloud cloud loadbalancer pool member create <pool_id> \
  --address <private_ip_2> --name member-2 --protocol-port 80
```


**Via Terraform**

Use the [OVHcloud Terraform provider](https://registry.terraform.io/providers/ovh/ovh/latest/docs/resources/cloud_project_loadbalancer) to create a Load Balancer with the `ovh_cloud_project_loadbalancer` resource.
**Retrieve available flavors**
```hcl
data "ovh_cloud_project_loadbalancer_flavors" "flavors" {
  service_name = var.service_name
  region_name  = var.region
}
```
**Create the Load Balancer**
```hcl
resource "ovh_cloud_project_loadbalancer" "lb" {
  service_name = var.service_name
  region_name  = var.region
  flavor_id    = data.ovh_cloud_project_loadbalancer_flavors.flavors.flavors[0].id
  name         = "my-load-balancer"
  network = {
    private = {
      network = {
        id        = var.network_id
        subnet_id = var.subnet_id
      }
    }
  }
}
```


## Go further

[Official documentation of OpenStack Octavia](https://docs.openstack.org/octavia/latest/)

[Cookbook OpenStack Octavia](https://docs.openstack.org/octavia/latest/user/guides/basic-cookbook.html)

For training or technical assistance, contact your sales representative or [request a quote from our Professional Services team](https://www.ovhcloud.com/en-gb/professional-services/).

Join our [community of users](https://community.ovhcloud.com/).
