Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Practical guidelines
  • Web service
    • All tutorials
    • Static website in Object Storage
    • Website on LAMP or LEMP stack
    • Fault-tolerant website with load balancing by Network Load Balancer
    • Fault-tolerant website with load balancing by Application Load Balancer
    • Fault-tolerant website using DNS load balancing
    • Joomla website with PostgreSQL
    • WordPress website
    • WordPress website on a MySQL database
    • Transferring a WordPress website from a different hosting provider to Yandex Cloud
    • 1C-Bitrix website
    • Integrating an L7 load balancer with the Cloud CDN and Object Storage
    • Blue-green and canary deployment of service versions
  • Online stores
    • All tutorials
    • 1C-Bitrix online store
    • Opencart online store
  • Data archive
    • All tutorials
    • Single-node file server
    • Configuring an SFTP server on Centos 7
    • Backup to Object Storage via Acronis Backup
    • Backup to Object Storage via CloudBerry Desktop Backup
    • Backup to Object Storage via Duplicati
    • Backup to Object Storage via Bacula
    • Backup to Object Storage via Veritas Backup Exec
    • Digitizing archives in Yandex Vision
  • Test environment
    • All tutorials
    • Testing applications with GitLab
    • Creating test VMs using GitLab CI
    • High-performance computing on preemptible VMs
    • Emulating multiple IoT devices
    • gRPC service load testing
    • Using Phantom to run a fixed-load HTTPS test
    • Using Pandora to run a step-load HTTPS test
  • Performing infrastructure management
    • All tutorials
    • Getting started with Terraform
    • Uploading Terraform states to Object Storage
    • Getting started with Packer
    • Automating VM image builds using Jenkins
    • Continuous deployment of containerized applications using GitLab
    • Creating a cluster of 1C:Enterprise Linux servers with a Managed Service for PostgreSQL cluster
    • Creating a cluster of 1C:Enterprise Windows servers with SQL Server
    • Migrating to Yandex Cloud using Hystax Acura
    • Fault protection with Hystax Acura
    • Creating a VM backup with Hystax Acura Backup
    • Configuring a fault-tolerant architecture in Yandex Cloud
    • Creating an SAP program in Yandex Cloud
  • Building a data platform
    • All tutorials
    • Syncing MySQL data using Yandex Data Transfer
    • Migrating databases from Yandex Managed Service for MySQL to MySQL
    • Configuring a managed databased in a ClickHouse cluster for Graphite
    • Exchanging data between Yandex Managed Service for ClickHouse and Yandex Data Proc
    • Managing data schemas in Yandex Managed Service for Apache Kafka®
    • Using Managed Schema Registry with Yandex Managed Service for Apache Kafka®
    • Using Confluent Schema Registry with Yandex Managed Service for Apache Kafka®
    • Migrating databases from Yandex Managed Service for MySQL to MySQL
    • Delivering data from Yandex Managed Service for PostgreSQL to Yandex Managed Service for Apache Kafka® using Debezium
    • Delivering data from Yandex Managed Service for PostgreSQL to Yandex Managed Service for Apache Kafka® using Yandex Data Transfer
    • Migrating databases to Yandex Managed Service for SQL Server
    • Migrating databases from Yandex Managed Service for SQL Server to a third-party SQL Server cluster
    • Transferring data from PostgreSQL to ClickHouse using Yandex Data Transfer
    • Configuring Yandex Cloud DNS for accessing managed database clusters from other cloud networks
    • Transferring a database to Yandex Managed Service for Redis
    • Migrating to Yandex Managed Service for Elasticsearch using the Reindex API
    • Configuring Kafka Connect for Yandex Managed Service for Apache Kafka® clusters
    • Using initialization actions to configure GeeseFS in Yandex Data Proc
    • Migrating databases from a third-party MySQL cluster to a Yandex Managed Service for MySQL cluster
    • Importing data from Yandex Managed Service for MySQL to Yandex Data Proc using Sqoop
    • Importing data from Yandex Managed Service for PostgreSQL to Yandex Data Proc using Sqoop
  • Windows in Yandex Cloud
    • All tutorials
    • Deploying Active Directory
    • Deploying Microsoft Exchange
    • Deploying Remote Desktop Services
    • Deploying an Always On availability group
    • Deploying an Always On availability group with an internal network load balancer
    • Deploying Remote Desktop Gateway
  • Network routing
    • All tutorials
    • Routing through a NAT instance
    • Creating a VPN tunnel
    • Installing a Cisco CSR1000v virtual router
    • Installing a Mikrotik CHR virtual router
    • Connecting to a cloud network using OpenVPN
    • Configuring networks for Yandex Data Proc
  • Data visualization and analytics
    • All tutorials
    • Visualizing data from a CSV file
    • Creating and publishing a chart with a map of Moscow from a CSV file
    • Analyzing a store chain's sales based on data from a ClickHouse DB
    • Analyzing open data on road accidents in Russia
    • Analyzing sales and locations of pizzerias based on data from ClickHouse DB and Marketplace
    • Web analytics with a connection to Yandex.Metrica
    • Web analytics with funnels and cohorts calculated based on Yandex.Metrica data
    • Mobile app analytics based on AppMetrica data
    • Analyzing Yandex Music podcast statistics (for podcasters)
    • Visualizing data with a SQL chart
    • Mobile app customer journey analytics based on AppMetrica data
    • Analyzing Object Storage logs in DataLens
  • Internet of things
    • Operating manuals for the Internet of Things
    • Status monitoring of geographically distributed devices
    • Monitoring sensor readings and event notifications
  • Serverless technologies
    • URL shortener
    • Entering data into storage systems
    • Storing application runtime logs
  1. Web service
  2. Static website in Object Storage

