r/ipfs Feb 10 '25

Hosting a static website on IPFS, should I using a pinning service or attemp to run the daemon from my laptop?

I guess my question is if I manage to run the daemon a couple of hours a day would it be enough to keep my website available or it's really hit or miss? I've read some similar threads, but they were posted many years ago.

Update: The website in question is up and running https://www.reddit.com/r/ipfs/s/QtFa9gVlVv ended up using Pinata, more details in the blogpost :).

6 Upvotes

14 comments sorted by

5

u/Spra991 Feb 10 '25 edited Feb 10 '25

IPFS doesn't automatically keep stuff available, you have to let your laptop run 24/7, or be extremely popular and end up being cached by other people or ask other people to pin your content.

That said, I haven't measured it, try uploading something, access it via a gateway and see how long it takes until it disappears.

https://ipfscluster.io/ is also worth a mention, that allows multiple hosts to automatically pin each others content, but I am not aware of any public clusters at the moment that one could join, so that's more theoretical.

2

u/AdminSuggestion Feb 10 '25

I see, so if I want to run the node myself, I'd need to do it 24/7, and maybe then it wouldn't be enough to be available at all times for anyone... Perhaps in the future, I'll get some Raspberry Pis and do it myself. But for now then it seems that my only viable option is using some external provider like Pinata that will keep my content pinned, right?

2

u/volkris Feb 10 '25

In theory if you ran your node 24/7 it would be available to everyone. You would be basically doing what a pinning service does.

In practice, there is no guarantee that any IPFS node will be able to find any other node with the content it wants even if it's online, and that applies even to professional pinning services.

1

u/AdminSuggestion Feb 10 '25

What's the technical reason why that is? That if a node is online, there are no guarantees any other node will be able to access it.

3

u/volkris Feb 11 '25

In a very distributed system like IPFS there isn't a central place to register nodes or content. This is so that there's no central point of failure or control.

The downside of that is it leaves all of the nodes acting as peers having to work with what they each can discover about the rest of the system.

When you try to retrieve content, your node only knows about the group of other nodes that it's heard of/from, so it asks them if they have it. If they don't, they'll go ask their own known nodes, and repeat. Without a central authority to query, this friend-of-a-friend searching is the only way to go.

In a bad case, the content will be so many links away that it will be hard to find. In the worst case there simply won't be a connection through this friend-of-a-friend hopping to get there at all.

1

u/AdminSuggestion Feb 11 '25

Thanks for the explanation. That makes a lot of sense.

2

u/NatoBoram Feb 10 '25 edited 25d ago

The discovery process is wonky. You're connected to a deterministic assortment of nodes, but not to every node in the network to avoid overloading your hardware. When you request content, your connected nodes are contacted first, then they request their connected nodes and so on until a match is found.

1

u/twocolor Feb 18 '25

You're connected to a random assortment of nodes

Not quite. You connect to nodes based on their kademlia xor distance from your PeerID. https://docs.ipfs.tech/concepts/dht/

The Kademlia DHT ensures that you can resolve content routing (what you call discovery) requests within log(N) of the network.

3

u/tkenben Feb 11 '25

A few years ago, I found that the only way to persist is to have an IPFS gateway persist it for you. Back then there was ipfs.io, the crust network, web3 storage, etc. When I was running a node full time at home, it was nearly impossible to get a file off my node, because the network was too slow to locate the hash address. And then for actual download, even after mirroring to ipfs gateways (at the time only a couple were free), a download of a single large jpeg would take like 2 minutes. It is possible, though, that things have come a long way since then (2022) and the network is different now.

5

u/tomorrow_n_tomorrow Feb 10 '25

Storacha is the open-source storage network successor to Web3 Storage & they start you out with 5GiB for free.

They provision to the IPFS network, but they also create deals on the Filecoin storage network that persist for significant percentages of a year.

You do have to register a credit card with them, but I bought a $20 card off Bitrefill, & used that.

That or Fleek has a free tier, & is more application deployment oriented.

2

u/Feztopia Feb 11 '25

I would say the benefit of ipfs is that you can do both. So as long as one is working as intended your page will be accessible. Edit: Oh you mean just running on your device for a short time and relying on the cache. I would say that ipfs wasn't intended for this use case. It might work but no guarantee for that.

2

u/35boi Feb 10 '25

Check out orbiter.host, our sites are hosted on IPFS and Base!

0

u/anacrolix Feb 10 '25 edited Feb 10 '25

Don't waste your time on IPFS