Filecoin web3.storage Tutorial: Store & Retrieve Files on Web3 (2025 Guide)

9 min read

Filecoin web3.storage tutorial — decentralized IPFS and Filecoin storage network visualization
  • Key Takeaway: web3.storage has evolved — the legacy web3.storage npm package is deprecated as of January 2024. The current tool is the @web3-storage/w3up-client package, now powered by the Storacha network.
  • Every file you upload gets a unique Content Identifier (CID) — a cryptographic fingerprint that never changes, no matter where the file lives.
  • Your data is pinned on IPFS immediately and backed by Filecoin storage providers, giving you redundant, verifiable storage without running your own node.
  • Retrieval is as simple as opening a browser link — no wallet, no gas fees, no special software needed for end users.
  • Crypto miners moving into Web3 development can use Filecoin storage as a foundation for dApps, NFT projects, and decentralized data pipelines.

The Filecoin web3.storage tutorial covers how to upload and retrieve files on the Filecoin and IPFS networks using web3.storage — a developer-friendly service that abstracts away the complexity of decentralized storage deals into a simple API. You upload a file, get back a CID, and that content becomes retrievable from any IPFS gateway in the world.


What Is Filecoin and How Does web3.storage Fit In?

Filecoin is a decentralized peer-to-peer storage network built by Protocol Labs. Instead of paying Amazon or Google to store your files on their servers, you pay storage providers on an open market — anyone in the world who has pledged disk space and proven they are storing your data correctly.[1] Storage providers post collateral and submit daily cryptographic proofs to the Filecoin blockchain to confirm your data is still safely stored. If they fail those proofs repeatedly, their collateral gets burned. That economic pressure is what makes Filecoin storage reliable without a central authority watching over it.

web3.storage started as a free on-ramp service, built by Protocol Labs, that handled all the messy parts of Filecoin storage deals for you. You gave it a file; it handled packaging, deal-making with multiple storage providers, and IPFS pinning — all behind a clean API. In 2024, the original web3.storage API was deprecated and replaced by the w3up protocol, now running on a community-driven network called Storacha. The service still lives at console.web3.storage, but the client library changed significantly. If you see tutorials using npm install web3.storage with a client.put() method — those are outdated. This guide covers the current approach.

IPFS vs. Filecoin: Two Pieces of One Puzzle

IPFS (InterPlanetary File System) is a peer-to-peer network that lets any node store and serve content addressed by its hash. It is fast, open, and censorship-resistant — but it does not guarantee your data stays online. If no node is actively pinning your file, it eventually disappears. Filecoin solves this by adding an incentive layer on top of IPFS. Storage providers are paid in FIL tokens to keep your data, and they prove it cryptographically on every epoch.[2]

web3.storage combines both: your file gets pinned to IPFS immediately for fast retrieval and is simultaneously staged for Filecoin storage deals with multiple geographically distributed providers. You get the speed of IPFS and the persistence guarantees of Filecoin through a single API call. Think of IPFS as the delivery network and Filecoin as the long-term vault that pays people to guard your data.

GoalBest ApproachTool
Quick upload, no codeWeb UI drag-and-dropconsole.web3.storage
Upload files from Node.js appw3up-client JS library@web3-storage/w3up-client
Upload from command linew3 CLI tool@web3-storage/w3cli
Upload from non-JS environmentHTTP API with curlup.web3.storage
CI/CD pipeline storageGitHub Actionadd-to-web3@v3
Retrieve a file in browserPublic IPFS gatewayw3s.link/ipfs/<CID>

Filecoin web3.storage Tutorial: Step-by-Step Node.js Guide

The following steps use the current @web3-storage/w3up-client package — the official, supported client for web3.storage in 2025. All uploads through this client are linked to a unique Space, which is your personal namespace on the network, identified by a Decentralized Identifier (DID).[3] You do not need to manage private keys manually — the client handles key generation locally and ties your Space to your email address for recovery.

Step 1 — Create Your Account and Space

Go to console.web3.storage and sign up using your email or a GitHub account. Once logged in, create a new Space. A Space acts like a storage bucket — it is the namespace that all your uploads live under. You can create multiple Spaces for different projects. After registration, your Space delegates storage capabilities to your local Agent (an automatically generated key pair on your machine), so you do not need to paste API tokens into your code.

Step 2 — Install the w3up Client

In a new Node.js project folder, run the following to initialize and install the required packages:

npm init -y
npm install @web3-storage/w3up-client files-from-path

The files-from-path helper reads files from your local filesystem and formats them correctly for upload. Node.js 18 or higher is recommended. If you are using TypeScript, full type definitions are included out of the box.

Step 3 — Upload a File Using Node.js

