[Yandex Cloud documentation](../../../index.md) > [Tutorials](../../index.md) > Application solutions > Creating a website > [Static website in Object Storage](index.md) > Management console

# Static website in Yandex Object Storage using the management console

To host a [static website in Object Storage](index.md) using the Yandex Cloud management console:

1. [Get your cloud ready](#before-you-begin).
1. [Create a public bucket](#create-public-bucket).
1. [Enable a website for a bucket](#turn-on-hosting).
1. [Configure DNS](#configure-dns).
1. [Upload the website files](#upload-files).
1. [Test the website](#test-site).

If you no longer need the resources you created, [delete them](#clear-out).

## Get your cloud ready {#before-you-begin}

Sign up for Yandex Cloud and create a [billing account](../../../billing/concepts/billing-account.md):
1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or create a new account.
1. On the **[Yandex Cloud Billing](https://center.yandex.cloud/billing/accounts)** page, make sure you have a billing account linked and it has the `ACTIVE` or `TRIAL_ACTIVE` [status](../../../billing/concepts/billing-account-statuses.md). If you do not have a billing account, [create one](../../../billing/quickstart/index.md) and [link](../../../billing/operations/pin-cloud.md) a cloud to it.

If you have an active billing account, you can create or select a [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) for your infrastructure on the [cloud page](https://console.yandex.cloud/cloud).

[Learn more about clouds and folders here](../../../resource-manager/concepts/resources-hierarchy.md).

### Required paid resources {#paid-resources}

The cost of hosting a static website includes:
* Fee for storing data for a static website (see [Object Storage pricing](../../../storage/pricing.md#prices-storage)).
* Fee for data operations (see [Object Storage pricing](../../../storage/pricing.md#prices-operations)).
* Fee for outgoing traffic from Yandex Cloud to the internet (see [Object Storage pricing](../../../storage/pricing.md#prices-traffic)).
* Fee for public DNS queries and [zones](../../../dns/concepts/dns-zone.md) (see [Yandex Cloud DNS pricing](../../../dns/pricing.md)).

## Create a public bucket {#create-public-bucket}

To create a bucket for static website files:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the Yandex Cloud [management console](https://console.yandex.cloud), select a [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) to create a bucket in.
  1. On the folder page, click ![image](../../../_assets/console-icons/plus.svg) **Create resource** and select ![image](../../../_assets/bucket-icon.svg) **Bucket**.
  1. In the **Name** field, specify the bucket name. Once configured, the bucket will be available at two addresses:

     * `http(s)://<bucket_name>.website.yandexcloud.net`
     * `http(s)://website.yandexcloud.net/<bucket_name>`

     The name must meet the following requirements:

     * The name must be from 3 to 63 characters long.
     * The name may contain lowercase Latin letters, numbers, hyphens, and periods.
     * The first and last characters must be letters or numbers.
     * The characters to the right and left of the period must be letters or numbers.
     * The name must not look like an IP address, e.g., `10.1.3.9`.

     If you have a registered domain name (e.g., `example.com`) and want your website to be accessible at `example.com`, specify `example.com` as the bucket name.

     {% note info %}

     If you plan to use your own domain for the website, the bucket name must be an exact match of your domain name. Use a second-level domain or higher. For more information, see [Custom domain](../../../storage/operations/hosting/own-domain.md).

     {% endnote %}

  1. In the **Read objects** field, specify `For all`.
  1. Click **Create bucket**.

{% endlist %}

## Enable a website for a bucket {#turn-on-hosting}

1. Upload and configure the home page and error handling page for your intended website. To do this, create the following files on your computer:

    * `index.html` containing the text `Hello world!`. The file contents will be displayed on the website's home page.
    * `error.html` containing the text `Error!`. The file contents will be displayed when the website responds with `4xx` errors.

1. Upload the files you created to the bucket:

    {% list tabs group=instructions %}

    - Management console {#console}

      1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) where the bucket is located.
      1. Navigate to **Object Storage** and select the previously created bucket in the window that opens.
      1. In the left-hand panel, select **Objects**.
      1. Click **Upload**. In the window that opens, select the files you created and confirm the upload.
      1. In the left-hand panel, select **Settings**.
      1. On the **Website** tab:

          1. Navigate to the `Website` tab and select `Hosting`.
          1. In the **Home page** field, specify `index.html`.
          1. In the **Error page** field, specify `error.html`.
          1. Click **Save**.

    {% endlist %}

1. Make sure your website's home page opens. To do this, access the website from a browser at `http://<bucket_name>.website.yandexcloud.net`.
1. Make sure the error page opens. To do this, access the website from a browser at `http://<bucket_name>.website.yandexcloud.net/error-check`.

By default, the website is only accessible over HTTP, e.g., at `http://example.com.website.yandexcloud.net`. To provide HTTPS support for your website:
1. Add your [own security certificate](../../../certificate-manager/operations/import/cert-create.md) or a [Let's Encrypt certificate](../../../certificate-manager/operations/managed/cert-create.md) in Yandex Certificate Manager.
1. [Configure](../../../storage/operations/hosting/certificate.md) HTTPS support for your bucket. Your website will then be accessible over HTTPS at `https://example.com.website.yandexcloud.net`.

    {% note info %}
    
    If you use such URLs as `http(s)://<bucket_name>.storage.yandexcloud.net`, the HTTPS protocol is available for the bucket only if the bucket name does not contain dots, e.g.:
    
    * `https://example.storage.yandexcloud.net`: HTTPS is available for this bucket.
    * `http://example.ru.storage.yandexcloud.net`: HTTPS is not available for this bucket.
    
    This is because Object Storage uses [Wildcard certificates](https://en.wikipedia.org/wiki/Wildcard_certificate) that only support one level of subdomains.
    
    To provide HTTPS support for a bucket with a dot in the name, [upload your own security certificate](../../../storage/operations/hosting/certificate.md) to Object Storage.
    
    {% endnote %}

1. For access by the short domain name (`example.com`), [configure DNS](#configure-dns).

## Configure DNS {#configure-dns}

If you have a registered domain name, assign it to the bucket. To do this, create an [ANAME](../../../dns/concepts/resource-record.md) [DNS record](../../../dns/concepts/resource-record.md#cname).

You can use Cloud DNS to manage the domain.

{% note info %}

The bucket name must be an exact match of your domain name. Use a second-level domain or higher. For more information, see [Custom domain](../../../storage/operations/hosting/own-domain.md).

{% endnote %}

The tutorial below describes how to set up DNS for an `example.com` second-level domain.

### Add a zone {#create-dns-zone}

To create a public DNS zone:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder where you want to create a public zone.
  1. Navigate to **Cloud DNS**.
  1. Click **Create zone**. In the window that opens, specify the DNS zone settings:

      * **Zone**: Specify your registered domain name, e.g., `example.com.`. The field value must end with a trailing dot.
      * **Type**: `Public`.
      * **Name**: `example-zone-1`.

  1. Click **Create**.

{% endlist %}

### Add an ANAME resource record {#create-cname-record}

Create an [ANAME](../../../dns/concepts/resource-record.md#aname) resource record in the public DNS zone:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder that houses the public DNS zone.
  1. Navigate to **Cloud DNS** and select the DNS zone you created earlier. 
  1. Click **Create record**. In the window that opens, set the record properties:

      * In the **Name** field, select `Matches zone name (@)`.
      * In the **Type** field, select `ANAME`.
      * In the **Data** field, specify the resource record value, e.g., `example.com.website.yandexcloud.net`, where `example.com` is the name of the public bucket you created earlier.

  1. Click **Create**.

{% endlist %}

The domain name in the ANAME record must match the bucket name. For example, if you are creating an ANAME record named `example.com`, your bucket name should also be `example.com`.

### Delegate the domain name {#delegate-domain}

Delegation is the transfer of authority from the registrar's servers to yours. For a domain, [NS](../../../dns/concepts/resource-record.md#ns) resource records (`ns1.yandexcloud.net` and `ns2.yandexcloud.net`) are created.

To delegate a domain, specify its DNS servers in the registrar's account.

Delegation does not take effect immediately. It usually takes up to 24 hours (86,400 seconds) for internet service providers to update records. This depends on the [TTL](https://en.wikipedia.org/wiki/Time_to_live) value, which specifies how long domain records are cached.

You can check domain delegation using [Whois](https://www.reg.com/whois/check_site) or the `dig` utility:

```bash
dig +short NS example.com
```

Result:

```text
ns2.yandexcloud.net.
ns1.yandexcloud.net.
```

## Upload the website files {#upload-files}

After you configure and test availability, upload the remaining files required for website operation. To do this, use the [management console](https://console.yandex.cloud), [S3 API](../../../storage/s3/api-ref/object/upload.md), [Terraform](../../infrastructure-management/terraform-quickstart.md), or other [tools for operating Object Storage](../../../storage/tools/index.md).

## Test the website {#test-site}

To check that the website is running, use one of the standard Object Storage addresses:
* `http://<bucket_name>.website.yandexcloud.net`
* `http://website.yandexcloud.net/<bucket_name>`

If you have configured your own domain for a website, use its address, e.g., `example.com`.

## How to delete the resources you created {#clear-out}

To stop paying for the resources:
1. [Delete the files you uploaded](../../../storage/operations/objects/delete.md).
1. [Delete the bucket](../../../storage/operations/buckets/delete.md).
1. [Delete the DNS zone](../../../dns/operations/zone-delete.md).

#### See also {#see-also}

* [Static website in Yandex Object Storage using Terraform](terraform.md).