Setting Up Your First Canister with Motoko 🧵

5JsM...WgWQ
19 Jun 2025
17

Ready to build on ICP? Imagine crafting a smart app like a LEGO set—Motoko lets you assemble canisters, the building blocks of the Internet Computer! Let’s set up your first one, devs & tinkerers!🛠️

A canister is like a mini-computer on ICP’s blockchain. Motoko, its programming language, makes it easy to code them. First, install the DFINITY SDK: run `sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"` in your terminal.

Next, open a terminal & run `dfx start` to launch a local network. Then, create a new project: `dfx new my_project`. This sets up a folder with Motoko files—your canvas to code a canister! 🎨

Edit `src/my_project/main.mo` in Motoko. Start with `actor { public func greet(): async Text { "Hello, ICP!" }; }`. This creates a simple greeting function. Deploy it locally with `dfx deploy`. Test it.

To call your canister, use `dfx canister call my_project greet`. You’ll see “Hello, ICP!”—proof it works! Tweak the code, redeploy, & experiment. Motoko’s simplicity unlocks ICP’s power for devs!


Want more? Check ICP docs (https://internetcomputer.org/docs) for advanced Motoko tricks. Build, deploy, & scale your canister to the mainnet. Join the ICP dev community—your journey starts now!🌐




BULB: The Future of Social Media in Web3

Learn more

Enjoy this blog? Subscribe to dvx_hub

1 Comment