​Deploy Internet Identity locally

Image source: DFINITY foundation

So, you are looking to deploy Internet Identity (II) locally?

​Here are my four easiest solution to do so!

Introduction

​To deploy II locally, we need to get its canister (Wasm module). We can either build the code ourself, using Docker and the docker-build script provided by the II team, or download an existing release.

​As I really dislike doing anything Devops related myself and, also because the goal of this tutorial is to make things happen fast, the following solutions are using the pre-build/released wasm (the above second option).

​The first two options are applicable for any dapps, the last two are more useful if you start a new project.

​1. Automatic Installation

It is possible to set up II for a project with dfx >= 0.12.0 using a custom canister.

So, just drop the following configuration in your project and that’s already it.

Using dfx​ < v0.12.0, it’s a bit more verbose — or hacky depends the point of view — but we can also leverage the build​ callback to download and install II automatically.

​As we only want to deploy II locally, it is worth to note that above config contains a remote​ option that points to II on mainnet. Thanks to it, the wasm won’t be deployed when we deploy our canisters to mainnet.

You might also want to skip committing the .did​ and .wasm​ files — that are going to be automatically downloaded — by omitting these in your .gitignore​.

2. Manual Installation

​If you prefer to not touch any configuration of your project, it is possible to deploy II locally manually as well. e.g. that’s the strategy I personally use when I deploy Papyrs.

Anywhere on your computer, while dfx start has been started in your project, run following command lines and that’s already it too.

​3. New dapp

If you start from scratch or looking to create a sample dapp, instead of initializing a new project with dfx​, I recommend you to use the npm CLI (I have created). It prompts you interactively for options and setup everything for you including II.

​4. Game Changer

I am working on a new secret side project that aims to reduce the gap for web2 developer on the IC early 2023 (🤯). Join my newsletter to keep hearing about it or reach me out on Twitter to get to know more!

​To infinity and beyond
David​

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store