Skip to content

Hosting a Decentralized Website

Introduction to hosting a decentralized website using ENS

ContentHash

The ContentHash is a very popular component of an ENS name, first introduced in ENSIP-7. It can be queried by hitting the contenthash(bytes32) function on a name's resolver. You can also set the contenthash on a name if the resolver supports it.

ipfs://bafy...
bzz://2477
ar://HGa8...

Hosting & Pinning

When it comes to hosting your files there are many options to choose from.

IPFS / Filecoin
Swarm
Arweave

Popular options include IPFS, Swarm, and Arweave. Depending on what option you go with your files are either permanently stored on a network, or require to be actively stored on at least one machine, also known as "pinning".

Deploy your sites

Several helpful tools and platforms exist that you can use to deploy your website to IPFS, Swarm, or Arweave.

ToolNetwork Support
BlumenIPFS and Swarm
OrbiterIPFS
IPFS Deploy ActionIPFS
4EVERLANDIPFS and Arweave

Setting your ContentHash

If you are using the public resolver (the default for names registered using the ENS Manager App), you can set the contenthash directly from within the ENS Manager App.

If you are using a custom resolver, or are writing your own resolver you will be able to have more fine grained control over the contenthash field. See ENSIP-7 for more information on the contenthash field.

Browser Support & Gateways

At the moment of writing, major browsers such as Chrome, Firefox and Safari do not natively support accessing decentralized websites. If you want to directly access .eth websites without relying on third-party infrastructure, you can use Brave or Opera, which both support .eth resolution. Certain browser extensions such as MetaMask are also able to resolve .eth names.

In order to access dweb without having to install a new browser or an extension, you can use one of the following ENS gateways:

If a website is hosted on IPFS, it is also possible to access it directly from IPFS gateways. In order to access a decentralized website through an IPFS gateway, convert dots to dashes and append the .ipns namespace (e.g. ens.eth becomes ens-eth.ipns.<gateway>). Below is a list of IPFS gateways that support ENS: