/ home / Documentation / v3 / mediasoup / Installation

mediasoup v3 Installation

Install mediasoup via NPM within your Node.js application:

$ npm install mediasoup@3

During the installation process, the mediasoup NPM package will try to fetch a prebuilt mediasoup-worker binary appropriate for current platform and architecture. If not found, it will locally build the mediasoup-worker binary.

  • If “MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD” or “MEDIASOUP_LOCAL_DEV” environment variables are set, or if mediasoup package is being installed via git+ssh (instead of via npm), and if “MEDIASOUP_FORCE_WORKER_PREBUILT_DOWNLOAD” environment variable is not set, the installation process won't attempt to fetch any prebuilt mediasoup-worker binary and it will build it locally instead.
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD="true" npm install mediasoup@3
  • If “MEDIASOUP_WORKER_BIN” environment variable is set during mediasoup package installation, mediasoup will use the the value of such an environment variable as mediasoup-worker binary and won't compile it locally. And if same environment variable is set when running your Node.js app, mediasoup will use it as mediasoup-worker binary (instead of looking for it in the mediasoup/worker/out/Release path).
MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" npm install mediasoup@3
MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" node myapp.js


In order to build the mediasoup C/C++ components the following packages and libraries must be available in the target host:

All Platforms

Python and make are just needed in case no prebuilt mediasoup-worker binary was downloaded during the installation process.

The installation path MUST NOT contain whitespaces.

Linux, OSX and *NIX Systems

  • On Debian and Ubuntu install the python3-pip DEB package, otherwise PIP package manager might be unavailable.
  • On Debian and Ubuntu install the build-essential DEB package. It includes both make and gcc/g++.
  • On YUM based Linux (Red Hat, CentOS) use yum groupinstall "Development Tools".
  • On OSX M1 ensure that you have a M1 version of Node.js.

If there is neither python3 nor python command pointing to Python 3 executable, set the PYTHON environment variable during mediasoup installation:

$ PYTHON=python3.9 npm install mediasoup@3 --save

If the MEDIASOUP_MAX_CORES environment variable is set, the build process will use that number of CPU cores. Otherwise, it will auto-detect the number of cores in the machine.


  • GNU make can be installed with MSYS from MinGW and make sure to append the path of folder containing make to the Windows Path environment variable (e.g. C:\MinGW\msys\1.0\bin).
  • Make sure to have ISRG Root X1 certificate installed, or you will get errors while downloading OpenSSL (whose website is secured with Let's Encrypt), you can import it from (install to Local computer).
  • If you have Python-related errors, search for “App execution aliases” in system settings and disable everything Python-related from there.