NavigationContentFooter
Jump toSuggest an edit

How to enable and use the bucket website feature

Reviewed on 05 August 2024Published on 17 March 2021

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

Before you start

To complete the actions presented below, you must have:

  • A Scaleway account logged into the console
  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
  • A valid API key
  • An Object Storage bucket

How to enable the bucket website feature

  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. Click Enable bucket website in the bucket settings tab. 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.

    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 and paths must be specified at this step.

    Important
    • The index and error files must be located at the root of your bucket, rather than in a folder.
    • 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.

    You can now upload the index and error files to your bucket, if you have not already done so, as well as the other files that make up your static website.

    Tip

    Use the drag and drop area to upload several files and folders at the same time.

  7. Access the website by clicking the Website URL from the Bucket settings tab.

    Note

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

Sample HTML files

Use the samples below to quickly create HTML files for testing purposes.

Here is an example 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 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>
See also
How to monitor your consumptionHow to use Object Storage with Private Networks
API DocsScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCareers
© 2023-2024 – Scaleway