Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Application Load Balancer
  • Getting started
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • L7 load balancer logs
  • Release notes

In this article:

  • Getting started
  • Create a VM and set up a test web server on it
  • Create a target group
  • Create a backend group
  • Create an HTTP router
  • Create an L7 load balancer
  • Test the load balancer
  • How to delete the resources you created

Getting started with Yandex Application Load Balancer

Written by
Yandex Cloud
Updated at May 19, 2025
  • Getting started
  • Create a VM and set up a test web server on it
  • Create a target group
  • Create a backend group
  • Create an HTTP router
  • Create an L7 load balancer
  • Test the load balancer
  • How to delete the resources you created

Yandex Application Load Balancer is a cloud service terminating TLS connections and routing requests to backend applications. Application Load Balancer operates at Layer 7 of the OSI model, supporting HTTP and HTTPS protocols.

In this tutorial, you will deploy the Application Load Balancer infrastructure and configure traffic routing to the test application backend.

This infrastructure includes:

  • Target group
  • Backend group
  • HTTP router
  • L7 load balancer

Below we explain how to create each component individually. Alternatively, you can use the wizard to create all components at once.

Getting startedGetting started

  1. Log in to the management console or sign up. If you have not signed up yet, navigate to the management console and follow the on-screen instructions.
  2. On the Yandex Cloud Billing page, check whether you have a billing account with ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account yet, create one.
  3. If you do not have a folder yet, create one. While creating a folder, you can also create a default virtual network with subnets in all availability zones.

Create a VM and set up a test web server on itCreate a VM and set up a test web server on it

  1. Create the test-vm1 VM from the Ubuntu 24.04 public image in the ru-central1-a availability zone.

  2. Connect to your VM over SSH.

    If you have the Yandex Cloud CLI installed, you can connect to your VM via OS Login:

    yc compute ssh --name test-vm1
    
  3. Start a test web server listening on port 8080:

    mkdir test-server; echo 'HELLO' > test-server/hello.txt; python3 -m http.server -d test-server 8080
    
  4. Make sure your web server returns a list of subdirectories in the test-server directory. Open the terminal on your computer and run this command:

    curl --verbose <VM_public_IP_address>:8080
    

Create a target groupCreate a target group

The system will deploy your application backends on the target group VM. The load balancer will distribute requests to your application backend endpoints via the target group.

In our example, the target group will consist of a single VM.

Management console
CLI
  1. In the management console, select the folder where you want to create your target group.
  2. In the list of services, select Application Load Balancer.
  3. In the left-hand menu, select Target groups.
  4. Click Create target group.
  5. Specify the target group name: test-target-group.
  6. Select test-vm1.
  7. Click Create.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

Run this command:

yc alb target-group create test-target-group \
  --target subnet-name=<VM_subnet_name>,ip-address=<VM_internal_IP_address>

Create a backend groupCreate a backend group

Backend groups contain traffic distribution rules and health check configurations for targets. Create a group and add a backend to it.

Management console
CLI
  1. In the left-hand menu, select Backend groups.
  2. Click Create backend group.
  3. Specify your backend group name: test-backend-group.
  4. Under Backends, click Add. Specify the backend settings:
    1. Specify the backend name: backend-1.
    2. In the Target group list, select test-target-group.
    3. Set Port: 8080.
  5. Expand Protocol settings:
    1. Select the HTTP type.
  6. Click Add health check and configure health checks:
    1. Timeout, s: 1.
    2. Interval: 3.
    3. Healthy threshold: 2.
    4. Unhealthy threshold: 2.
    5. Type: HTTP.
    6. Path: /.
  7. Click Create.
  1. Create a backend group:

    yc alb backend-group create test-backend-group
    
  2. Create a backend and a health check:

    yc alb backend-group add-http-backend \
      --backend-group-name test-backend-group \
      --name backend-1 \
      --port 8080 \
      --target-group-name test-target-group \
      --target-group-id <target_group_ID> \
      --http-healthcheck healthy-threshold=2,unhealthy-threshold=2,timeout=1s,interval=3s,path=/
    

Create an HTTP routerCreate an HTTP router

HTTP routers implement rules for client-to-backend traffic and allow you to modify requests at the load balancer layer.

Management console
CLI
  1. In the left-hand menu, select HTTP routers.
  2. Click Create HTTP router.
  3. Specify the router name: test-http-router.
  4. Under Virtual hosts, click Add virtual host.
  5. Specify the host name: test-virtual-host.
  6. Click Add route.
  7. Set Name to test-route.
  8. In the Path field, select Starts with and specify the / path.
  9. In the Action field, keep Routing.
  10. From the Backend group list, select test-backend-group.
  11. Do not change other settings. Click Create.
  1. Create an HTTP router:

    yc alb http-router create test-http-router
    
  2. Create a virtual host:

    yc alb virtual-host create test-virtual-host --http-router-name test-http-router
    
  3. Add a route:

    yc alb virtual-host append-http-route test-route \
      --http-router-name test-http-router \
      --prefix-path-match / \
      --backend-group-name test-backend-group \
      --virtual-host-name test-virtual-host
    

Create an L7 load balancerCreate an L7 load balancer

A load balancer uses listeners to receive incoming requests which it then distributes across target group VMs according to the rules specified in the HTTP router.

In the following example, we will deploy a load balancer and its backend node in the same subnet and availability zone.

Management console
CLI
  1. In the left-hand menu, select Load balancers.

  2. Click Create L7 load balancer.

  3. Specify the load balancer name: test-load-balancer.

  4. Under Network settings, select the network containing the subnet where you want to place your load balancer node.

  5. Under Allocation, select a subnet in your preferred availability zone and configure it to enable incoming traffic.

    Remove other availability zones by clicking in each zone’s row.

  6. Under Listeners, click Add listener and specify listener settings:

    1. Specify the listener name: test-listener.
    2. Under Public IP address, enable traffic.
    3. Specify the 80 port.
    4. Select the Automatically type.
  7. In the HTTP router field, select test-http-router.

  8. Click Create.

  1. Create a load balancer and its backend node in the same subnet:

    yc alb load-balancer create test-load-balancer \
      --network-name <network_name> \
      --location subnet-name=<subnet_name_in_ru-central1-a_zone>,zone=ru-central1-a
    
  2. Add a listener:

    yc alb load-balancer add-listener test-load-balancer \
      --listener-name test-listener \
      --http-router-id <HTTP_router_ID> \
      --external-ipv4-endpoint port=80
    

Test the load balancerTest the load balancer

In the terminal, run this command:

curl --verbose <load_balancer_public_IP_address>:80

The response must return HTTP 200 with an HTML list of test VM web root subdirectories.

Next, you can expand your target group by adding more VMs, create additional application backends, and set up routes to their endpoints.

How to delete the resources you createdHow to delete the resources you created

To stop paying for the resources you created, delete them in the following order:

Management console
  1. Delete the test-load-balancer L7 load balancer.
  2. Delete the test-http-router HTTP router.
  3. Delete the test-backend-group backend group.
  4. Delete the test-target-group target group.

Was the article helpful?

Next
All guides
Yandex project
© 2025 Yandex.Cloud LLC