# IPFS: How to relocate /home/.ipfs/blocks folder

**URL:** <https://discuss.ipfs.tech/t/ipfs-how-to-relocate-home-ipfs-blocks-folder/9808>\
**Category:** Help\
**Created:** [January 12, 2021, 1:54am UTC](https://discuss.ipfs.tech/t/ipfs-how-to-relocate-home-ipfs-blocks-folder/9808 "2021-01-12T01:54:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeehi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/yeehi/32/2760_2.png) [@yeehi](https://discuss.ipfs.tech/u/yeehi)\
**Post date:** [January 12, 2021, 1:54am UTC](https://discuss.ipfs.tech/t/ipfs-how-to-relocate-home-ipfs-blocks-folder/9808/1 "2021-01-12T01:54:36Z")

</div>

This folder can become enormous as you increase the number of files pinned with ipfs-desktop.

On GNU+Linux with the ipfs-desktop appimage, what is the best way to have this folder set to a different location / on a different drive?

---

<div class="post-metadata">

**Author:** ![markg85](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@markg85](https://discuss.ipfs.tech/u/markg85)\
**Post date:** [January 12, 2021, 9:34am UTC](https://discuss.ipfs.tech/t/ipfs-how-to-relocate-home-ipfs-blocks-folder/9808/2 "2021-01-12T09:34:23Z")

</div>

Stop IPFS.  
Move your folder to wherever you want.  
Create a symbolic link like so: `ln -s /your/new/path/to/blocks ~/.ipfs/blocks`  
Start IPFS.

That should be pretty much it.

An alternative way is to use use mounting where you can still put your folder wherever you want. You’d just get a “mount bind” (more info [here](https://serverfault.com/questions/67038/how-do-i-mount-sub-directory-to-a-hard-drive-in-linux)). I’d just go for the link way as that’s much easier in my opinion.

Note that linking is persistent (aka, it survives a reboot). Mounting isn’t unless you modify `fstab` to make it persistent.

---

<div class="post-metadata">

**Author:** ![yeehi](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/yeehi/32/2760_2.png) [@yeehi](https://discuss.ipfs.tech/u/yeehi)\
**Post date:** [January 12, 2021, 11:00am UTC](https://discuss.ipfs.tech/t/ipfs-how-to-relocate-home-ipfs-blocks-folder/9808/3 "2021-01-12T11:00:34Z")

</div>

> [@markg85](#):
>
> ~/.ipfs/blocks

Thanks!

ipfs-desktop ought to support making this change using the GUI. That should be included in its next update. It ought to be possible to do this without needing a symbolic link. Also, when ipfs-desktop first launches, the user ought to be prompted where this (potentially large) folder will be stored. It would probably be best to move the whole .ipfs folder to keep things together.

---

<div class="post-metadata">

**Author:** ![markg85](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@markg85](https://discuss.ipfs.tech/u/markg85)\
**Post date:** [January 12, 2021, 11:17am UTC](https://discuss.ipfs.tech/t/ipfs-how-to-relocate-home-ipfs-blocks-folder/9808/4 "2021-01-12T11:17:22Z")

</div>

Glad it worked 🙂

You can change it another way too. One that doesn’t require the link at all (and not a mount either).  
Have you read the readme from here: [go-ipfs/README.md at master · ipfs/go-ipfs · GitHub](https://github.com/ipfs/go-ipfs/blob/master/README.md)?  
I didn’t, but i just found this part:

```nohighlight
  ipfs uses a repository in the local file system. By default, the repo is located at
  ~/.ipfs. To change the repo location, set the $IPFS_PATH environment variable:

    export IPFS_PATH=/path/to/ipfsrepo

```

So you can set the `IPFS_PATH` environment variable in linux. The best way to do that is a bit different between linux distributions so i leave it up to you to figure out the way that works for you.

Once you’ve set the path, you can just remove that symbolic link. You can do that using `rm <link>` but to have a more “safe feeling” (as rm can remove anything) you can also use `unlink <link>` which only works on symbolic links.

---

<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:** [January 12, 2021, 12:20pm UTC](https://discuss.ipfs.tech/t/ipfs-how-to-relocate-home-ipfs-blocks-folder/9808/5 "2021-01-12T12:20:47Z")

</div>

For reference, the procedure is documented: [https://docs.ipfs.io/how-to/move-ipfs-installation/](https://docs.ipfs.io/how-to/move-ipfs-installation/)
