[Yandex Cloud documentation](../index.md) > [Yandex BareMetal](index.md) > Getting started > Leasing a stock configuration server

# Getting started with Yandex BareMetal

Lease your first [physical server](concepts/servers.md) and connect to it. All the leased server's resources are exclusively yours, thus providing better performance than an equivalent virtual machine.

## Getting started {#before-you-begin}

Sign up for Yandex Cloud and create a [billing account](../billing/concepts/billing-account.md):
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or create a new account.
1. On the **[Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts)** page, make sure you have a billing account linked and it has the `ACTIVE` or `TRIAL_ACTIVE` [status](../billing/concepts/billing-account-statuses.md). If you do not have a billing account, [create one](../billing/quickstart/index.md) and [link](../billing/operations/pin-cloud.md) a cloud to it.

If you have an active billing account, you can create or select a [folder](../resource-manager/concepts/resources-hierarchy.md#folder) for your infrastructure on the [cloud page](https://console.yandex.cloud/cloud).

[Learn more about clouds and folders here](../resource-manager/concepts/resources-hierarchy.md).

## Renting a server {#server-lease}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../resource-manager/concepts/resources-hierarchy.md#folder) where you want to lease a server.
  1. Navigate to **BareMetal**.
  1. Click **Lease server** and, in the window that opens, select `Stock configurations` and a suitable [configuration](concepts/server-configurations.md) for your BareMetal server, e.g., `BA-i103-S-10G`.

      To select the suitable server configuration, click the section with its name in the central part of the screen.
      
      {% note info %}
      
      To quickly find the right configuration, you can use the filter with the hardware characteristics of the configurations on the right side of the screen.
      
      {% endnote %}

      {% note tip %}
      
      You can reduce the cost of renting a server in some configurations by ordering server [assembly](concepts/server-custom-configurations.md#assembly).
      
      To use the discount, hover over **Cheaper with assembly** ![circle-info.svg](../_assets/console-icons/circle-info.svg) under the configuration at hand and click ![person-nut-hex.svg](../_assets/console-icons/person-nut-hex.svg) **Go to assembly** in the pop-up window.
      
      When ordering a server with assembly, follow the steps below to configure the server properties. In this case, the server will not be available immediately, but only after the assembly is completed (within four calendar days), and at a lower price.
      
      {% endnote %}

  1. In the server configuration window that opens:

      1. Under **Configuration**, **Location**, and **Lease conditions**, make sure the server configuration you have provided so far is adequate.
         
         If not, click ![arrow-left](../_assets/console-icons/arrow-left.svg) under **Configuration** to return to configuration setup.
      1. In the **Lease duration** field, select the server [lease period](concepts/servers.md#server-lease).

          {% note tip %}

          For initial testing, you can lease a server only for one day or one month. Should you need more time, your server lease will automatically renew for the same period.

          {% endnote %}
      1. In the **Number of servers** field, keep `1`.
      1. Under **Image**, select `Marketplace` and an image running `Ubuntu 24.04 LTS`.
      1. Under **Disk**, click **Configure disk layout** to configure partitions for the server [disks](concepts/disks/disk-types.md).

          In the window that opens, leave the default disk partitioning settings or edit them, then click **Save**.
      1. Under **Network interfaces**, in the **Interface 1** section, select a [private subnet](concepts/private-network.md#private-subnet) in the [availability zone](../overview/concepts/geo-scope.md) you are renting the server in.
         
         If the server’s availability zone does not have a private subnet yet, or you want to create a new private subnet, click **Create** and, in the window that opens, specify subnet settings as described in [Creating a private subnet](operations/subnet-create.md).
      1. Under **Network interfaces**, set the **Public address** field to `From ephemeral subnet` in the **Interface 2** section.
      1. Under **Access**:

          1. In the **Password** field, select one of the following options to create a root password:
          
              * To generate a new root password, select `New password` and click **Generate**.
          
                  {% note warning %}
                  
                  This option requires you to maintain password security. Save the password you generated in a secure location. Yandex Cloud does not store it, and you will not be able to retrieve it once the server is deployed.
                  
                  {% endnote %}
          
              * To use the root password saved in a Yandex Lockbox [secret](../lockbox/concepts/secret.md), select `Lockbox secret`.
          
                  In the **Name**, **Version**, and **Key** fields, select the secret containing your password, its version, and its key, respectively.
                  
                  If you do not have a Yandex Lockbox secret, click **Create** to create it.
          
                  Choose the `Custom` secret type to specify a custom password or `Generated` to generate password automatically.
          
          1. In the **Public SSH key** field, select the SSH key saved in your [organization user](../organization/concepts/membership.md) profile.
          
              If there are no SSH keys in your profile or you want to add a new key:
              
              1. Click **Add key**.
              1. Enter a name for the SSH key.
              1. Select one of the following:
              
                  * `Enter manually`: Paste the contents of the public SSH key. You need to [create](../compute/operations/vm-connect/ssh.md#creating-ssh-keys) an SSH key pair on your own.
                  * `Load from file`: Upload the public part of the SSH key. You need to create an SSH key pair on your own.
                  * `Generate key`: Automatically create an SSH key pair.
                  
                    When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the `/home/<user_name>/.ssh` directory. In Windows, unpack the archive to the `C:\Users\<user_name>/.ssh` directory. You do not need additionally enter the public key in the management console.
              
              1. Click **Add**.
              
              The system will add the SSH key to your organization user profile. If the organization has [disabled](../organization/operations/os-login-access.md) the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

      1. Under **Server information**, enter the server **Name**: `bm-server`.
      1. Click **Lease server**.

{% endlist %}

## Connect to the server {#server-connect}

{% list tabs group=operating_system %}

- KVM console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing your server.
  1. Navigate to **BareMetal**.
  1. Find the server you need in the list, click ![image](../_assets/console-icons/ellipsis.svg) in its row, and select **KVM console**.

- Linux/macOS {#linux-macos}

  To establish a server connection, specify the server public IP address which you can get using the management console, in the **Public IP address** field under **Network interfaces** on the server page.

  In the terminal, run this command:

  ```bash
  ssh root@<server_public_IP_address>
  ```

  If this is your first time connecting to the server, you will get this unknown host warning:

  ```text
  The authenticity of host '51.250.83.243 (51.250.83.243)' can't be established.
  ED25519 key fingerprint is SHA256:6Mjv93NJDCaf/vu3NYwiLQK4tKI+4cfLtkd********.
  This key is not known by any other names.
  Are you sure you want to continue connecting (yes/no/[fingerprint])?
  ```

  Type `yes` into the terminal and press **Enter**.

- Windows 10/11 {#windows}

  To establish a server connection, specify its public IP address which you can get using the management console, in the **Public IP address** field under **Network interfaces** on the server page.

  Make sure the Windows account has read access to the key folder.

  To connect to the server, run the following command in the command line:

  ```shell
  ssh root@<server_public_IP_address>
  ```

  If this is your first time connecting to the server, you will get this unknown host warning:

  ```text
  The authenticity of host '89.169.132.223 (89.169.132.223)' can't be established.
  ECDSA key fingerprint is SHA256:DfjfFB+in0q0MGi0HnqLNMdHssLfm1yRanB********.
  Are you sure you want to continue connecting (yes/no/[fingerprint])?
  ```

  Type `yes` in the command line and press **Enter**.

- Windows 7/8 {#windows7-8}

  To establish a server connection, specify the server public IP address which you can get using the management console, in the **Public IP address** field under **Network interfaces** on the server page.

  Establish a connection using PuTTY:

  1. Run Pageant.
     1. Right-click the Pageant icon in the task bar.
     1. In the context menu, select **Add key**.
     1. Select a PuTTY-generated private key in `.ppk` format. Enter the password for this key, if it is set.
  1. Run PuTTY.
     1. In the **Host Name (or IP address)** field, enter the public IP address of the server you want to connect to. Set the port to `22` and the connection type to **SSH**.

        ![ssh_add_ip](../_assets/compute/ssh-putty/ssh_add_ip.png)

     1. In the tree on the left, select **Connection** → **SSH** → **Auth**.
     1. Enable **Allow agent forwarding**.

        ![ssh_choose_private_key](../_assets/compute/ssh-putty/authentication_parameters.png)

     1. In the tree on the left, select **Connection** → **SSH** → **Auth** → **Credentials**.
     1. In the **Private key file for authentication** field, select the private key file.

        ![ssh_choose_private_key](../_assets/compute/ssh-putty/ssh_choose_private_key.png)

     1. Go back to the **Sessions** menu. In the **Saved sessions** field, enter any name for the session and click **Save**. This will save the session settings under the specified name. You can use this session profile to connect with Pageant.

        ![ssh_save_session](../_assets/compute/ssh-putty/ssh_save_session.png)

     1. Click **Open**. If this is your first time connecting to the server, you may get this unknown host warning:

        ![ssh_unknown_host_warning](../_assets/compute/ssh-putty/ssh_unknown_host_warning.png)

        Click **Accept**. This will open a terminal window prompting you to enter the username to use for connection. Enter the `root` username.

        If everything is configured correctly, a connection to the server will be established.

        ![ssh_login](../_assets/compute/ssh-putty/ssh_login.png)

  If you saved the session profile in PuTTY, you can use Pageant for future connections:

  1. Right-click the Pageant icon in the task bar.
  1. Select **Saved sessions**.
  1. In the saved sessions list, select the session you need.

{% endlist %}