To deploy the landing (static code) to the Internet Computer (ICP), you need to set it up as a frontend canister (also known as an asset canister). This canister will store and serve your static assets (HTML, CSS, JavaScript, etc.) directly on the decentralized ICP network.
The steps to accomplish this are described below.
- Install ICP SDK
Install the ICP SDK by following the instructions here.
- Start the Local Replica
Start the local ICP replica in the background with a clean slate by running the following command:
dfx start --clean --background
- Deploy the Canisters Locally
Once the local replica is running, deploy the canisters:
dfx deploy
- Deploy to ICP Hosting
To deploy a canisters onto the ICP mainnet, you must have cycles. Cycles are used to pay for the resources that a canister uses.
The next link explains how to use the cycles faucet to acquire 10T free cycles that can be used to deploy your dapps on the mainnet.
Once you have obtained cycles, you can deploy to the actual ICP network using the following command:
dfx deploy --network=ic
After a successful deployment, you will receive a URL similar to this: https://cilxj-yiaaa-aaaag-alkxq-cai.icp0.io/
Your frontend will be accessible via the provided URL on the Internet Computer (ICP).