English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Docker Install Node.js

Node.js is a JavaScript runtime built on Chrome V8 The JavaScript runtime environment of the engine, which is a development platform that allows JavaScript to run on the server.

1View available Node versions

Visit the Node image library address: https://hub.docker.com/_/node?tab=tags.

You can view other versions of Node through Sort by, the default is the latest version  node:latest.

You can also find other versions you want in the drop-down list:

In addition, we can also use the docker search node command to view available versions:

$ docker search node

2Pull the latest node image

Here we pull the latest official version of the image:

$ docker pull node:latest

3View Local Images

Use the following command to check if node is installed:

$ docker images

As can be seen in the figure above, we have installed the latest version (latest) of the node image.

4Running Container

After the installation is complete, we can use the following command to run the node container:

$ docker run -itd --name node-test node

Parameter Description:

  • --name node-test:Container Name.

5Installed successfully

Finally, enter to check the node version running in the container:

$ docker exec -it node-test /bin/bash
root@6c5d265c68a6:/# node -v