
IPFS Explained — Upload and Retrieve Files on the Decentralized Web
IPFS (InterPlanetary File System) is the backbone of decentralized storage in Web3. Learn how to install IPFS, add files to the network, retrieve them by hash, and pin them so they don't disappear.
What Is IPFS?
IPFS (InterPlanetary File System) is a peer-to-peer distributed file system that stores and retrieves content by its cryptographic hash rather than by location (like a URL).
Instead of asking "where is this file?", IPFS asks "what is this file?" — a content hash never changes, so you always get exactly what you requested. This is the foundation of NFT metadata storage, decentralized websites, and Web3 data permanence.
Install IPFS (Kubo — Go Implementation)
Linux/Ubuntu
wget https://dist.ipfs.tech/kubo/v0.27.0/kubo_v0.27.0_linux-amd64.tar.gz
tar -xvzf kubo_v0.27.0_linux-amd64.tar.gz
cd kubo
sudo bash install.sh
Verify:
ipfs --version
Initialize Your IPFS Node
ipfs init
This creates your node identity and config at ~/.ipfs/.
Your Peer ID (like an address on the IPFS network) is shown in the output.
Start the IPFS Daemon
ipfs daemon
Leave this running in a terminal (or run it as a systemd service).
Add a File to IPFS
ipfs add myfile.txt
Output:
added QmXyz123... myfile.txt
The QmXyz123... string is your file's Content Identifier (CID). This is how anyone on IPFS can retrieve your file.
Add a Folder
ipfs add -r ./my-folder/
This adds all files recursively and returns a CID for the folder root.
Retrieve a File by CID
ipfs cat QmXyz123...
This fetches and prints the file contents. To save it:
ipfs get QmXyz123... -o ./output-file.txt
Access Files via HTTP Gateway
If the IPFS daemon is running locally:
http://localhost:8080/ipfs/QmXyz123...
Via a public gateway (no local node required):
https://ipfs.io/ipfs/QmXyz123...
https://cloudflare-ipfs.com/ipfs/QmXyz123...
Public gateways are useful for sharing links with people who don't run IPFS nodes.
Pinning — Keep Files Available
By default, IPFS may garbage-collect files that aren't pinned. Pin a file to keep it:
ipfs pin add QmXyz123...
List your pinned files:
ipfs pin ls
Remove a pin:
ipfs pin rm QmXyz123...
Remote Pinning (Persistent Storage)
Your local node must stay online for files to be available. For permanent storage, use a pinning service:
- Pinata — pinata.cloud — Most popular for NFTs
- web3.storage — web3.storage — Free tier available
- Infura IPFS — infura.io/product/ipfs
These services keep your files pinned even when your node is offline.
IPFS in Web3 Context
NFT Metadata Example
Most NFT projects store metadata on IPFS:
{
"name": "My NFT #1",
"description": "A unique digital asset",
"image": "ipfs://QmXyz123.../image.png",
"attributes": [...]
}
The ipfs:// URI scheme ensures the metadata is content-addressed and tamper-proof.
Upload Metadata with Node.js
const { create } = require("ipfs-http-client");
const client = create({ url: "http://localhost:5001" });
const metadata = JSON.stringify({
name: "My NFT #1",
description: "IPFS-stored metadata",
image: "ipfs://QmImageHash..."
});
const result = await client.add(metadata);
console.log("CID:", result.path);
// → QmMetadataHash...
Quick Reference
| Goal | Command |
|---|---|
| Initialize node | ipfs init |
| Start daemon | ipfs daemon |
| Add file | ipfs add file.txt |
| Add folder | ipfs add -r ./folder/ |
| Retrieve by CID | ipfs cat QmXyz... |
| Save locally | ipfs get QmXyz... -o output |
| Pin file | ipfs pin add QmXyz... |
| List pins | ipfs pin ls |
| Check node info | ipfs id |
| Check peers | ipfs swarm peers |
IPFS is the foundation of most decentralized storage strategies in Web3 — understanding how it works is essential for anyone building dApps, NFT platforms, or censorship-resistant applications.
Also featured on TechDerks Insights
I write more takes like this one on my second blog — blockchain deep dives, security breakdowns, and builder tools.
Read more on TechDerks InsightsDerrk Samuel
Web3, crypto, and Linux PC insights — practical guides, security tips, mining setups, blockchain tools, and decentralized tech strategies for techs.
Related Articles

Run an Ethereum Node with Docker and Geth — Complete Setup Guide
Solana Web3.js Quickstart — Connect, Check Balances, and Send SOL

Run a Full Kaspa Node on Ubuntu Server (No GUI) and Mine It — Complete Command-Line Guide
Discussion
Leave a comment
No comments yet. Be the first to start the discussion!