Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud CDN
  • Getting started
    • All tutorials
    • Publishing game updates
    • Editing website images with Thumbor
    • Integrating an L7 load balancer with CDN and Object Storage
    • Blue-green and canary deployment of service versions
    • Migrating to Yandex Cloud CDN from a third-party CDN provider
    • Setting up static website hosting in a Yandex Object Storage bucket with Yandex Cloud CDN access
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics for the EdgeCDN provider
  • Monitoring metrics for the Yandex Cloud CDN provider
  • Audit Trails events
  • Release notes
  • Troubleshooting

In this article:

  • Getting started
  • Required paid resources
  • Add a certificate to Certificate Manager
  • Create a bucket in Object Storage and upload your website files to it
  • Set up static website hosting
  • Create a CDN resource
  • Configure DNS for the CDN resource
  • Test the CDN
  • How to delete the resources you created
  1. Tutorials
  2. Setting up static website hosting in a Yandex Object Storage bucket with Yandex Cloud CDN access

Setting up static website hosting in a Yandex Object Storage bucket with Yandex Cloud CDN access

Written by
Yandex Cloud
Updated at August 26, 2025
  • Getting started
    • Required paid resources
  • Add a certificate to Certificate Manager
  • Create a bucket in Object Storage and upload your website files to it
  • Set up static website hosting
  • Create a CDN resource
  • Configure DNS for the CDN resource
  • Test the CDN
  • How to delete the resources you created

In this tutorial, you will create a static website in a Yandex Object Storage bucket and publish it as a content origin in Yandex Cloud CDN. The connection between the client and the CDN server can use TLS 1.0 and TLS 1.1; the connection between the CDN server and Object Storage can use TLS 1.2 or higher. The website will be available via the domain name delegated in Yandex Cloud DNS, for which a TLS certificate will be issued in Yandex Certificate Manager. The website domain name will be mapped to the CDN resource using a CNAME record in DNS.

We will use the cdn.yandexcloud.example domain name as an example.

To set up static website hosting in a bucket with CDN access:

  1. Get your cloud ready.
  2. Add a certificate to Certificate Manager.
  3. Create a bucket in Object Storage and upload your website files to it.
  4. Set up static website hosting.
  5. Create a CDN resource.
  6. Configure DNS for the CDN resource.
  7. Test the CDN.

If you no longer need the resources you created, delete them.

Getting startedGetting started

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure.

Learn more about clouds and folders here.

Required paid resourcesRequired paid resources

The infrastructure support cost for a bucket-hosted site with CDN access includes:

  • Fee for CDN server outbound traffic (see Cloud CDN pricing).
  • Fee for data storage in Object Storage, data operations, and outbound traffic (see Object Storage pricing).
  • Fee for public DNS requests and DNS zones if using Yandex Cloud DNS (see Cloud DNS pricing).

Add a certificate to Certificate ManagerAdd a certificate to Certificate Manager

Certificates from Yandex Certificate Manager are supported. You can issue a new Let's Encrypt® certificate or upload one of your own.

The certificate must be located in the same folder as your CDN resource.

For a Let's Encrypt® certificate, pass an ownership check for the domain specified in the certificate.

Create a bucket in Object Storage and upload your website files to itCreate a bucket in Object Storage and upload your website files to it

Management console
  1. In the management console, select Object Storage.

  2. At the top right, click Create bucket.

  3. In the ** Name** field, enter a name for the bucket.

  4. Click Create bucket.

  5. Create a website home page file named index.html on your computer.

    Example of the index.html file
    <!DOCTYPE html>
    <html>
      <head>
        <title>My site</title>
      </head>
      <body>
        <p>The site is working</p>
      </body>
    </html>
    
  6. On the bucket page, click Upload and select index.html.

Set up static website hostingSet up static website hosting

