# Static Website Hosting

Static Website Hosting enables the hosting of static content, including HTML, CSS, JavaScript, and images, directly, eliminating the need for an external web server. You can specify both an index page and an error page. Additionally, there is an option to link a custom domain.

{% hint style="info" %}
**Note:** Static Website Hosting setting is supported for both contract-owned buckets and user-owned buckets. For more information, see [<mark style="color:blue;">Bucket Types</mark>](../concepts/bucket-types).
{% endhint %}

Depending on the region of your Object Storage bucket, the static website URL varies. For more information on the static website endpoint, see [<mark style="color:blue;">Endpoints</mark>](../endpoints).

## Use cases

* **Static Content Hosting:** Directly serve HTML, CSS, JavaScript, and media files statically on a website.
* **Publish Landing Pages:** Host promotional or event-specific landing pages with high availability.
* **Documentation Sites:** Host product documentation or manuals with easy access to the users.

## Manage Static Website Hosting

You can manage Versioning using the DCD, API, and CLI.

### DCD

#### Enable Static Website Hosting

{% hint style="info" %}
**Note:** Static Website Hosting is disabled by default for a bucket. Enabling this setting will make all objects in the bucket publicly readable.
{% endhint %}

1\. In the **DCD**, go to **Menu** > **Storage & Backup** > **IONOS Object Storage**.

2\. From the drop-down list in the **Buckets** tab, choose either **Show user-owned buckets** or **Show contract-owned buckets** depending on the bucket type you want to view.

3\. From the **Buckets** list, choose the bucket for which you want to manage Static Website Hosting.

4\. Click **Bucket settings** and go to the **Static Website Hosting** setting under the **Public access** section.

5\. Click **Edit** and add the following details:

* **Index document:** Enter the file name that serves as an index document. Example: `index.html`. An index document is a default webpage that IONOS Object Storage returns on receiving a request to the root of a website or a subfolder.
* **Error document:** Enter the file name of the HTML error document that is uploaded to the Object Storage bucket. An error document is a default HTML file with details you want the user to view when an error occurs.

6\. Click **Enable**.

![Enable Static Website Hosting](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-f83a2236fdea0ef4b3554d8459ef2d14118c0266%2Fs3-enable-static-website.png?alt=media)

{% hint style="success" %}
**Result:** Static Website Hosting is successfully enabled for a bucket.
{% endhint %}

{% hint style="info" %}
**Info:** In the Static Website Hosting setting, choose **Edit** and click **Disable** to remove Static Website Hosting for a bucket.
{% endhint %}

### API

Use the [<mark style="color:blue;">API</mark>](https://api.ionos.com/docs/s3/v2/#tag/Website) to configure and manage Static Website Hosting for a bucket.

### CLI

Use the [<mark style="color:blue;">CLI</mark>](../s3-tools/awscli/awscli-static-website-hosting) to manage Static Website Hosting.

## Limitations

Static Website Hosting is unsuitable for hosting websites that require server-side processing, such as PHP and Python.
