static-site
Static Site (Certified Assets)
What This Is
The @dfinity/static-site recipe deploys a static site — a built frontend, docs, or any folder of files — to the certified-assets canister on the Internet Computer, which serves it over HTTP with response certification. Every response carries a cryptographic proof, and the IC HTTP gateway verifies that proof before handing the response to the browser: visitors get content the canister provably committed to, not something a boundary node or gateway altered in transit.
This is the recommended way to host a frontend on the IC going forward. The recipe bundles a matched pair — the canister and its sync plugin — pinned together by one version. You point it at your build directory; icp deploy uploads, certifies, and serves.
The older
@dfinity/asset-canisterrecipe (the SDK asset canister, configured with.ic-assets.json5) is still supported for existing projects but is no longer the recommended path. It is a different canister with a different config format and API — seereferences/legacy-asset-canister.md. To move an existing project over, seereferences/migrating-from-asset-canister.md.
Prerequisites
icp-cli—npm install -g @icp-sdk/icp-cli. The recipe pins the canister + sync-plugin pair, both pre-built, so a plaindir/build/presyncdeploy needs nothing else.ic-wasm—npm install -g @icp-sdk/ic-wasm. A separate binary, not bundled withicp-cli. This recipe shells out to it only when you set themetadatafield (the generated build guards oncommand -v ic-wasmand fails with "ic-wasm not found"); other official recipes need it unconditionally, so installing both up front is the safe default — see theicp-cliskill.- Your frontend's build toolchain (e.g. Node.js >= 22 for a Vite/React app).
Canister IDs and URLs
Static-site canisters are created per-project — there is no global canister ID. After deployment the canister ID is stored in .icp/<cache|data>/mappings/<environment>.ids.json. Managed networks (the local replica) are cache — .icp/cache/mappings/local.ids.json; connected networks (mainnet ic) are data — .icp/data/mappings/ic.ids.json.