Skip to content

Get started

Use this tutorial to set up a Cloudflare Web3 gateway, which gives your application HTTP access to the IPFS or Ethereum network without running your own node.

Before you begin

Before you start, make sure you have set up an account and added your website to Cloudflare.

Step 1 - Subscribe to a gateway

Web3 gateways are a paid add-on. To get access, subscribe to a gateway.

Step 2 - Create a gateway

After purchasing a gateway subscription, create a gateway.

Create via dashboard

To create a gateway using the dashboard:

  1. In the Cloudflare dashboard, go to the Web3 page.

    Go to Web3
  2. Click Create Gateway.

  3. Enter the following information:

  • Hostname: Enter a hostname to use as your gateway, which has to be a subdomain of the current Cloudflare zone.
  • Gateway Description: Enter a description to help distinguish between different gateways.
  • Gateway Type: Select a gateway target of IPFS DNSLink, IPFS Universal Path, or Ethereum.
  • DNSLink: Only applicable to IPFS gateways, more details at DNSLink.
  1. Click Deploy.

Create via API

To create a gateway using the API, send a POST request that includes the following parameters:

  • name: The hostname that will point to the target gateway via a CNAME record.
  • target: The gateway target for the hostname (ethereum, ipfs, ipfs_universal_path).

If you need help with API authentication, refer to Cloudflare API documentation.

Request
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/web3/hostnames" \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>" \
--header "Content-Type: application/json" \
--data '{
"name": "gateway.example.com",
"description": "This is my IPFS gateway.",
"target": "ipfs",
"dnslink": "/ipns/onboarding.ipfs.cloudflare.com"
}'

The response contains the complete definition of the new gateway.

Response
{
"success": true,
"errors": [],
"messages": [],
"result": {
"id": "<WEB3_GATEWAY_ID>",
"name": "gateway.example.com",
"description": "This is my IPFS gateway.",
"status": "active",
"target": "ipfs",
"dnslink": "/ipns/onboarding.ipfs.cloudflare.com",
"created_on": "<CREATED_ON_DATE>",
"modified_on": "<MODIFIED_ON_DATE>"
}
}

When you create a gateway, Cloudflare automatically:

  • Creates and adds records to your Cloudflare DNS so your gateway can receive and route traffic appropriately.
  • Proxies traffic to that hostname.
  • Issues an SSL/TLS certificate to cover the specified hostname.

Step 3 - Customize Cloudflare settings

Once your gateway becomes active, you can customize the Cloudflare settings associated with your hostname.

Since your traffic is automatically proxied through Cloudflare, you customize your website settings to take advantage of various security, performance, and reliability benefits.

Step 4 - Restrict gateway access (optional)

If you are using your gateway for backend services, you may want to use Cloudflare Zero Trust to restrict gateway access.

Step 5 - Set up usage notifications

Since this is a service with usage-based billing, Cloudflare recommends that you set up usage-based billing notifications to avoid unexpected bills.

To set up those notifications:

  1. In the Cloudflare dashboard, go to the Notifications page.

    Go to Notifications
  2. On Alert Type of Usage Based Billing, click Select.

  3. Fill out the following information:

    • Name
    • Product
    • Notification limit (exact metric will vary based on product)
    • Notification email
  4. Select Save.

Step 6 - Use the gateway

Once you have created a gateway and updated your Cloudflare settings, you can start using your IPFS or Ethereum.