---
title: "CDN: Quick Start"
sidebar_label: "Quick start"
description: "How to get started with CDN: create a CDN resource, add a personal domain, and check CDN performance"
sidebar_position: 2
---

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import Formbricks from '@theme/MDXComponents/Formbricks'
import LinkIcon from '@selectel/docux/icons/link'
import AddCnameInDnsHosting from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cdn/add-cname-in-dns-hosting.mdx'
import AddPersonalDomainToControlPanel from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cdn/add-personal-domain-to-control-panel.mdx'
import AddSslCertificate from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cdn/add-ssl-certificate.mdx'

# CDN: Quick start

You can manage CDN in the [control panel](https://my.selectel.ru/cdn-v3).

1. [Create a CDN resource](#create-resource).

2. Optional: [add a personal domain to the CDN resource](#add-personal-domain).

3. If your website runs on WordPress, [integrate CDN and WordPress](#integrate-cdn-to-wordpress).

4. [Check CDN resource performance](#check-cdn-resource).

## 1. Create a CDN resource \{#create-resource}

A CDN resource is a set of settings that determine how content is fetched from the origin to CDN servers and delivered from CDN servers to end users.

The content origin is the location from which the CDN will request files. You can specify:

* your own origin;
* or an [S3](/s3/) bucket.

<Tabs queryString="create-resource">
  <TabItem value="own-source">
    <TabItemLabel>
      Own origin
    </TabItemLabel>

    1. Make sure you have [topped up your balance](/balance-and-payments/manage/top-up-balance.mdx) with at least 550 ₽.

    2. In the [control panel](https://my.selectel.ru/cdn-v3), on the top menu, click **Products** and select **CDN**.

    3. Click **Create CDN resource**.

    4. Select the content delivery optimization type. You can [change the optimization type](/cdn/content/content-delivery-optimization.mdx#change-optimization-type) after the CDN resource is created.

       * Static — suitable for delivering small files: images, video and audio files, text formats;
       * or Large files — suitable for delivering large files without quality loss, for example, videos. Files are cached and delivered in parts (slices) using HTTP Range requests. By default, the slice size is 16 MB. You can [change the slice size](/cdn/content/content-delivery-optimization.mdx#change-slice-size) after the CDN resource is created.

    5. In the **Address** field, enter the domain or IP address of your website.

    6. Click **Create**.When you create a CDN resource, a default domain is generated automatically.The files to be distributed by the CDN server will be accessible via a link like `*.selcdn.net`.You can keep the default domain or [add a custom domain](#add-personal-domain).
  </TabItem>

  <TabItem value="s3">
    <TabItemLabel>
      S3
    </TabItemLabel>

    1. Make sure you have [topped up your balance](/balance-and-payments/manage/top-up-balance.mdx) with at least 550 ₽.

    2. If you do not have a bucket in S3 Selectel yet, create a public bucket and upload files to it following the [S3: Quick Start](/s3/quickstart.mdx) guide.

    3. In the [control panel](https://my.selectel.ru/cdn-v3), on the top menu, click **Products** and select **CDN**.

    4. Click **Create CDN resource**.

    5. Select the content delivery optimization type. You can [change the optimization type](/cdn/content/content-delivery-optimization.mdx#change-optimization-type) after the CDN resource is created.

       * Static — suitable for delivering small files: images, video and audio files, text formats;
       * or Large files — suitable for delivering large files without quality loss, for example, videos. Files are cached and delivered in parts (slices) using HTTP Range requests. By default, the slice size is 16 MB. You can [change the slice size](/cdn/content/content-delivery-optimization.mdx#change-slice-size) after the CDN resource is created.

    6. In the **Address** block, enter the public bucket address in the format `*.selstorage.ru` without the protocol.You can find the bucket address in the [Control Panel](https://my.selectel.ru/storage/): in the top menu, click **Products** → **S3** → select a project → **Buckets** section → bucket page → **Domains** tab → **Primary domain**.

    7. Click **Create**.When you create a CDN resource, a default domain will be generated automatically.The files to be distributed by the CDN server will be accessible via a link like `*.selcdn.net`.You can keep the default domain or [add a custom domain](#add-personal-domain).

    8. Open the created CDN resource page → **Origin** tab.

    9. In the **Hostname** block, in the **Origin host header** field, enter the value you added in step 5.
  </TabItem>
</Tabs>

## 2. Optional: add a personal domain to the CDN resource \{#add-personal-domain}

We recommend distributing content through a personal domain. Using a third-party domain can make website promotion difficult and affect your search engine ranking.

1. [Register a domain](#register-domain).
2. [Create a CNAME record in DNS hosting](#add-cname-in-dns-hosting).
3. [Add a personal domain in the control panel](#add-personal-domain-to-control-panel).
4. [Add an SSL certificate to the CDN resource](#add-ssl-certificate).
5. [Replace the domain in website links](#change-domain-in-links-on-website).

### 1. Register the domain \{#register-domain}

If you do not have a domain you want to use as a personal one yet, register it. You can [register a domain](/domains/register-domain.mdx) at Selectel.

If you already have a domain, go to [stage 2](#add-cname-in-dns-hosting).

### 2. Create a CNAME record in DNS hosting \{#add-cname-in-dns-hosting}

<AddCnameInDnsHosting />

### 3. Add a personal domain in the control panel \{#add-personal-domain-to-control-panel}

<AddPersonalDomainToControlPanel />

### 4. Add an SSL certificate to the CDN resource \{#add-ssl-certificate}

<AddSslCertificate />

### 5. Replace the domain in links on your website \{#change-domain-in-links-on-website}

If your website runs on WordPress, proceed to [integrating CDN and WordPress](#integrate-cdn-to-wordpress).

If when [creating a resource at stage 1](#create-resource) you selected your own content origin, replace the domain in the static file URLs on your website with a personal domain like `cdn.example.com`, which you specified in step 3 when [creating a CNAME record at stage 2](#add-cname-in-dns-hosting).

## 3. Integrate CDN and WordPress \{#integrate-cdn-to-wordpress}

If your website does not run on WordPress, go to [checking CDN resource operation](#check-cdn-resource).

1. Go to the WordPress admin console.

2. On the left menu, go to the **Plugins** section.

3. In the search bar, enter the plugin name — `W3 Total Cache`.

4. In the search results in the W3 Total Cache plugin card, click **Install Now** → **Activate**.

5. On the left menu, go to the **Performance** → **General Settings** section.

6. In the **CDN** block, select the **Enable** checkbox.

7. In the **CDN** block, in the **CDN Type** field, select **Generic Mirror**.

8. In the **CDN** block, click **Save all settings**.

9. On the left menu, go to the **Performance** → **CDN** section.

10. In the **Configuration** block, in the **SSL support** field, select **Auto (determine connection type automatically)**.

11. In the **Configuration** block, in the **Replace site's hostname with** field, enter the CDN resource domain:

    * if you did not add a personal domain to the CDN resource, specify the default domain that was automatically created when [creating the resource](#create-resource);
    * if you [added a personal domain to the CDN resource](#add-personal-domain), specify it.

    You can view the default domain and personal domain in the [control panel](https://my.selectel.ru/cdn-v3/default/resources): on the top menu, click **Products** → **CDN** → **CDN resources** section → resource line.

12. Click **Save all settings**.

## 4. Check the CDN resource \{#check-cdn-resource}

<Tabs queryString="create-cdn-resource">
  <TabItem value="own-source">
    <TabItemLabel>
      Own origin
    </TabItemLabel>

    1. Wait for the CDN resource to start working and transition to the `ACTIVE` status.

    2. Open the file that the CDN should deliver using the link on your website. Example link: `example.com/images/image.png`.If the file does not open, verify that your website is working correctly.

    3. Open the file via the default domain using the link. Example link: `*.selcdn.net/images/image.png`.If the file does not open, check your CDN resource settings and the [Host header](/cdn/source/manage-host-header.mdx).

    4. If you [added a custom domain in step 2](#add-personal-domain), open the file via the custom domain using the link. Example link: `cdn.example.com/images/image.png`.If the file does not open, check the correctness of the CNAME record you [created in step 2](#add-cname-in-dns-hosting).
  </TabItem>

  <TabItem value="s3">
    <TabItemLabel>
      S3
    </TabItemLabel>

    1. Wait for the CDN resource to start working and transition to the `ACTIVE` status.

    2. Open the object directly through storage: in the [Control Panel](https://my.selectel.ru/storage/containers), in the top menu, click **Products** → **S3** → **Buckets** section → bucket page.In the row for any object, click the <LinkIcon /> and follow the link in the **Primary domain** block.If the object does not open, there may be access issues. For example, the bucket type might have been changed to private, or the object may have been deleted.

    3. Open the object via the default domain using the link. Example link: `*.selcdn.net/images/image.png`.If the object does not open, try again after some time.If the error persists, [clear the cache](/cdn/content/cleanup-cache.mdx) and check that you followed the specified settings when [creating a CDN resource in step 1](#create-resource).

    4. If you [added a custom domain in step 2](#add-personal-domain), open the object via the CDN custom domain using the link. Example link: `cdn.example.com/images/image.png`.If the file does not open, check the correctness of the CNAME record you [created in step 2](#add-cname-in-dns-hosting).
  </TabItem>
</Tabs>

<Formbricks />