Create a file called upload.mjs and add the following code. This is the official w3up pattern — you log in with your email, create a client, and call uploadDirectory() to push your files and receive a root CID:

import { filesFromPaths } from 'files-from-path'
import * as Client from '@web3-storage/w3up-client'

const [,, yourEmail, pathToAdd] = process.argv

// Create client and authorize local agent
const client = await Client.create()
await client.login(yourEmail)

// Collect files and upload
const files = await filesFromPaths([pathToAdd])
const cid = await client.uploadDirectory(files)

console.log(`IPFS CID: ${cid}`)
console.log(`Gateway URL: //w3s.link/ipfs/${cid}`)

Run the script with:

node upload.mjs your@email.com ./path/to/your/file-or-folder

The first time you run this, you will receive a verification email. Click the link to authorize your local Agent. After that, the same machine can upload without re-verifying. The script prints a root CID — that is your permanent, content-addressed identifier for this upload. The CID will never change as long as the content stays the same. If you modify the file, you get a new CID.

Step 4 — Retrieve Your File via IPFS Gateway

Once the upload completes, your file is immediately available through any public IPFS gateway. The fastest is the dedicated w3s.link gateway:

https://w3s.link/ipfs/YOUR_CID

You can also use the universal dweb.link gateway:

https://dweb.link/ipfs/YOUR_CID/filename.txt

If you uploaded a directory, the root CID points to the directory listing. Add a slash and the filename to link directly to a specific file inside it. Within 48 hours, Storacha automatically creates Filecoin storage deals with multiple geographically distributed providers — so your file has long-term persistence backed by cryptographic proofs, not just a pinning promise.


Understanding Content IDs (CIDs) and Why They Matter

A Content Identifier (CID) is a cryptographic hash of your file’s content. It is generated locally in your browser or Node.js process before anything is sent to a server — which means you can verify the service stored exactly what you asked it to store, byte for byte.[4] This is a fundamental difference from Amazon S3 or Google Cloud Storage, where a URL is just a pointer to wherever their servers decide to put your file. CIDs are location-independent — the same file hosted on 50 different nodes around the world has the same CID.

CIDs make data tamper-proof. If someone changes a single byte in the file, the CID changes completely. There is no way to silently swap content under a CID, which makes them ideal for NFT metadata, legal records, scientific data archives, and anything else where data integrity matters. This property is also why the Filecoin network can run its proof system — storage providers prove they hold a specific CID’s content, and the network verifies that proof on-chain without needing to re-download the file.

“Filecoin really brings for the first time the ability to have a large-scale application to be fully Web 3.0-native, so you can do things like video streaming or entire social networks — those kinds of applications are now possible in a Web 3.0 environment.”

— Juan Benet, Founder & CEO of Protocol Labs, as quoted by Forkast.News

Filecoin vs. Traditional Cloud Storage: A Practical Comparison

Miners and developers comparing decentralized storage to familiar services like AWS S3 need to understand both the advantages and the tradeoffs. Filecoin is not a drop-in replacement for every cloud storage use case today, but for specific scenarios — public data, NFTs, archival storage, censorship-resistant content — it offers properties centralized providers simply cannot match.

FeatureFilecoin / web3.storageAWS S3 / Google Cloud
Data addressingContent-addressed (CID — hash-based)Location-addressed (URL)
Data integrityCryptographically verifiableTrust-based (provider guarantee)
Censorship resistanceHigh — no single point of controlLow — provider can delete or block
Link permanenceCID never changesURL can break if server moves
PrivacyAll data is public — encrypt before uploadingPrivate buckets available
CostFree via web3.storage (within limits)Pay-per-GB with egress fees
Retrieval speedFast via hot storage gatewaysVery fast, global CDN
ControlUser-owned via DID/UCAN keysProvider-controlled account

One critical thing to keep in mind: all data stored on web3.storage is publicly accessible to anyone who has the CID. Do not upload sensitive or private data without encrypting it first. This is not a bug — it is a core feature of the content-addressed model. Encryption happens on your end, before the CID is generated.


How Chia Network Miners Can Leverage Filecoin and web3.storage

If you are already farming Chia, you understand the value of storage as infrastructure. You have hard drives, you have a feel for disk economics, and you have watched proof-based systems work in practice. That background translates directly into understanding Filecoin — and it gives you an edge as a Web3 developer that most software engineers do not have.

Miners transitioning into dApp development often need to store off-chain data — think NFT images, game assets, user-generated content, or scientific datasets — without running their own servers. web3.storage gives you a free, production-ready path to do exactly that, using the same underlying principles you already work with every day.

Parallels Between Chia and Filecoin Storage Concepts

