Skip to main content

Large web assembly modules

Intermediate
Tutorial

Overview

The size of programs that can be installed on ICP is currently limited to 2MB. WebAssembly modules that are (slightly) larger than 2MB can still be installed on ICP by using gzip file compression before uploading; ICP will then decompress the file and install the contained WebAssembly module.

Installing a gzip-compressed WebAssembly module

The WebAssembly module is compressed using gzip and then uploaded by dfx install, you may need to add --mode reinstall or --mode upgrade when uploading the module to an existing canister.

gzip my-canister.wasm
dfx canister install my-canister --wasm my-canister.wasm.gz

Compression is currently not supported by dfx deploy.