In this tutorial, you will learn how to host your website on IPFS using the IPFS desktop application. IPFS is a peer-to-peer network that allows you to store and share data in a decentralized way. This means that your website will be hosted on a network of computers all over the world, making it more resilient to censorship and downtime.
To get started, you will need to download and install the IPFS desktop application. Once you have installed the application, here’s a step by step guide on how to setup the IPFS desktop app on your desktop. In this tutorial, we will be using a Windows desktop, but the steps are the same on other operating systems.
INSTALLING IPFS DESKTOP APP
- Visit IPFS desktop app download page and download the latest release with a .exe file extension.
- Run the file after download has been completed.
- Choose your most preferred option, whether to install for just yourself or all users on your computer, and click Next.
- The next step is to choose the installation destination of the app and click Next.
- Now we wait for the app to get installed and click FInish when it pops up.
- If you go to the status bar, you should be able to see the IPFS icon there, and if you right click on it, you should see this:
Congratulations! You have successfully installed the IPFS desktop application on your computer and now we can upload your website to it.
UPLOADING YOUR WEBSITE ON IPFS
Now that we have our IPFS desktop app installed and running, we now have to upload our website to it. To do this, which is relatively trivial, just follow the steps below:
- Create a file named index.html and fill it in with random text or you can just copy the code below into your file.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>How to upload your website on IPFS</title> </head> <body> <h1>Hello World</h1> </body> </html>
- Open the IPFS app and go to the Files page, which currently looks like this.
- Click the Import button at the top right and select File in the option that displays. Then navigate to the location of the index.html file we created previously and select it.
- When that is done, you should see this; then click the three dots beside your file and click the share link. This is the first option.
- You should see a modal pop-up with an option to copy. Copy the link and paste it in your browser.
It usually takes a few moments the first time but would eventually load on the browser. That’s it. You’ve successfully uploaded your website to IPFS.
If your page doesn’t show up and you receive an IPFS 504 Gateway Time Out error, one of the ways to fix it is to try downloading the IPFS browser extension to your browser. You can get the extension for your browser here.
Once installed, try reloading, and your website should be up and running.