Skip to content
A CLI to co-host websites published to IPFS
JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

ipfs-cohost 🌐🤝

A CLI to co-host websites published to IPFS.

If your domain has a DNSlink to a CID, then ipfs-cohost will let others pin it to their IPFS node.


Pass it the list of domains you want to cohost. It finds the CID from the DNSLink for that domain, and pins it to your local IPFS node.

$ ipfs-cohost
🔌 Using local ipfs daemon via http api
🔍 Finding DNSLinks for 3 domains
🔗         QmXZz6vQTMiu6UyGxVgpLB6xJdHvvUbhdWagJQNnxXAjpn 11.5 MB
🔗    QmXrsvjeZeH6rCzgQSJycKq9fFqNgkptTqYRexzaNy4wx3 6.59 MB
🔗 QmdgXaAryZpe3vQcHyhzk5kowbgxvY3XaGTYvYAhoBrHLm 7.45 MB
📦 Total size 25.6 MB for 3 domains
📍 Pinned
📍 Pinned
📍 Pinned
🤝 Co-hosting 3 domains via IPFS.

Passing the --no-pin flag you can find the total size but skip pinning it.

$ ipfs-cohost --no-pin
🔌 Using local ipfs daemon via http api
🔍 Finding DNSLinks for 2 domains
🔗             QmVJL1ew9ytqZGR7Tg121tHEXPwbYVNxzHked3QzVgWEzD 10.6 GB
🔗 QmT5NvUtoM5nWFfrQdVrFtvGfKFmG7AHE8P34isapyhCxX 14.9 GB
📦 Total size 25.5 GB for 2 domains

Passing the --silent options will prevent any logging.

$ ipfs-cohost --silent

Could you do this with a few lines of bash?

Yes. That is how this command started it's life. You do not need ipfs-cohost to co-hosts websites; the ipfs command can do it all!

$ ipfs object stat /ipns/ | grep CumulativeSize
CumulativeSize: 6591536

$ ipfs pin add /ipns/
pinned QmXrsvjeZeH6rCzgQSJycKq9fFqNgkptTqYRexzaNy4wx3 recursively


With node >= 10.15 and npm > 6.9 installed , you can install ipfs-cohost via npm

# install it
$ npm i -g ipfs-cohost

# run it
$ ipfs-cohost

You can run the latest version of ipfs-cohost without explicitly installing it via npx

$ npx ipfs-cohost
You can’t perform that action at this time.