# How to provide a canister with constructor arguments?

**URL:** <https://forum.dfinity.org/t/how-to-provide-a-canister-with-constructor-arguments/4553>\
**Category:** Developers\
**Created:** [May 30, 2021, 2:05pm UTC](https://forum.dfinity.org/t/how-to-provide-a-canister-with-constructor-arguments/4553 "2021-05-30T14:05:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![senior.joinu](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/senior.joinu/32/9240_2.png) [@senior.joinu](https://forum.dfinity.org/u/senior.joinu)\
**Post date:** [May 30, 2021, 2:05pm UTC](https://forum.dfinity.org/t/how-to-provide-a-canister-with-constructor-arguments/4553/1 "2021-05-30T14:05:37Z")

</div>

In rust we can declare a function with `#[init]` annotation - this function will be called right after canister’s code installation - so it works like a constructor.

How can I pass arguments to this function?

---

<div class="post-metadata">

**Author:** ![nomeata](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nomeata/32/733_2.png) [@nomeata](https://forum.dfinity.org/u/nomeata)\
**Post date:** [June 1, 2021, 3:14pm UTC](https://forum.dfinity.org/t/how-to-provide-a-canister-with-constructor-arguments/4553/2 "2021-06-01T15:14:14Z")

</div>

If you deploy with `dfx`, run

```auto
dfx deploy --no-wallet --argument '(…your args here…)'

```
