3. Developer environment setup
Overview
Before you can begin our developer journey, you need to set up our developer environment. A developer environment consists of tools and packages that are required to develop code projects. Usually, developer environments are stored and hosted on your local computer, but there are some situations where a virtual, web-based development environment exists.
Setting up your developer environment
Confirm you have a connection to the internet
To follow along with the developer journey and develop on the Internet Computer, you will need a connection to the internet.
Why does this matter?
You will need an internet connection to download a few different tools and packages, as described further in this document. You will also need an internet connection whenever you plan to deploy your canister to the mainnet. You do not need an internet connection to deploy your canister to your local canister execution environment.
Confirm you have access to a command line interface (CLI) on your local computer
Open a command line interface (CLI) window. This may be referred to as 'Terminal' or 'Shell' depending on your computer's operating system. In this documentation, this is often referred to as the 'terminal window'.
Why does this matter?
You will primarily be using CLI-based tools, such as dfx
and git
, in this developer journey.
Options for Windows users
dfx
is not natively supported on Windows. To download dfx
on Windows, you will need to download the Windows Subsystem for Linux. Learn more about how to install dfx on Windows.
Download and install the IC SDK
To download and install the IC SDK, first open a terminal window. Then, run the following command in that window:
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
This command will prompt you to read and accept the license agreement before the install begins. Type y
, then press Return
to accept the agreement and begin the installation.
If you are using a machine running Apple silicon, you will need to have Rosetta installed. You can install Rosetta by running softwareupdate --install-rosetta
in your terminal.
Then, to verify that the IC SDK is ready to use, run the following command:
dfx --version
This command should output information about the latest version of dfx
. This output indicates that the installation has been successful, and that dfx
is ready to use.
Why does this matter?
The IC SDK is composed of several components that are required for developing on the Internet Computer. These components are:
dfx
: The CLI tool used to interact with and develop canisters on ICP.replica
: The Internet Computer's local network binary.
Download and install podman
Windows is only supported through a Linux virtual environment of some kind, such as WSL
On Ubuntu/WSL:
sudo apt-get install podman
On Mac:
brew install podman
Why does this matter?
Podman is an open-source tool that helps developers manage Linux containers, pods, and images. Azle 0.20.2 has been released, it uses Docker/Podman under the hood to simplify installation.
Download and install a code editor
To write and edit code, you will need a code editor. macOS and Linux systems come with some basic editors, such as vi
or nano
, but these have very limited functionality and can be hard to use.
It is recommended that you use Visual Studio Code, as it is a popular choice and there is a Motoko extension that provides additional tools for Motoko development.
Why does this matter?
Code editors are a core component to writing and developing code.
Download and install git
Download and install git.
Why does this matter?
Many of the DFINITY public repositories are hosted on Github, such as our examples
repository. You will be using code from this repository later in the developer journey, so it is important to install git
to assure that you can download the sample code pieces and follow along with the later tutorials.
Download and install Node.js
It's recommended to use nvm and Node.js 20:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Restart your terminal and then run:
nvm install 20
Check that the installation went smoothly by looking for clean output from the following command:
node --version
Why does this matter?
Node.js is used by dfx
to generate frontend code and dependencies.
Assure all packages and tools are updated to the latest release versions
If you have followed this guide and installed each of these tools for the first time, you will have the most recent release versions installed.
If you previously had installed any of these tools, be sure to check the most recent release version and update them if needed.
Why does this matter?
Having the latest release version assures that you have all of the newest features and bug fixes for each tool to assure for the most seamless developer experience.
Need help?
Did you get stuck somewhere in this tutorial, or feel like you need additional help understanding some of the concepts? The ICP community has several resources available for developers, like working groups and bootcamps, along with our Discord community, forum, and events such as hackathons. Here are a few to check out:
-
Developer Discord community, which is a large chatroom for ICP developers to ask questions, get help, or chat with other developers asynchronously via text chat.
-
Weekly developer office hours to ask questions, get clarification, and chat with other developers live via voice chat. This is hosted on our developer Discord group.
-
Submit your feedback to the ICP Developer feedback board.