Configuring HTTPS
If you use a bucket without a period in its name to host a static website, that website will be accessible by default over HTTP and HTTPS at the following URLs:
http(s)://example.website.yandexcloud.nethttp(s)://website.yandexcloud.net/example
This bucket does not require uploading your own security certificate, but it also does not support your own domains.
If you use a bucket with a period in its name to host a static website, that website will be accessible by default over HTTP and HTTPS at the following URLs:
http://example.com.website.yandexcloud.nethttp(s)://website.yandexcloud.net/example.com
This bucket also supports your own domains. By default, when addressing the website by domain name, it is only accessible over HTTP, e.g., at http://example.com. To make your website accessible by its domain name over HTTPS, upload your own security certificate and the applicable secret key.
Alert
Starting August 1, 2025, Object Storage no longer supports the TLS protocol versions 1.0 and 1.1.
For more information, see TLS protocol.
Object Storage only supports PEM
Note
The bucket becomes accessible over HTTPS within 30 minutes of uploading the certificate.
Request redirects from HTTP to HTTPS are enabled automatically once you set up HTTPS access to a bucket. No other settings are required.
Selecting a certificate from Certificate Manager
-
In the management console
, select a folder. -
Go to Object Storage.
-
Select the bucket from the list.
-
In the left-hand panel, select
Security. -
Select the HTTPS tab.
-
Click Configure.
-
In the Source field, select Certificate Manager.
-
In the Certificate field, select the certificate from the list that opens.
Note
If you do not have a certificate in Yandex Certificate Manager yet, click Go to Certificate Manager and follow this guide to create your first certificate.
-
Click Save.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
See the description of the CLI command for editing a bucket ACL:
yc storage bucket update --help -
Run this command:
yc storage bucket set-https --name <bucket_name> --certificate-id <certificate_ID>Where:
--name: Name of the bucket to configure HTTPS for.--certificate-id: Certificate ID in Certificate Manager.
Result:
source_type: SOURCE_TYPE_MANAGED_BY_CERTIFICATE_MANAGER certificate_id: fpqe2g0hfr0e********
Note
Terraform uses a service account to interact with Object Storage. Assign to the service account the required role, e.g., storage.admin, for the folder where you are going to create resources.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To select a certificate from Certificate Manager:
-
Open the Terraform configuration file and add the
httpssection to the bucket description:... resource "yandex_storage_bucket" "b" { bucket = "my-policy-bucket" https { certificate_id = "<certificate_ID>" } } ...Where:
certificate_id: Certificate ID in Certificate Manager that will be used for the bucket.
For more information about the
yandex_storage_bucketresource parameters in Terraform, see this TF provider article. -
Check the configuration using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Confirm the changes: type
yesinto the terminal and press Enter.You can check the selected certificate using the management console
.
To select a certificate from Certificate Manager, use the setHTTPSConfig REST API method for the Bucket resource or the BucketService/SetHTTPSConfig gRPC API call.
Uploading a custom security certificate
To upload a custom certificate, use Certificate Manager.
When uploading a certificate chain, make sure it starts with the domain certificate and ends with the root one. To create a chain file, use the following command:
cat domain.pem intermediate.pem rootca.pem > bundle.pem
Where domain.pem is the domain certificate, intermediate.pem is the intermediate certificate, rootca.pem is the root certificate, and bundle.pem is the resulting chain.
To upload a certificate:
- In the management console
, select a folder. - Go to Object Storage.
- Select the bucket from the list.
- In the left-hand panel, select
Security. - Select the HTTPS tab.
- Click Configure.
- In the Source field, select Your certificate.
- Add Certificate and Secret key.
- Click Save.
To upload a custom security certificate, use the setHTTPSConfig REST API method for the Bucket resource or the BucketService/SetHTTPSConfig gRPC API call.
Note
You can get files from a publicly available bucket using a public link via both HTTP and HTTPS even if no website hosting is configured for the bucket. In this case, a cloud-level certificate from GlobalSign