Overview
This template provides a production‑ready IPFS node as a Monk runnable. You can:- Run it directly to join the IPFS network and store/retrieve files
- Inherit it in your own Web3 infrastructure for decentralized file storage
What this template manages
- IPFS daemon (go-ipfs or Kubo)
- HTTP Gateway for web access
- API server
- Peer-to-peer networking
- Content-addressed storage
- API on port 5001, Gateway on port 8080
Quick start (run directly)
- Load templates
- Run IPFS node
- API:
http://localhost:5001 - Gateway:
http://localhost:8080 - WebUI:
http://localhost:5001/webui
- Customize configuration
variables. To customize:
- Preferred: inherit and override variables as shown in the inheritance section below.
- Alternative: fork/clone and edit the variables in
ipfs.yaml, thenmonk load MANIFESTand run.
Configuration
Key variables you can customize in this template:${monk-volume-path}/ipfs on the host.
Use by inheritance (recommended for Web3)
Inherit the IPFS runnable in your application and declare a connection. Example:Ports and connectivity
- Service:
ipfson TCP port5001(API) and8080(Gateway) - P2P: TCP/UDP port
4001(Swarm) - WebUI:
http://localhost:5001/webui - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the IPFS host.
Persistence and configuration
- Data path:
${monk-volume-path}/ipfs:/data/ipfs - All pinned content and configuration are persisted to the host volume.
Features
- Content-Addressed Storage: Files identified by cryptographic hashes (CIDs)
- Decentralized: No central server, peer-to-peer network
- Permanent: Content stays available as long as someone hosts it
- Versioning: Built-in versioning with IPLD
- HTTP Gateway: Access IPFS content via HTTP
- Pinning: Keep content available permanently
- Pub/Sub: Real-time messaging between nodes
- IPNS: Mutable pointers to IPFS content
Adding Files to IPFS
CLI:Retrieving Files
JavaScript Integration
IPNS (Mutable Names)
Publish mutable references:Pinning Services
Integrate with pinning services for reliability:- Pinata: https://pinata.cloud/
- Infura: https://infura.io/
- Web3.Storage: https://web3.storage/
Use cases
IPFS excels at:- Decentralized websites and dApps
- NFT metadata and asset storage
- Distributed file sharing
- Content distribution networks (CDN alternative)
- Archival and backup
- Censorship-resistant publishing
- Web3 applications
Related templates
- See other templates in this repository for complementary services.
- Combine with monitoring tools for observability.
Troubleshooting
- Access WebUI at
http://localhost:5001/webuito monitor node status and manage content. - Check node status:
- Check logs:
- Connectivity issues: Verify port 4001 is accessible, check firewall rules for P2P traffic, and ensure NAT traversal is working.
- Slow retrievals: Connect to more peers using the swarm commands or check network connectivity.
- Storage issues: Increase
repo-size-limitvariable or clear unused data withipfs repo gc. - Bandwidth monitoring: Use the WebUI to monitor bandwidth usage and connected peers.
- Ensure the host volume is writable by the container user.