# IPFS block consumes too much storage

**URL:** <https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059>\
**Category:** Help\
**Tags:** go-ipfs\
**Created:** [May 29, 2024, 8:21am UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059 "2024-05-29T08:21:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![0xNarumi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/0xnarumi/32/8611_2.png) [@0xNarumi](https://discuss.ipfs.tech/u/0xNarumi)\
**Post date:** [May 29, 2024, 8:21am UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/1 "2024-05-29T08:21:13Z")

</div>

I’m currently hosting my own ipfs on AWS EC2(ubuntu), and I’ve noticed that the IPFS block files are growing incredibly fast, taking up about 100 GB at the moment . It seems like the my instance is just seeding for the IPFS network, and I’d like to figure out how to stop that.

Thank you

```auto
  ipfs:
    image: ipfs/kubo:v0.14.0
    ports:
      - '5001:5001'
    volumes:
      - ./data/ipfs:/data/ipfs

```

this is the docker-compose file I am using right now.

---

<div class="post-metadata">

**Author:** ![hector](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/hector/32/178_2.png) [@hector](https://discuss.ipfs.tech/u/hector)\
**Post date:** [May 29, 2024, 8:27am UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/2 "2024-05-29T08:27:38Z")

</div>

First, upgrade to the latest kubo version.

Second, can you tell us specifically what folder in the .ipfs folder is growing and by what amount?

The instance does not store blocks that you didn’t add or retrieve.

---

<div class="post-metadata">

**Author:** ![0xNarumi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/0xnarumi/32/8611_2.png) [@0xNarumi](https://discuss.ipfs.tech/u/0xNarumi)\
**Post date:** [May 29, 2024, 8:34am UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/3 "2024-05-29T08:34:42Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/ipfs1/original/2X/0/0eb60538cb6f46ef5a8ccacceb6ef5f609b844cc.png)

`blocks` folder is about 60GB at the moment.

---

<div class="post-metadata">

**Author:** ![Jorropo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jorropo/32/3230_2.png) [@Jorropo](https://discuss.ipfs.tech/u/Jorropo)\
**Post date:** [May 29, 2024, 8:58am UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/4 "2024-05-29T08:58:48Z")

</div>

There is no code to do that.  
Usually when that happen it’s because you have a public unauthenticated gateway or API ports.

There are botnets scanning nodes on the network, finding ones who have open gateways and API ports and using them to store content.

If I read `- '5001:5001'` you are exposing the private Admin API port to anyone on internet.

You should also update your node, really.

---

<div class="post-metadata">

**Author:** ![0xNarumi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/0xnarumi/32/8611_2.png) [@0xNarumi](https://discuss.ipfs.tech/u/0xNarumi)\
**Post date:** [May 29, 2024, 9:12am UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/5 "2024-05-29T09:12:43Z")

</div>

Thank you so much for your answer. It really helps a lot.

I have one more simple question.

Can I just manually clean up the ipfs `blocks` folder to save up storage space?  
Will it break my current ipfs node?

---

<div class="post-metadata">

**Author:** ![Jorropo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jorropo/32/3230_2.png) [@Jorropo](https://discuss.ipfs.tech/u/Jorropo)\
**Post date:** [May 29, 2024, 9:14am UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/6 "2024-05-29T09:14:12Z")

</div>

the safe way is to do `ipfs repo gc`  
if there were pins that were added you can view them with `ipfs pin ls --type=recursive`, then remove them `ipfs pin rm` and finally `ipfs repo gc` to clean it up

---

<div class="post-metadata">

**Author:** ![0xNarumi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/0xnarumi/32/8611_2.png) [@0xNarumi](https://discuss.ipfs.tech/u/0xNarumi)\
**Post date:** [May 29, 2024, 3:20pm UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/7 "2024-05-29T15:20:03Z")

</div>

I have uploaded some codes to IPFS.  
Will it be matter if I run `ipfs pin rm`?

---

<div class="post-metadata">

**Author:** ![Jorropo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/jorropo/32/3230_2.png) [@Jorropo](https://discuss.ipfs.tech/u/Jorropo)\
**Post date:** [May 29, 2024, 4:08pm UTC](https://discuss.ipfs.tech/t/ipfs-block-consumes-too-much-storage/18059/8 "2024-05-29T16:08:50Z")

</div>

`ipfs pin rm` takes a CID as argument.  
Don’t remove your own pins, however if you find pins that shouldn’t be there remove them.
