How to install NodeJS on Debian

How To Install Node.js on Debian

In this article we will guide you through the steps of installing NodeJS, Bower and Gulp on a Debian 8 VPS. Node.js is an open-source, cross-platform runtime environment for developing server-side web applications. It uses an event-driven, non-blocking I/O model designed to optimize an application’s throughput and scalability for real-time web applications.Node.js applications are written in JavaScript and can be run within the Node.js runtime on Linux, OS X, Microsoft Windows, FreeBSD, NonStop, IBM AIX, IBM System z and IBM i. Node.js contains a built-in library to allow applications to act as a stand-alone web server. Bower is a package management system for managing web frameworks, libraries, utilities, assets etc. It is a must-have tool for any web-developer out there. Gulp is a streaming build system which is very fast, simple and efficient. It utilizes the power of node’s streams, so you get fast builds that don’t write intermediary files to disk. Gulp lets you automate tasks such as:

1. Requirements

We will be using our SSD 1 Linux VPS Hosting plan for this tutorial.

Login to your server via SSH

# ssh root@server_ip

You can check whether you have the proper version of Debian installed on your server with the below command:

# lsb_release -a

Which should give you the underneath output:

Distributor ID: Debian
Description:    Debian GNU/Linux 8.2 (jessie)
Release:        8.2
Codename:       jessie

2. Update the system

Make sure your server is fully up to date.

# apt-get update && apt-get upgrade

3. Install Node.js

The Node.js v4.x repository is located at https://deb.nodesource.com/node_4.x. However, we recommend you to use the setup script to activate it which will also ensure that your system is both compatible and set up properly, including installing the NodeSource GPG key. Enter the below command:

# curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -

Then, install Node.js with:

# apt-get install --yes nodejs

If you want to compile and install native addons from npm you may also need to install build tools. Therefore, issue the following:

# apt-get install -y build-essential

You can check the installed Node.js version with:

# node -v

which should give you the following output:

v4.4.7

4. Install Bower

Bower can be installed via the NodeJS package manager known as npm. To install Bower globally on your server run the underneath the command:

# npm install bower -g

Check Bower’s version:

# bower -v

5. Install Gulp

Gulp can also be installed using npm. You can use the same command that you used for Bower, in the process changing bower with gulp of course:

# npm install gulp -g

Gulp’s version:

# gulp -v

That’s it. You have successfully installed NodeJS, Bower and Gulp on your Debian 8 VPS. Next, you may want to check their official documentation to get more familiar with these great tools. For more information please check the below links:

Of course you don’t have to install NodeJS on Debian if you use one of our Java VPS Hosting services, in which case you can simply ask our expert Linux admins to install NodeJS, Bower and Gulp for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post, on how to install NodeJS on Debian,  please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

2 thoughts on “How to install NodeJS on Debian”

  1. ================================================================================
    ================================================================================

    NODE.JS v0.12 DEPRECATION WARNING

    Node.js v0.12 will cease to be actively supported at the end of 2016.

    This means you will not continue to receive security or critical stability
    updates for this version of Node.js beyond that time.

    You should begin migration to a newer version of Node.js as soon as
    possible. Use the installation script that corresponds to the version of
    Node.js you wish to install. e.g.

    * https://deb.nodesource.com/setup_4.x — Node.js v4 LTS "Argon" (recommended)
    * https://deb.nodesource.com/setup_6.x — Node.js v6 Current

    Please see https://github.com/nodejs/LTS/ for details about which version
    may be appropriate for you.

    The NodeSource Node.js Linux distributions GitHub repository contains
    information about which versions of Node.js and which Linux distributions
    are supported and how to use the install scripts.
    https://github.com/nodesource/distributions

    ================================================================================
    ================================================================================

    Reply

Leave a Comment