I'm using IPFS to host a website and I need a way to keep the website files online all the time.

I know that ipfs has a garbage collector that removes the content after 24 hours.

And that if I pin the content with ipfs pin add <file> then it's like adding the file again so it's not deleted from the network.

Now my question is How do I keep my IPFS files online forever?

Can I create a cron job to keep re-pinning the content every 24 hours? or is there a better way?

  • The problem is that I was using other address when doing ipfs name public <hash> so yeah. It works. Aug 30, 2017 at 21:59

1 Answer 1


Once a piece of content is pinned, it is stored forever on your node until you explicitly unpin it. There is no need to pin a file more than once. If you pin a file, it never gets garbage collected like the files that are not pinned do.

From the IPFS Pinning Example:

A pinned object cannot be garbage collected, if you dont believe me try this:

ipfs add foo
ipfs repo gc
ipfs cat <foo hash>
  • I did pin the item and it doesn't work, the file still gets removed after a while Aug 27, 2017 at 8:08
  • If you need to pin only once, then why keep paying for services like pinnata?
    – PedroD
    Mar 30, 2022 at 16:23
  • @PedroD If you don't feel like running/maintaining your own node indefinitely that keeps your content pinned, you'll want to make sure someone else is willing to. A service like Pinata will do that for you. Mar 30, 2022 at 16:40
  • I have same issue, all files were pinned and now its not accessable. Stuck on collecting chinks of cat(cid) Apr 25, 2022 at 19:07

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.