Spin up js-ipfs with same private key every time

Hi everyone,

I’m developing some app that uses IPFS to store some images. For that I use my own js-ipfs node in a express app. This runs on heroku, but every time it restarts it makes a new node. Is there a way to restore the node if the script crashes ? It is important that i always push to the same folder, and now it just spins up a new node and makes a new folder cause it cant find the previous one …

I have found I can use IPFS.create({privateKey: myprivatekey}) and i’ve pasted my local desktop private key in there but it doesnt seem to log in with that.

Any help is welcome !