# Managing Dedicated Gateways

Filebase users that are on a **paid IPFS subscription** have access to Filebase Dedicated IPFS Gateways. Dedicated IPFS Gateways are unique compared to other solutions and come with several benefits, such as:

* Increased performance and retrieval times.
* No rate limits when accessing content through the dedicated gateway.
* Limiting content (whitelisting) that the gateway can serve through the Scope feature of a dedicated gateway.
* Setting a Root CID of the gateway that can be used for website or app hosting.

With Filebase, you are able to create public, private, and scoped gateways.

* **Public:** The gateway can serve any public CID, even ones not pinned by Filebase.
* **Private:** The gateway can only serve CID's that are pinned by Filebase.
* **Scoped:** The gateway is tied to a bucket and can only serve content from that specific bucket. Any CIDs for content not stored in the specified bucket will return a 404 Not Found message.

{% hint style="info" %}
Filebase Dedicated IPFS Gateways of any type do not have any request limits.
{% endhint %}

{% hint style="danger" %}
Filebase IPFS Dedicated Gateways are a feature only available to paid users. They are not available for users on the free tier.
{% endhint %}

### Creating a Dedicated Gateway

Navigate to the [Gateways page](https://console.filebase.com/gateways) on the Filebase web console.

Select the ‘Create Gateway’ button in the upper right corner.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2Fny1IMROnKh7pKX7TePy7%2Fimage.png?alt=media&#x26;token=c642cc5a-b624-4969-b240-c70c21e30edd" alt=""><figcaption></figcaption></figure>

A new window will open prompting you to provide a gateway name and select the gateway’s access level.

{% hint style="warning" %}
Gateway names are subject to the same naming restrictions as bucket names. All gateway names must be lowercase, between 3-63 characters, and must be unique.
{% endhint %}

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FvgYmcTAcbBuZKUp1eTlp%2Fimage.png?alt=media&#x26;token=57ea0989-e0f7-4799-b2f9-5cf3f4b1547c" alt=""><figcaption></figcaption></figure>

Gateways can be public, private, or scoped.

### Public Mode

To create a public gateway, select ‘Public’. This can be changed after the gateway has been created.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FxShrYXtcI66ecdDIgKZh%2Fimage.png?alt=media&#x26;token=0417462b-e830-4003-8f09-fb6323ad4d8b" alt=""><figcaption></figcaption></figure>

### Private Mode

To create a private gateway, select ‘Private’. This can be changed after the gateway has been created.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FWXH7N1rpi5RyDS3o2DSv%2Fimage.png?alt=media&#x26;token=99aedf7d-62a0-4520-a496-07f8b3405bc8" alt=""><figcaption></figcaption></figure>

### Scoped Gateways

To create a scoped gateway, select ‘Private’, then select a bucket name from the drop-down menu for the scoped gateway to serve. Scoped gateways only serve content located in the bucket that they are restricted to.

{% hint style="warning" %}
Note: If a gateway is configured to serve a root CID, it cannot also be configured to be restricted to a bucket. The root CID configuration must be cleared to configure a bucket restriction.
{% endhint %}

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FhyFgtrBcN5ZvusIkRWkg%2Fimage.png?alt=media&#x26;token=0266f9ad-0b05-41ff-a3a1-7ce7a2d75245" alt=""><figcaption></figcaption></figure>

Alternatively, if you want to set a bucket restriction for a gateway that was previously created, you can set the restriction by navigating to the [Buckets](https://console.filebase.com/buckets) menu and selecting the three menu dots for the bucket you’d like to restrict your gateway to. Then select ‘Set Restriction’.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FWiPBDN8IZmhedRpnYDLs%2Fimage.png?alt=media&#x26;token=65418f22-c4a0-494a-9ba3-3f78148e3dd4" alt=""><figcaption></figcaption></figure>

When prompted, select the gateway you want configured to use the selected bucket.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FnM12qeXPePXz7jdCkDgZ%2Fimage.png?alt=media&#x26;token=37dab6c6-b0c9-45a6-88ab-a5ed58e409af" alt=""><figcaption></figcaption></figure>

### Removing a Bucket Restriction

To remove the bucket restriction on a gateway, navigate to the [Gateways](https://console.filebase.com/gateways) page, select the three menu dots on the right-hand side, then select **Clear Bucket Restrictions**

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FSr6r9XYSP0AhwlHjpsmO%2Fimage.png?alt=media&#x26;token=df5888a5-6c60-4e56-87dc-792f55cec442" alt=""><figcaption></figcaption></figure>

You will be prompted to confirm the removal.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FRyHpkZzaJJGkq8lkWDgy%2Fimage.png?alt=media&#x26;token=548933b3-f813-4b69-9c95-9d82f404626d" alt=""><figcaption></figcaption></figure>

### Interacting With Gateways

Once a gateway has been created, a subdomain record is created that points to your dedicated gateway. For example, the dedicated gateway called **documentation** will use the gateway URL:

<https://documentation.myfilebase.com/>

#### Toggling Private/Public Access

To toggle between public and private access for a dedicated gateway, use the toggle switch that functions identically to the public and private access toggle switch for buckets.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2F1Pq1Op5ooxK4EjevYLKu%2Fimage.png?alt=media&#x26;token=d2247f40-d568-4189-9f2e-c7695ea70fcf" alt=""><figcaption></figcaption></figure>

To interact with the gateway, you can select the three menu dots to open a list of options.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2Fsop5QWeKL58LKMWdT0Qh%2Fimage.png?alt=media&#x26;token=456d1a98-f88e-40cb-a9af-49bf3b2108da" alt=""><figcaption></figcaption></figure>

To open the gateway URL, select **Open**.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FMJChoWI6hEJ0Ih0PzFb3%2Fimage.png?alt=media&#x26;token=62e4576e-dd9e-46bc-a971-22a3c1b1663b" alt=""><figcaption></figcaption></figure>

By default, the URL will return the following webpage:

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FiKCzkfQFFWVTZ4hyXmag%2Fimage.png?alt=media&#x26;token=26a9fe68-3ab1-4258-9261-1f6573d0ead1" alt=""><figcaption></figcaption></figure>

This webpage is returned since there is no CID included in the URL. However, gateways can be configured to serve a CID or file as its root. This means instead of this default webpage, you can configure a different default static webpage or another file to be viewed by default rather than this error message.

This is most commonly used to serve static websites from a domain. Using this feature, <http://documentation.myfilebase.com/> would return the file you selected, without having to enter a CID or path in the URL.

### Setting a CID as the Root of the Dedicated Gateway

{% hint style="info" %}
Note: If a gateway is configured to be restricted to a bucket, it cannot be configured to have a root CID. The bucket restriction configuration will need to be cleared before a root CID can be configured for the gateway.
{% endhint %}

To configure this, navigate to the [Buckets](https://console.filebase.com/buckets) menu, and select an IPFS bucket.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2F1e43jgN89lV7k3aTmRQe%2Fimage.png?alt=media&#x26;token=d042d300-e08a-4a31-879a-0f36d13cde2d" alt=""><figcaption></figcaption></figure>

Once inside the bucket, select the file you’d like to set as the root file by selecting the three menu dots on the right-hand side.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FiIMjm3098ilorlB2eQ2F%2Fimage.png?alt=media&#x26;token=cbe480f8-867a-4309-ae63-10d9ff979a18" alt=""><figcaption></figcaption></figure>

Select **Set as Root**.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FDVnPyqH8ZmCTY1Huzzbf%2Fimage.png?alt=media&#x26;token=e9325e91-665a-465e-925c-90c928b07269" alt=""><figcaption></figcaption></figure>

Then choose the dedicated gateway you’d like to use.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FNP0O5wEUv0mjeTy7wS25%2Fimage.png?alt=media&#x26;token=10e269b4-449b-4e08-bad9-74665a19933b" alt=""><figcaption></figcaption></figure>

Now, when you open the gateway, you’ll see the file you set as the root file displayed rather than the default error message.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FBDUMcGSydwCQcojNZDYn%2Fimage.png?alt=media&#x26;token=5cb863f2-79b6-4d02-9b33-e4f345e35390" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2Fr4ZpQMnowQcazOAgPWKr%2Fimage.png?alt=media&#x26;token=5cb4c98b-6caf-4ee2-8750-7a7ae6c6e9c6" alt=""><figcaption></figcaption></figure>

### Removing a Root CID From a Gateway

To remove a CID set as the root CID for a dedicated gateway, navigate to the [Gateways](https://console.filebase.com/gateways) page, then select the three menu dots and select **Clear Root CID**.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FxjHb73SrHMddAgWkFkQf%2Fimage.png?alt=media&#x26;token=6f9872fa-80ca-42aa-9a7a-cf9dbdd3c2cf" alt=""><figcaption></figcaption></figure>

You will be prompted to confirm the removal.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2F7uz0V1HQGXz15lqnbMUY%2Fimage.png?alt=media&#x26;token=5b2cf394-eb53-44a8-a8c5-e9f02a764d74" alt=""><figcaption></figcaption></figure>

### Deleting a Gateway

To delete a dedicated gateway, navigate to the [Gateways](https://console.filebase.com/gateways) page in the Filebase web console dashboard.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FNRQnPAj7D4tTIST5HI8O%2Fimage.png?alt=media&#x26;token=bde55526-be7e-409b-a37e-5e4e5a9d0360" alt=""><figcaption></figcaption></figure>

Select the options menu by clicking the three dots on the right-hand side corresponding with the gateway you want to remove. Then select **Delete**.

<figure><img src="https://3861818989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lyjw7dWpiQtUFDa1pO0%2Fuploads%2FwJoygiG36m1GLNA4FZpK%2Fimage.png?alt=media&#x26;token=c83acdf0-85af-4a5f-b5e0-162476b6a814" alt=""><figcaption></figcaption></figure>

You will be prompted to confirm the removal.
