Download and unzip the SDK package to a directory of your choice. This directory will contain the Emscripten SDK.

Open a command prompt inside the SDK directory and run the following emsdk commands to get the latest tools from Github and set them as active:

# Fetch the latest registry of available tools../emsdkupdate# Download and install the latest SDK tools../emsdkinstalllatest# Make the "latest" SDK "active" for the current user. (writes ~/.emscripten file)./emsdkactivatelatest# Activate PATH and other environment variables in the current terminalsource./emsdk_env.sh

Note

On Windows, run emsdk instead of ./emsdk, and emsdk_env.bat instead of source./emsdk_env.sh.

If you change the location of the SDK (e.g. take it to another computer on an USB), re-run the ./emsdkactivatelatest and source./emsdk_env.sh commands.

You only need to install the SDK once! After that you can update to the latest SDK at any time using Emscripten SDK (emsdk).

Type the following in a command prompt

# Fetch the latest registry of available tools../emsdkupdate# Download and install the latest SDK tools../emsdkinstalllatest# Set up the compiler configuration to point to the "latest" SDK../emsdkactivatelatest# Activate PATH and other environment variables in the current terminalsource./emsdk_env.sh

The package manager can do many other maintenance tasks ranging from fetching specific old versions of the SDK through to using the versions of the tools on Github (or even your own fork). Check out all the possibilities in the “How to” guides.