[Yandex Cloud documentation](../../index.md) > [Yandex Cloud CDN](../index.md) > [Getting started](index.md) > Creating a CDN resource with an origin bucket

# Creating a CDN resource with an Yandex Object Storage origin bucket



{% note warning %}

Starting July 1, 2026, a new pricing model for Cloud CDN is in effect. For more information, see [Yandex Cloud CDN pricing policy](../pricing.md).

{% endnote %}


{% note info %}

For details on creating an origin group and a CDN resource with other origin types, see these guides:
  
* [Creating a resource](../operations/resources/create-resource.md)
* [Creating an origin group](../operations/origin-groups/create-group.md)

{% endnote %}

Set up content distribution over a CDN with an Object Storage [bucket](../../storage/concepts/bucket.md) as the origin:

1. [Create a CDN resource](#create-cdn-resource).
1. [Configure a CNAME for your domain](#setup-cname).
1. [Test the CDN](#check-cdn-working).

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

1. Make sure you have a domain name and can access the DNS settings on your DNS hosting provider’s website. This is usually the company that registered your domain.
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud, or sign up if you have not already.
1. If you do not have a folder yet, [create](../../resource-manager/operations/folder/create.md) one.

    {% cut "Learn more about creating a folder" %}

    1. In the [management console](https://console.yandex.cloud), in the top panel, click ![image](../../_assets/console-icons/layout-side-content-left.svg) or ![image](../../_assets/console-icons/chevron-down.svg) and select the [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud).
    1. To the right of the cloud name, click ![image](../../_assets/console-icons/ellipsis.svg).
    1. Select ![image](../../_assets/console-icons/plus.svg) **Create folder**.
    
       ![create-folder1](../../_assets/resource-manager/create-folder-1.png)
    
    1. Give your [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) a name. The naming requirements are as follows:
    
        * Length: between 3 and 63 characters.
        * It can only contain lowercase Latin letters, numbers, and hyphens.
        * It must start with a letter and cannot end with a hyphen.
    
    1. Optionally, specify the description for your folder.
    1. Select **Create a default network**. This will create a [network](../../vpc/concepts/network.md#network) with subnets in each availability zone. Within this network, you will also have a [default security group](../../vpc/concepts/security-groups.md#default-security-group), within which all network traffic will be allowed.
    1. Click **Create**.
    
       ![create-folder2](../../_assets/resource-manager/create-folder-2.png)

    {% endcut %}

1. If you do not have an Object Storage bucket yet:

   1. [Create a bucket](../../storage/operations/buckets/create.md).
   1. [Enable public access](../../storage/operations/buckets/bucket-availability.md) to the objects in the bucket and the object list.
   1. [Upload your content](../../storage/operations/objects/upload.md) to the bucket.
      
## Create a CDN resource {#create-cdn-resource}

1. Navigate to **Cloud CDN**.
1. In the ![image](../../_assets/console-icons/nodes-right.svg) **CDN resources** tab, click **Create resource**.
1. Under **Main settings**, configure the basic CDN resource settings:
   * Under **Content**:
      * Enable **Enable access to content**.
      * In the **Content query** field, select `From one origin`.
      * In the **Origin type** field, select `Bucket`.
      * In the **Bucket** field, select the bucket you created in Object Storage.
      * In the **Origin request protocol** field, select `HTTP`.
      * In the **Domain name** field, specify the primary domain name you will use in your website links to CDN-hosted content, e.g., `cdn.example.com`.

         {% note alert %}

         You cannot change the primary domain name used for content distribution after creating a CDN resource.

         {% endnote %}

   * Under **Additional settings**:
      * In the **Redirect clients** field, select `Don't use`.
      * In the **Certificate type** field, select `Don't use`.
      * In the **Host header** field, select `Custom`.
      * In the **Header value** field, specify the domain name from the [bucket URL](../../storage/concepts/bucket.md#bucket-url) in `<bucket_name>.storage.yandexcloud.net` format, omitting the schema (`http` or `https`). Here is an example:

         ```
         my-bucket.storage.yandexcloud.net
         ```

         {% note warning %}

         If the `Host` header is misconfigured, Object Storage will return errors in response to CDN server requests.

         {% endnote %}

1. Click **Continue**.
1. Under **Caching**, **HTTP headers and methods**, and **Advanced**, leave the default settings, then click **Continue**. You can configure these settings later, if required.

Wait until the resource is created. It may take up to 15 minutes.

{% note tip %}

We recommend [prefetching](../operations/resources/prefetch-files.md) large files (over 200 MB) into the CDN server [cache](../concepts/caching.md). This is an optional step. If skipped, such content will be automatically cached on [CDN servers](../concepts/points-of-presence.md) when first accessed by the end user.

{% endnote %}

## Configure a CNAME for your domain {#setup-cname}

1. In the ![image](../../_assets/console-icons/flag.svg) **Overview** tab on the CDN resource page, under **DNS settings**, copy the generated domain name in `e1b83ae3********.topology.gslb.yccdn.ru` format.
1. Navigate to your domain’s DNS settings on your DNS hosting provider’s website.
1. Edit the relevant CNAME record so that it points to the previously copied URL in the `.topology.gslb.yccdn.ru` domain. For example, if the content delivery domain name you specified when creating your CDN resource is `cdn.example.com`, you need to create the following CNAME record or use it to replace the current record for `cdn`:

    ```http
    cdn CNAME e1b83ae3********.topology.gslb.yccdn.ru.
    ```

    {% note info %}
    
    Do not use an [ANAME](../../dns/concepts/resource-record.md#aname) resource record with domain names for content distribution; otherwise, the end user will get a response from a CDN server not linked to the user geolocation. The response will always be the same for all users.
    
    {% endnote %}

## Test the CDN {#check-cdn-working}

1. Wait for the DNS records to update. This may take a few hours.
1. Make sure the `cdn` CNAME record in the DNS server's cache points to the generated URL, e.g., `e1b83ae3********.topology.gslb.yccdn.ru`.
1. Open the website in your browser to make sure it is working. Here is an example:

    ```http
    http://cdn.example.com/index.html
    ```

#### Useful links {#see-also}

* [Creating a CDN resource with an origin server in Yandex Cloud](server.md)
* [Yandex Cloud CDN overview](../concepts/index.md)
* [Creating a bucket](../../storage/operations/buckets/create.md)
* [Webinar: Reducing load on high-traffic infrastructure with Cloud CDN](https://yandex.cloud/ru/events/1489?utm_source=docs&utm_medium=yandex&utm_campaign=infra&utm_content=vebinar&utm_term=cdns3)