Certain functionality of a DApp can be hosted on the blockchain as smart contracts. How about other resources such as HTML and JS files? Multiple places reference "Swarm" as the place to host these resources, but when you look at Swarm wiki, it's basically a list of TO-DOs. There are DApps out there right now. How are they hosted?

  • I have exactly the same question and I'm not clear yet where the HTML / JS files would live.
    – Flion
    Apr 28, 2021 at 9:47

3 Answers 3



  • Backend - smart contract, user data, and NFT files can be stored on blockchains, ipfs, filecoin, or other decentralized storage platforms.
  • Frontend - hosting frontend files (HTML, CSS, JS, etc) in a decentralized manner is also possible. Here's an explanation

Hosting frontend on centralized servers

  • The access to backend functionalities (smart contracts, decentralized data - ipfs or filecoin, etc.) is enabled via frontend.
  • There is a risk if your frontend is hosted on a centralized platform like AWS or Firebase.
  • In such a scenario, the centralized entity controls your frontend, and your website can be taken down or would not work in adverse situations like server down.

Hosting frontend on decentralized servers

  • Instead of one central server storing your entire frontend files, a copy of files is stored with multiple nodes.
  • If a few nodes are down, stop working, or refuse to host your files, other nodes will still be operating. Thus, your site downtime is almost 0 unless all nodes (or a max. threshold) stop functioning.

How to host frontend on decentralized servers?

  • There are decentralized hosting tools like - Spheron
  • Decentralized storage tools - Web3 Storage, Filecoin
  • There are many more. I'm still searching. If you find one, do let me know.

This mostly depends on how you define "DApp".

Following the definition of Buterin, a DApp is an application that doesnt have any central components (simplified). So all data is essentially stored in smart contracts on the blockchain and/or using concepts like IFPS.

The app itself (UI code, business logic, etc) is then run (and stored) by every user.

  • 1
    that doesn't really answer the question fully. Where does the user get this business logic & UI code from? For a webapp they most likely go to a domain and download some js files. Where do those files live?
    – Flion
    Apr 28, 2021 at 9:46
  • I don't understand your problem with that answer: Any app/code/logic that is run on your device needs to be brought there in the one or the other way. That includes the UI files for a DApp. DEPENDING ON HOW YOU DEFINE "DAPP", this might be different here and there. According to Buterin's definition, all data/UI files need to be in said IPFS or similar. Other definitions might allow a more "traditional" way, where you have local installations (e.g. downloaded from a website or repository) that simply connect with the help of a smart contract. As I said it mostly depends on how you define DApp
    – Xenonite
    May 27, 2021 at 14:18

I just found one possible answer, which is to host the HTML & JS on IPFS as explained here in section 4 "Deploy the application online with IPFS" and then you can point the DNS settings of your domain to IPFS too

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.