Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

How to Install NodeJS on Docker

DZone's Guide to

How to Install NodeJS on Docker

Learn how to install NodeJS on a CentOS Docker image using this simple tutorial.

· Cloud Zone
Free Resource

Site24x7 - Full stack It Infrastructure Monitoring from the cloud. Sign up for free trial.

This article offers quick instructions on how to install NodeJS on a CentOS Docker image. The detailed instructions of installing NodeJS on Linux can be found on this page. Please feel free to comment/suggest if I failed to mention one or more important points

Following is the set of instructions:

  • Install Docker on your machine.
  • Pull the CentOS Docker image.
  • Create a container using the CentOS docker image. Use the following command:
    docker run -ti -dP --name centos -v /c/Users:/mnt/Users centos:latest /bin/bash
  • Start the Docker container and attach the image. Use the following command:
    # Starts the docker container
    docker start centos
    # Attach
    docker attach centos
  • Use the following command to install NodeJS:
    # Run as root on RHEL, CentOS, CloudLinux or Fedora:
    curl -sL https://rpm.nodesource.com/setup | bash -
    # Install as Root
    yum install -y nodejs

And that is it. Once the installation is done, type “npm” and you should find “npm” usage command instructions.

Site24x7 - Full stack It Infrastructure Monitoring from the cloud. Sign up for free trial.

Topics:
docker ,nodejs ,centos ,containers ,cloud

Published at DZone with permission of Ajitesh Kumar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}