What You Will Build
In this tutorial, you will:
Step 1: Install IPFS Kubo
Kubo (formerly go-ipfs) is the reference IPFS implementation. Download the latest release from dist.ipfs.tech, extract, and run the install script. Verify with: ipfs --version.
Step 2: Initialize Your Node
Run ipfs init to create your node identity (a key pair) and the local IPFS repository at ~/.ipfs.
Step 3: Start the Daemon
Run ipfs daemon. Your node connects to the IPFS network and begins discovering peers. You can access the web UI at http://localhost:5001/webui.
Step 4: Add a File
In a new terminal, create a text file and add it to IPFS with ipfs add. The command returns a CID (Content Identifier), a cryptographic hash of the file content, starting with Qm.
Step 5: Retrieve the File
Retrieve the file using its CID: ipfs cat . Anyone on the IPFS network with this CID can retrieve the same file from any node that has it.
Step 6: Add a Directory
Use ipfs add -r to add an entire directory. This returns CIDs for each file and the directory itself.
Understanding Pinning
By default, IPFS may garbage-collect files you have retrieved but not explicitly pinned. Pinning tells your node to keep a file permanently:
- Pin a file: ipfs pin add
- List pinned files: ipfs pin ls
- Unpin a file: ipfs pin rm
Using Public Gateways
Even without running a local node, anyone can access IPFS content through public gateways like ipfs.io, dweb.link, or gateway.pinata.cloud. Gateways act as HTTP bridges to the IPFS network, making content accessible via a standard web browser.
IPFS Desktop
For a graphical interface, install IPFS Desktop. It provides:
- A visual file manager for your IPFS node
- Drag-and-drop file adding
- Peer connection monitoring
- CID inspection and exploration
Pinning Services
For content that must remain available even when your node is offline, use a pinning service:
- Pinata: Popular, developer-friendly pinning service
- Web3.Storage: Free tier available, backed by Filecoin
- Infura: Enterprise-grade IPFS infrastructure
Key Takeaways
- IPFS addresses content by its hash, not its location
- Any node can serve any content it has cached
- Pinning ensures your content persists on your node
- Public gateways bridge IPFS and the traditional web
- Pinning services provide persistent availability without running your own infrastructure
IPFS fundamentally changes how we think about data storage and retrieval, moving from centralized servers to a distributed, content-addressed network that pairs naturally with mesh radio technologies.