Community Blog Hosting a Static Website Using Alibaba Cloud Object Storage Service (OSS)

Hosting a Static Website Using Alibaba Cloud Object Storage Service (OSS)

This article explains how to host a static website using Alibaba Cloud Object Storage Service (OSS).

What Is OSS?

Alibaba Cloud Object Storage Service (OSS) is a secure, cost-effective, and high-durability cloud storage service that allows you to upload and save massive volumes of data to the cloud. OSS is built to provide data durability of 99.9999999999% (twelve nines) and service availability of 99.995%.

RESTful API activities are supported by OSS and are not dependent on the OSS console. Data from all applications can be stored and accessed at any time and from any location.

You can use API operations, SDKs, or OSS migration tools supplied by Alibaba Cloud to transfer huge amounts of data to and from Alibaba Cloud OSS. Apps and websites can store image, audio, and video objects in OSS buckets of the standard storage class.

What Is a Static Website?

Static websites are web pages that include static material, including client-side scripts such as JavaScript code. You can host your static website in an Object Storage Service (OSS) bucket and access it via the bucket's API using the static website hosting capability.

This provides an inexpensive strategy for hosting your static pages without spending money and time deploying and managing a server. Also, since the website pages are hosted on OSS, you can enjoy the rich benefits provided, including security, reliability, durability, and more.

Hosting a Static Website Using Alibaba Cloud Object Storage Service (OSS)

Creating a New OSS Bucket

On the Alibaba Console, search and select Object Storage Service (OSS):

On the new page, click Buckets and then Create Bucket:

On the Create Bucket page, fill in the required information and click OK. Some things to note:

  • Your bucket name must be globally unique
  • Storage Class, Region, and Zone-redundant Storage cannot be changed after the bucket is created.

Upload your Homepage into the bucket. Click Files and then Upload:

On the file upload page, you have the option to select files that reside on your local PC. Here, you select the web pages you want to be displayed:

After uploaded, take note of the file names:


Hosting a Static Website

Click on the newly created bucket:

On the next page, select Basic Settings:

Under Static Pages, select Configure:

On the Default Homepage Setting, type the name of your index page as represented in your bucket. Do the same for the "Default 404 page" and click save:

Now, you can configure the bucket endpoints on your DNS to route requests to your bucket's public endpoint:



This is a great way to redirect users when undergoing tests or maintenance on your main web server. This way, your site can be available in some capacity, telling your users the site is currently under maintenance.

0 0 0
Share on

Alibaba Cloud Community

917 posts | 203 followers

You may also like


Alibaba Cloud Community

917 posts | 203 followers

Related Products