Menu
Storage and sites
Store files and folders on IPFS, serve them at a gateway address and at your own hostnames, publish a new version, take it down.
Storage keeps your files and folders by their content address (a CID) as several copies, each at a different storage provider, and serves them over HTTPS: at a gateway address, and at hostnames of your own domains. A folder with an index.html at its root is a website.
Everything here works from the weird command line, from an AI assistant through the MCP server, or straight through the API.
Switch storage on (once)#
Before the first upload, read where your copies may be kept and agree to it. The location notice says which regions the storage providers may be in (by default the European Economic Area only).
$ weird storage notice$ weird storage enable
weird storage enable shows the notice, asks you to agree, and switches storage on. Enabling is charged once, per copy your account keeps (two by default); calling it again charges nothing.
Credit charge: see the credit charges (contract ipfs.storage-enable per_data_set)
Charged once when storage is switched on, times the number of copies.
Upload a file or a folder#
$ weird storage add photo.jpg$ weird storage add ./site$ weird storage add backup.tar --copies 3
Each upload prints its content id, its CID and its gateway address. The CID is also computed on your computer and compared with the one stored, so you know the bytes arrived as they left.
- A file goes up in parts, straight to a storage node. If you stop it with Ctrl-C nothing is billed for it; with
--keepyou can continue later withweird storage add --resume <upload id>. - A folder goes up as one zip the storage node unpacks, so it must fit in one upload part (the command tells you the limit).
.DS_Storeand__MACOSXare left out; symbolic links are refused. It is served as a website:index.htmlat its root. - A CAR file packed with another IPFS tool goes up as it is, with
--car.
Stored content is billed by the hour for every megabyte of every copy kept, and per megabyte served.
Credit charge: see the credit charges (contract recurring.ipfs-pin-hourly per_mb_hour)
Per MB of every copy, for a full year of keeping it.
Credit charge: see the credit charges (contract recurring.ipfs-pin-hourly per_mb_served)
Per MB served to visitors.
See what you store#
$ weird storage list$ weird storage show <cid>$ weird storage status
weird storage show lists the copies of one content and any copy still being made. weird storage status shows your usage and says plainly whether storage is unpaid and when serving would stop. Reading these is a small charge per successful request (failed calls are free).
Credit charge: see the credit charges (contract ipfs.reads per_request)
Each successful read of your storage.
How much each site is visited (requests, data, pages, errors, nothing about the visitors) is in Traffic statistics.
Copies#
Every content is kept as at least two copies, at different storage providers. Raise or lower the number for one content:
$ weird storage copies <cid> 3Raising needs enough credits to keep the added copies; they are made one by one and billed as each is ready. Lowering never goes below two.
Gateway addresses (pins)#
A pin is what makes stored content reachable at a gateway address. An upload gets one automatically.
$ weird storage pins$ weird storage pins delete <pin id>$ weird storage pins create <cid>
Retiring a pin takes the gateway address down shortly; the content stays stored (and billed). Creating a pin for the same CID again puts it back.
At the API's current version a gateway address has the form https://<gateway host>/ipfs/<pin id>/ipfs/<cid> (gateway_url in the answers of the pin operations).
Each content has its own address#
A web page runs with the permissions of its origin (the scheme and hostname it was loaded from): it can read the cookies, the local storage and the other windows of every page on the same origin. The path form above puts every customer's content on one origin, so it is fine for fetching bytes (a file, an image, an archive) and wrong for opening a site.
That is why each content is served on a hostname of its own, derived from its CID: https://<cid>.ipfs.<gateway domain>/ (the CID as lowercase CIDv1 base32). It is the address to open and to share; the path form is for raw fetches. The storage service serves both, and a web page asked for in the path form is sent to its own address.
Every pin answer carries both: subdomain_url, the content's own address (null when the gateway serves none for it), and gateway_url, the path form (the pin operations). The application shows the own address first. Read addresses from the command's output or the API's answer rather than building them yourself.
Cookies on a content address. Every content address is a subdomain of the same gateway domain. A cookie your page sets with a Domain= attribute naming that domain is sent to every other customer's content too, and theirs to yours. If your site needs cookies, serve it on your own domain (below), or set only host-only cookies: no Domain attribute, best with the __Host- prefix (Set-Cookie: __Host-session=…; Path=/; Secure), which the browser refuses to share with any other host.
Serve it at your own hostname#
Attach a hostname under one of your live DNS zones, or one of your free addresses, to stored content:
$ weird storage domains attach www.example.ro <cid>$ weird storage domains list
weird writes the records in your zone for you: an address record pointing at the serving node and, unless you pass --no-dnslink, the DNSLink TXT record at _dnslink.www.example.ro. An attach never overwrites records: a name that already has an A, AAAA or CNAME record is refused. The records it writes belong to the storage hostname; change them through storage, not by editing the zone. Your site is then served at https://www.example.ro.
Each attach, retarget and detach is a DNS change.
Credit charge: see the credit charges (contract dns.manage per_request)
Each attach, retarget or detach of a hostname.
Publish a new version#
Content never changes: a new version of a site is a new upload with a new CID. Point the hostname at it:
$ weird storage add ./site$ weird storage domains retarget www.example.ro <new cid>
The hostname serves the new content shortly. To go back, retarget to the previous CID (keep it stored until you are sure). Delete old versions you no longer need, since every stored version is billed.
Redirects and headers#
Two optional files at the root of the folder give a site its own rules: _redirects (moved pages, a single-page app's fallback, your own not-found page) and _headers (caching, a content security policy, CORS). They apply on your own hostname, a free address and the content's own address, not on the shared gateway address or under a path map. See Redirects and headers for your site.
Path maps#
A path map serves one of your pins under a path of one of your storage hostnames, for example a second folder at https://www.example.ro/photos/:
$ weird storage path-maps create www.example.ro /photos <pin id>$ weird storage path-maps list$ weird storage path-maps set <id> off$ weird storage path-maps set <id> on
set off stops serving it and keeps it listed; set on serves it again. weird storage path-maps delete <id> retires it for good (create it again to bring it back).
Take a site down#
- Stop serving a hostname, keeping the content:
weird storage domains detach www.example.roremoves its records. - Stop serving a gateway address:
weird storage pins delete <pin id>. - Delete the content and every copy:
weird storage delete <cid>. This cannot be undone. It is refused while a hostname or a path map still serves the content: detach or retarget those first. Once deleted, it stops being billed, listed and served at once, and each copy is removed from its storage provider.
Download#
$ weird storage get <cid> -o ./outFolders are unpacked; every file is checked against the content id.
When credits run out#
While storage has unpaid charges, nothing new can be stored. After a grace period your pins and hostnames stop being served, while everything stored is kept; topping up restores them at the next billing. Content is removed only after a retention period. weird storage status shows each date for your account. See How billing works.
Sharing a domain's hostnames#
weird storage grants create <email> <domain> lets another account manage storage hostnames under one of your domains; --payer chooses who is billed. weird storage grants revoke <id> ends it.
Reference#
- Commands: weird storage
- API: IPFS storage operations
- MCP tools: storage toolset