Chia and Filecoin share more conceptual DNA than most people realize. In Chia’s Proof of Space and Time model, farmers prove they are storing specific plot data by responding to challenges with cryptographic proofs — the network verifies you actually hold the space you claim. Filecoin’s Proof of Replication (PoRep) and Proof of Spacetime (PoSt) do the same thing: storage providers prove, on every epoch, that they are still holding exactly the data they committed to storing.[5]

On the application layer, Chia’s coin model uses puzzles with content-addressed spend conditions — a coin is identified by what it contains, not where it lives. Filecoin’s CID system is the storage equivalent: a file is identified by what it is, not where it is stored. Chia’s DataLayer even uses CIDs to publish verifiable off-chain data stores on the Chia blockchain, making Filecoin and Chia natural companions in a full Web3 application stack. If you are exploring how Chia fits into a broader decentralized infrastructure vision, see our overview of Polyhedra Network and scalable Web3 solutions for additional context on how Layer 0 protocols like these interconnect.


Real-World Use: NFT Metadata and Immutable Asset Storage

One of the most common applications of the Filecoin web3.storage workflow is NFT metadata storage. When an NFT smart contract points to a URL for its image or attributes, that URL can break if the server shuts down. Studies have found that roughly 20% of sampled NFTs already have broken or expired metadata links — a serious problem for digital ownership.[6] By uploading NFT metadata to web3.storage and referencing the CID in the contract instead of an HTTPS URL, the link becomes permanent. Even if the original creator walks away from the project, anyone who cares about the NFT can pin the content from their own IPFS node and keep it alive. Projects using this approach include music streaming platforms, gaming asset systems, and decentralized social media archives that need verifiable, tamper-proof content references.


Conclusion

The Filecoin web3.storage tutorial is a practical entry point into decentralized storage that pays off fast. You get content-addressed, cryptographically verifiable file storage backed by the Filecoin network — and you get it through a clean JavaScript API that takes minutes to wire up. The key shift to make in 2025 is moving away from legacy tutorials using the old web3.storage npm package and adopting the current @web3-storage/w3up-client (w3up) pattern with Spaces and DID-based authorization. If you are a Chia farmer who has already spent time thinking about proofs, disk economics, and decentralized infrastructure, this is familiar territory — just a different network. Start with a simple upload, inspect your CID, open it in a gateway, and you will have a working foundation to build on. The code is open source, the storage is free to start, and the data stays yours.


filecoin web3.storage tutorial FAQs

What is the Filecoin web3.storage tutorial used for?

The Filecoin web3.storage tutorial shows developers how to upload files to the Filecoin and IPFS networks using a simple JavaScript API and receive a permanent Content Identifier (CID) for retrieval. It is commonly used for NFT metadata storage, dApp asset hosting, and censorship-resistant data publishing.

Is the old web3.storage npm package still working in 2025?

The legacy web3.storage npm package was deprecated in January 2024 and no longer accepts new uploads. You should use the current @web3-storage/w3up-client package instead, which is actively maintained by the Storacha team and works with the same web3.storage console.

How do I retrieve a file I stored using the Filecoin web3.storage tutorial?

To retrieve a file from the Filecoin web3.storage tutorial workflow, open any public IPFS gateway using your CID — for example, https://w3s.link/ipfs/YOUR_CID — in any browser. No wallet, no login, and no special software is required on the retrieval side.

Is data stored on web3.storage private?

No — all data uploaded to web3.storage is publicly accessible to anyone who has the CID. You should encrypt sensitive files before uploading if privacy is required, since the content-addressed model is designed for public data sharing and verifiability.

What is a CID and why does it matter for decentralized storage?

A CID (Content Identifier) is a cryptographic hash of a file that serves as its permanent, location-independent address on IPFS and Filecoin. It matters because it makes data tamper-proof — if a single byte changes, the CID changes — enabling verifiable storage proofs without needing to re-download or trust a central server.


filecoin web3.storage tutorial Citations

  1. Filecoin Docs — What is Filecoin
  2. Protocol Labs — Introducing web3.storage: A Simple Interface for Filecoin Storage
  3. Storacha / w3up — GitHub Repository (w3up Protocol Implementation)
  4. Filecoin Blog — Cloud Storage Services: Understanding the Decentralized Storage Approach
  5. Filecoin Spec — IPLD, CIDs, and Proof of Replication
  6. Nadcab Labs — What Is Content Addressing? IPFS & Decentralized Storage
  7. Forkast.News — Exclusive: Juan Benet’s First Interview Since Filecoin Launch
  8. Filecoin Blog — Introducing NFT.Storage: Free Decentralized Storage for NFTs