HomeStorageObject StorageHow to
Set up a static website
Update content

How to enable and use the bucket website feature

Reviewed on 17 July 2023 • Published on 17 March 2021

The Bucket Website feature allows you to host static websites using Scaleway Object Storage.

Security & Identity (IAM):

You may need certain IAM permissions to carry out some actions described on this page. This means:

  • you are the Owner of the Scaleway Organization in which the actions will be carried out, or
  • you are an IAM user of the Organization, with a policy granting you the necessary permission sets
Requirements:
Important:

To use the bucket website feature, you need to enable it on the bucket or buckets you wish to host your website on.

  1. Click Object Storage in the Storage section of the side menu. The list of your buckets displays.

  2. Click the name of the bucket you wish to host your website on.

  3. Scroll down to the bottom of the Bucket settings tab and click Enable bucket website. A pop-up appears.

  4. Click the «Toogle Icon» icon to enable the feature.

  5. Enter the names of the index and error files of your website that will be uploaded to the bucket.

    The index and error files are commonly named index.html and error.html, respectively. You may have already uploaded these files to your bucket, or you can upload them later. Either way, their names must be specified now.

    Tip:
    • The index file is the default or home page for the website. It serves as an index to the other pages of the site.
    • The error file defines the page that displays in case of an error, for example if a user tries to access a page of your website that does not exist.

    Here is an example of the contents of a basic index.html file:

    <!doctype html>
    <html>
    <head>
    <title>My Website</title>
    </head>
    <body>
    <div id="main">
    <h1>Hi! Welcome to my website.</h1>
    </div>
    </body>
    </html>

    Here is an example of the contents of a basic error.html file:

    <!doctype html>
    <html>
    <head>
    <title>Oops!</title>
    </head>
    <body>
    <div id="main">
    <h1>Oops! Something went wrong.</h1>
    </div>
    </body>
    </html>

    A warning message informs you that:

    Important:

    When Bucket Website is enabled, a default bucket policy is applied. All objects in the bucket then become publicly visible. You can create your own bucket policy to change the visibility settings via CLI.

  6. Click Save configuration to confirm. The details of your website configuration display.

    Now you can upload the index and the error files to your bucket, if you haven’t already done so, as well as the other files that make up your static website.

    Note:

    If this is your first time uploading objects into a bucket, you can follow the step-by-step on this documentation page.

  7. Access the website by clicking the Website URL.

    Note:

    You can also configure a CNAME record for your bucket URL, to be able to access the website through a domain name of your choice.

See Also