---
title: How to create and deploy a container with the Scaleway API
description: Deploy containers using the Scaleway API.
tags: containers api deploy
dates:
  validation: 2025-09-17
  posted: 2021-08-18
---
import Requirements from '@macros/iam/requirements.mdx'


The Scaleway API allows you to create and manage all your Scaleway resources programmatically. Anything you can do through the [Scaleway console](https://www.console.scaleway.com) can also be done through the API.

Refer to the [Scaleway Developers website](https://www.scaleway.com/en/developers/api/) for more information on the Scaleway API.

<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
- A valid [API key](/iam/how-to/create-api-keys/)
- Installed [curl](https://curl.se/download.html)
- Made your first [request](https://www.scaleway.com/en/developers/api/#quickstart:-first-request) using the Scaleway API

1. Run the following command in your terminal to create a containers namespace:

    ```bash
    curl -X POST \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "<YOUR_NAMESPACE_NAME>",
        "project_id": "YOUR_PROJECT_ID"
    }' \
    "https://api.scaleway.com/containers/v1beta1/regions/fr-par/namespaces"
    ```

    An output similar to the following displays:

    ```json
    {"id":"example-fb93-43e3-a036-7be69f1af7a1", "name":"your-namespace-name", "environment_variables":{}, "organization_id":"example-776f-4f65-a41e-6c5fc58b4076", "project_id":"example-c162-43f7-bb3e-1182e6f12342", "status":"pending", "registry_namespace_id":"", "error_message":null, "registry_endpoint":"", "description":"", "secret_environment_variables":[], "region":"fr-par"}%
    ```

2. Run the following command to create a container:

    ```bash
    curl -X POST \
    -H "X-Auth-Token: $SCW_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "<YOUR_CONTAINER_NAME>",
      "namespace_id": "<YOUR_NAMESPACE_ID>",
      "registry_image": "<YOUR_REGISTRY_IMAGE>:<TAG>"
    }' \
    "https://api.scaleway.com/containers/v1beta1/regions/fr-par/containers"
    ```

    An output similar to the following displays:

    ```json
    {"id":"example-f150-4c7d-a226-ae201f4a5024","name":"example","namespace_id":"example-50e9-4553-afa0-3b0e6bac0d19","status":"created","environment_variables":{},"min_scale":0,"max_scale":5,"memory_limit":2048,"cpu_limit":1000,"timeout":"300s","error_message":null,"privacy":"public","description":"","registry_image":"rg.fr-par.scw.cloud/funcscwexample/example_image:latest","max_concurrency":50,"domain_name":"funcscwexample.functions.fnc.fr-par.scw.cloud","protocol":"http1","port":8080,"secret_environment_variables":[],"http_option":"enabled","sandbox":"v2","local_storage_limit":1000,"scaling_option":{"concurrent_requests_threshold":50},"created_at":"2025-03-13T14:53:49.753864618Z","updated_at":"2025-03-13T14:53:49.753864618Z","ready_at":null,"health_check":{"failure_threshold":30,"interval":"10s","tcp":{}},"region":"fr-par"}
    ```

    <Message type="note">
      For testing purposes, you can use the `"registry_image": "nginx:latest"` and `"port": "80"` parameters to quickly create a container.
    </Message>

3. Run the following command to deploy your container:

    ```bash
    curl -X POST \
      -H "X-Auth-Token: $SCW_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{}' \
      "https://api.scaleway.com/containers/v1beta1/regions/fr-par/containers/<YOUR_CONTAINER_ID>/deploy"
    ```
    The deployment process can take several minutes, depending on the image used.
4. Run the following command to call your container once it is deployed:

    ```bash
    curl <YOUR_CONTAINER_ENDPOINT>
    ```

    Your container is now deployed and ready to use.