Static website in Yandex Object Storage

Written by
Yandex Cloud
  • Before you start
    • Required paid resources
  • Create a public bucket
  • Configure the website homepage and error page
  • Set up using your own domain
  • Upload the website files
  • Check that the website is running
  • How to delete created resources

In this guide, you'll learn how to upload your the static HTML files of your website to Yandex Object Storage storage and link your domain name to a bucket that will store the files.

To host a static website in Object Storage:

  1. Before you start.
  2. Create a bucket with public access.
  3. Configure the website homepage and error page.
  4. Set up using your own domain.
  5. Upload the website files.
  6. Check that the website is running.

If you no longer need the website, delete its files from storage.

Before you start

Before working, you need to register in Yandex Cloud and create a billing account:

  1. Go to the management console. Then log in to Yandex Cloud or sign up if don't already have an account.
  2. On the billing page, make sure you linked a billing account, and it has the ACTIVE or TRIAL_ACTIVE status. If you don't have a billing account, create one.

If you have an active billing account, you can create or select a folder to run your VM in from the Yandex Cloud page.

Learn more about clouds and folders.

Required paid resources

The cost of hosting a static website includes:

  • A fee for storing static website data (see Yandex Object Storage pricing).
  • A fee for data operations (see Yandex Object Storage pricing).
  • The cost of outgoing traffic from Yandex Cloud to the internet (see Yandex Object Storage pricing).

Create a public bucket

To create a bucket for static website files:

  1. Go to the Yandex Cloud management console and select the folder where you want to perform the operations.

  2. On the folder page, click Create resource and select Bucket.

  3. In the Name field, enter a name for the bucket (for instance, www.example.com). The bucket name will be used in the website domain name: https://www.example.com.website.yandexcloud.net.

    The name must meet the following requirements:

    • The length of the name must be from 3 to 63 characters.
    • The name may contain lowercase Latin letters, numbers, hyphens, and periods.
    • The first and last characters must be letters or numbers.
    • Characters to the right and left of the period must be letters or numbers.
    • The name must not look like an IP address (for example, 10.1.3.9).

    Note

    If you plan to use your own domain for the website, the bucket name must exactly match the name of your domain, and this must be a third-level or higher domain.

  4. Specify the maximum size of the bucket in GB.

  5. Choose Public access to the bucket.

  6. Click Create bucket.

Configure the website homepage and error page

You should upload and configure the index page and error page. To do this:

  1. Create the following files on your computer:
    • index.html with the text Hello world!.
      The file content gets displayed when accessing the home page of the website.
    • error.html with the text Error!.
      The file content appears in website responses with 4xx errors.
  2. Go to your bucket's page, open the Objects tab, and click Upload. In the window that opens, select the created files and click the confirmation button.
  3. Click Upload.
  4. Open the Website tab on your bucket page.
  5. Select Hosting.
  6. In the Home page field, specify index.html.
  7. In the Error page field, specify error.html.
  8. Click Save.
  9. Make sure the website's home page opens. To do this, access the website from a browser via a link like https://{bucket-name}.website.yandexcloud.net.
  10. Make sure the error page opens. To do this, access the website from a browser via a link like https://{bucket-name}.website.yandexcloud.net/error-check.

Set up using your own domain

To use your own domain for a website:

  • Make sure the bucket name is exactly the same as the domain name. This must be a third-level or higher domain (for example, www.example.com).
  • Create a CNAME (Canonical Name) record at your DNS provider or on your own DNS server.

Note

By default, the website is accessible only over HTTP, for instance, http://www.example.com or http://www.example.com.website.yandexcloud.net. To provide HTTPS support for your website, upload your own security certificate to Object Storage.

The instructions below describe how to configure an external DNS service using reg.com for the www.example.com.website.yandexcloud.net and www.example.com domain names:

  1. Find the website address on the Website tab of the bucket page in the management console.
  2. Log in to the control panel of the external DNS service. Go to the list of your domains and click on the required domain name.
  3. Follow the Zone management link in the Domain management section.
  4. Create a CNAME record with the following field values:
    • Subdomain: www.
    • Canonical name: Website address with a dot at the end (for instance, www.example.com.website.yandexcloud.net..
  5. Wait 15-20 minutes for DNS record changes to take effect. The waiting time may differ for your DNS service.

Upload the website files

After you configure and test the website's availability, upload the remaining files that are necessary for website operation. To do this, use the management console, API, or one of the available tools for working with Object Storage.

Check that the website is running

To make sure the website is running, open the following address in your browser:

  • http://www.example.com.website.yandexcloud.net
  • http://website.yandexcloud.net/www.example.com

How to delete created resources

To stop paying for file storage, delete the uploaded files.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • Before you start
  • Required paid resources
  • Create a public bucket
  • Configure the website homepage and error page
  • Set up using your own domain
  • Upload the website files
  • Check that the website is running
  • How to delete created resources