Ghost IPFS Storage Adapter

Learn how to configure Ghost IPFS Storage Adapter for use with Filebase.

What is Ghost IPFS Storage Adapter?

Ghost is an open-source, headless CMS tool that can be used to host websites and blogs. The IPFS storage adapter can be configured to pin Ghost’s files and content to IPFS.

Read below to learn how to use Ghost IPFS Storage Adapter with Filebase.

Prerequisites:

1. In your Ghost root directory, install the ghost-ipfs adapter package using NPM or Yarn:

npm install ghost-ipfs --save

or

yarn add ghost-ipfs

2. Create a directory for the storage adapter:

mkdir -p content/adapters/storage

3. Then, move the files for the ghost-ipfs adapter into the storage folder:

mv node_modules/ghost-ipfs content/adapters/storage/ghost-ipfs

4. Alternatively, you can install the adapter using git:

git clone content/adapters/storage/ghost-ipfs

You can also install this adapter if you are using a Docker containerized version of Ghost. Check out the GitHub Repo for the IPFS adapter for more information.

5. Next, open the ./config.production.json file. Insert the following code to configure your connection to Filebase:

{
  // ...
  "storage": {
    "active": "ghost-ipfs",
    "ghost-ipfs": {
      "defaultStorage": "filebase",
      "filebase": {
        "key": "FILEBASE_KEY",
        "secret": "FILEBASE_SECRET",
        "bucket": "FILEBASE_BUCKET"
      }
    }
  }
  // ...
}

Replace the following values:

  • FILEBASE_KEY: Your Filebase Access Key

  • FILEBASE_SECRET: Your Filebase Secret Key

  • FILEBASE_BUCKET: Your Filebase Bucket Name

You can alternatively save these values as environment variables and reference them accordingly if you plan to back up your Ghost instance to a public storage solution like GitHub.

Last updated