Management console
  1. In the management console, select Object Storage from the list of services and go to the bucket you want to configure hosting for.
  2. In the left-hand panel, select Settings.
  3. Navigate to the General tab.
  4. In the Object read access and Object listing access fields, select Public.
  5. Click Save.
  6. Select the Website tab.
  7. Under Hosting:
    • In the Home page field, specify the absolute path to the file in the bucket for the website home page, e.g., index.html.

      Warning

      The key of the object containing your website homepage must not include the / character.

    • Optionally, in the Error page field, specify the absolute path to the file in the bucket to show for 4xx errors, e.g., pages/error404.html. By default, Object Storage returns its own page.

  8. Click Save.

Use the link in Link to check the hosting.

Create a CDN resourceCreate a CDN resource

Management console
  1. In the management console, select Cloud CDN.
  2. Click Create resource.
  3. 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 need from the list.

      • In the Origin request protocol field, select HTTP.

      • In the Domain name field, specify cdn.yandexcloud.example.

        Alert

        The cdn.yandexcloud.example domain name will become the primary one, and you will not be able to edit it after you create a CDN resource.

    • Under Additional settings:

      • In the Redirect clients field, select HTTP to HTTPS.
      • In the Certificate type field, specify Use from Certificate Manager and select a certificate for the cdn.yandexcloud.example domain name.
      • In the Host header field, select Custom and, in Header value, specify the origin domain name in <name_of_bucket_with_files>.website.yandexcloud.net format for the source bucket to respond to CDN server requests correctly.
  4. Click Continue.
  5. Under Caching, HTTP headers and methods, and Advanced, leave the default settings, then click Continue.

Configure DNS for the CDN resourceConfigure DNS for the CDN resource

The cdn.yandexcloud.example domain name must be mapped to the CDN using DNS records.

To configure DNS:

  1. Get the Cloud CDN provider domain name:

    Management console
    1. In the management console, select Cloud CDN.
    2. From the list of CDN resources, select the one with cdn.yandexcloud.example as its primary domain name.
    3. From DNS settings at the bottom of the page, copy the domain name in 328938ed********.a.yccdn.cloud.yandex.net or cl-msa87*****.edgecdn.ru format depending on your CDN provider.
  2. On the website of your DNS hosting provider, navigate to the DNS settings.

  3. Create or edit a CNAME record for cdn.yandexcloud.example so that it points to the domain name you copied:

    cdn CNAME 328938ed********.a.yccdn.cloud.yandex.net
    

    Note

    Do not use an 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.

    If you use Cloud DNS, follow this guide to configure the record:

    Configuring DNS records for Cloud DNS
    Management console
    1. In the management console, select Cloud DNS.

    2. If you do not have a public DNS zone, create one:

      1. Click Create zone.
      2. In the Zone field, enter the website domain name with a trailing dot: yandexcloud.example..
      3. In the Type field, select Public.
      4. In the Name field, specify example-dns-zone.
      5. Click Create.
    3. Create a CNAME record for cdn.yandexcloud.example in the zone:

      1. Select example-dns-zone.
      2. Click Create record.
      3. In the Name field, specify cdn.
      4. In the Type field, specify CNAME.
      5. In the Data field, paste the copied value in 328938ed********.a.yccdn.cloud.yandex.net. or cl-msa87*****.edgecdn.ru. format (depending on your CDN provider) with a trailing dot.
      6. Click Create.

Test the CDNTest the CDN

Check your website for availability:

  1. Wait for the DNS records to get updated (this may take several hours) and for the files to be prefetched to the CDN servers.

  2. Open your website at the new URL:

    https://cdn.example.com
    

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

To shut down the infrastructure and stop paying for the resources you created:

  1. Delete the DNS zone named example-dns-zone if you created it in Cloud DNS.
  2. Delete the CDN resource with cdn.yandexcloud.example as its primary domain name.
  3. Delete all objects from the bucket.
  4. Delete the bucket.

Was the article helpful?

Previous
Migrating to Yandex Cloud CDN from a third-party CDN provider
Next
Overview
© 2025 Direct Cursus Technology L.L.C.