---
title: Deploying an Elastic Metal server with one API call
description: Learn how to deploy a Scaleway Elastic Metal server on your favorite OS with a single API command.
tags: baremetal elastic metal cloud server dedicated elastic-metal api-call
dates:
  validation: 2025-07-15
  posted: 2021-05-26
---
import Requirements from '@macros/iam/requirements.mdx'


Scaleway's [Elastic Metal servers](https://www.scaleway.com/en/elastic-metal/) provide 100% dedicated resources while offering the flexibility and scalability of the cloud, including hourly billing and full customization. The hardware is entirely dedicated to you — free from virtualization, overallocation, or neighboring tenants.

Elastic Metal servers also feature a robust [REST API](https://www.scaleway.com/en/developers/api/elastic-metal/) that enables seamless automation of tasks and deployments. Integration with tools like [Terraform](https://www.terraform.io/) or [OpenTofu](https://opentofu.org/) further streamlines infrastructure management.

The **one-command deployment feature** accelerates server provisioning by combining delivery and setup into a single API call. This simplifies server provisioning, ensuring your machine is fully operational in less than 15 minutes.

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- An [SSH key](/organizations-and-projects/how-to/create-ssh-key/)
- A valid [API key](/iam/how-to/create-api-keys/)

## Deploying Elastic Metal servers using the API

Besides creating your Elastic Metal servers from the graphical [Scaleway console](/elastic-metal/how-to/create-server/), you can also create and manage them directly from the command line using the [CLI-tool](https://github.com/scaleway/scaleway-cli) or the [API](https://www.scaleway.com/en/developers/api/elastic-metal/).

<Message type="note">
  You need to [generate API keys](/iam/how-to/create-api-keys/) to access the Scaleway API.
</Message>

1. Open a terminal on your computer and set your secret API key, your SSH key ID, and your Project ID as variables.
    ```bash
    export SCW_SECRET_KEY="<Your secret key>"
    export SCW_SSH_KEY="<Your SSH key ID>"
    export SCW_PROJECT_ID="<Your Project ID>"
    ```
2. Retrieve a list of all operating systems available in the desired Availability Zone.
    ```bash
    curl https://api.scaleway.com/baremetal/v1/zones/fr-par-2/offers -H "X-Auth-Token: $SCW_SECRET_KEY" | jq . | grep "EM-"
    ```

    A list of all available offers displays. Take note of the ID of the offer you want to deploy, as you need it in a later step.

    ```
      "name": "EM-A210R-SATA",
      "name": "EM-L101X-SATA",
      "name": "EM-A410X-SSD",
      "name": "EM-B111X-SATA",
      "name": "EM-B112X-SSD",
      "name": "EM-B211X-SATA",
      "name": "EM-B212X-SSD",
      "name": "EM-L110X-SATA",
      "name": "EM-B311X-SATA",
      "name": "EM-B312X-SSD",
      "name": "EM-T210E-NVME",
      "name": "EM-T510X-NVME",
    ```
3. Retrieve a list of all available operating systems available in the desired Availability Zone (in our case, `fr-par-2`).
    ```
    curl https://api.scaleway.com/baremetal/v1/zones/fr-par-2/os -H "X-Auth-Token: $SCW_SECRET_KEY" | jq .
    ```

    You will receive a JSON-formatted list of all operating systems available, and their associated ID. Take note of the ID of the image you want to install:

    ```json
    {
      "total_count": 8,
      "os": [
        {
          "id": "03b7f4ba-a6a1-4305-984e-b54fafbf1681",
          "name": "Ubuntu",
          "version": "20.04"
        },
        {
          "id": "60f5d1e3-fa69-45af-9fc0-c9e3c114dd09",
          "name": "Ubuntu",
          "version": "19.10"
        },
        [...]
      ]
    }
    ```
4. Create the Elastic Metal server from the API using cURL and the `POST` command on the endpoint `/baremetal/v1/zones/fr-par-2/servers`:

    The syntax to [create the server](https://www.scaleway.com/en/developers/api/elastic-metal/#path-servers-create-an-elastic-metal-server) is as follows:
    ```json
    {
      "offer_id": "<OFFER_ID>",
      "project_id": "$SCW_SECRET_KEY",
      "name": "<SERVER_NAME>",
      "description": "<SERVER_DESCRIPTION>",
      "tags": [
          "<SERVER_TAGS>"
      ],
      "install": {
          "os_id": "<OS_ID>",
          "hostname": "<SERVER_HOSTNAME>",
          "ssh_key_ids": [
          "<SSH_KEY_ID>"
          ]
      }
    }
    ```

    In the following example, we create a server running on Ubuntu 20.04 LTS:

    ```json
    curl -X POST \
      -H "X-Auth-Token: $SCW_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "offer_id": "7fde3890-9787-488c-ac89-c4e00a4e5f83",
        "project_id": "$SCW_PROJECT",
        "name": "my-bmaas",
        "description": "my server running on ubuntu",
        "tags": ["bmaas", "tutorial"],
        "install": {
          "os_id": "03b7f4ba-a6a1-4305-984e-b54fafbf1681",
          "hostname": "my-bmaas-api",
          "ssh_key_ids": ["$SSH_KEY_ID"]
        }
      }' \
      https://api.scaleway.com/baremetal/v1/zones/fr-par-2/servers | jq .
    ```

    Again, the API returns a JSON output informing you about the server creation:

    ```json
    {
    "id": "<SERVER_ID>",
    "organization_id": "<ORGANIZATION_ID>",
    "name": "my-bmaas",
    "description": "my server running on ubuntu",
    "updated_at": "2020-10-05T13:37:02.136789208Z",
    "created_at": "2020-10-05T13:37:02.136789208Z",
    "status": "delivering",
    "offer_id": "7fde3890-9787-488c-ac89-c4e00a4e5f83",
    "install": {
        "os_id": "03b7f4ba-a6a1-4305-984e-b54fafbf1681",
        "hostname": "my-bmaas-api",
        "ssh_key_ids": [
        "<SSH_KEY_ID>"
        ],
        "status": "to_install"
    },
    "tags": [
        "bmaas, tutorial"
    ],
    "ips": [],
    "domain": "",
    "boot_type": "normal",
    "ping_status": "ping_status_unknown",
    "project_id": "<PROJECT_ID>",
    "zone": "fr-par-2"
    }
    ```
5. The server is being delivered to your account and is automatically being installed on the operating system chosen. You can retrieve the status of the installation using the following API call:
    ```bash
    curl https://api.scaleway.com/baremetal/v1/zones/fr-par-2/servers/{server_id} -H "X-Auth-Token: $SCW_SECRET_KEY" | jq .
    ```

    Your new Elastic Metal server will be installed and ready to be used in usually less than **15 minutes**, all API features are listed in the [API documentation](https://www.scaleway.com/en/developers/api/elastic-metal/).

For more information about Elastic Metal servers, refer to our [dedicated product documentation](/elastic-metal/) and the [FAQ](/elastic-metal/faq/).