How to deploy canister to NNS subnet?

Is possible to deploy to the NNS subnet of a local replica and how?
I’m trying to deploy the governance canister so I can test stuff with neurons locally and I’m using dfx to do it, I still have to see how to deploy manually (without dfx)


1 Like

It depends on what exactly you have in mind. dfx start only spins up a single replica, which can be either in NNS (aka system) mode or in normal application subnet mode.

This is not super trivial to do, but definitively achievable. You can look at this file and the other scripts in that folder to see how our NNS frontend team spins up their local NNS instance for testing the frontend.

If you only want certain canisters of the NNS, have a look here for the individual NNS canisters. They all should have instructions in their README how to deploy them locally.

1 Like

Thanks for the info, I will try using that but do you think that installing it on a subnet of type “app” (so I can also install other normal canisters) would cause problems or I need to create the nns network and then add an “app” subnet by voting with a neuron?

Short answer: go ahead and try.

Long answer: it depends on what you’re trying to do. I’ve seen most NNS canisters that are interesting to developers run without problems on an application subnet, but not all of them will work without any problems. But even if you run in system mode, you still can create canisters as you are used to, it will just have more generous limits and not do cycles accounting.

This does not work locally since you will be running only a single replica(replica=node/machine/instance). A replica can only be part of one subnet, so you won’t have any machines to create a different subnet with.