How to install Gulp.js on Ubuntu 20.04

Jesse Jacobs
Spin Servers
Published in
3 min readOct 29, 2021

--

https://gulpjs.com/

Gulp is a cross-platform, streaming task runner that lets developers automate many development tasks. At a high level, gulp reads files as streams and pipes the streams to different tasks. These tasks are code-based and use plugins. The tasks modify the files, building source files into production files. To get an idea of what gulp can do check the list of gulp recipes on GitHub.

Prerequisites

Before we install Gulp.js we will need a few things first.

  • A server running Ubuntu 20.04 or 18.04. I am using a dedicated server from Spin Servers.
  • About 10 minutes and a cup of coffee or hot tea. I prefer Vanilla Chai with a dash of whole milk or almond depending on my mood that day.

Step 1 — Upgrade your system

First things first, always update your system before installing any software or making changes. To do this, use this command:

$ sudo apt-get upgrade

Step 2 — Install Node.js

In order to install Gulp, we will need to first install the Node.js repository.

$ curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -

Install Node.js:

$ sudo apt-get install -y nodejs

Verify version:

$ node --version

Step 4 — Create a sample application with NPM

Create a new application directory. Replace ‘app name’ with a name of your choosing.

$ mkdir [app name]

Change to the directory you made and create the application.

$ cd [app name]
$ npm init

Afterward, you will be asked some questions about the application.

Step 5 — Install Gulp.js

Install Gulp.js using the Gulp CLI tool.

$ npm install -g gulp-cli

Once the installer prompts you, change the directory path to your application name.

$ cd /root/[app name]
$ npm install --save-dev gulp

Verify Gulp.js version.

$ gulp --version

Step — Create Gulp Application

Now we can create a sample Gulp application. Use the command below to create the file.

$ nano /root/[app name]/gulpfile.js

Add this content to the file:

var gulp = require('gulp');

gulp.task('hello', function(done) {
console.log('Hello World!!!');
done();
});

Save and exit the file.

Run the Gulp task.

$ gulp hello

Your Gulp.js application is now up and running! :)

To make these how-to guides possible, I use a dedicated server from Spin Servers. The configuration I use is a:

Dual Intel Xeon E5–2630L
12x 2.00 GHz CPU
128GB DDR3 RAM
4x 2TB HDD HW RAID-10 DISKSPACE
10TB
of Bandwidth on 10Gbps Port
Dallas Location

I get this configuration for $89/month using the code “DUALE5FOR89”. This promotion (and others) can be found on the Spin Servers Web Hosting Talk thread found here.

If you have questions about any of Spin Server’s services, please contact us via email at sales@spinservers.com or by using our live chat at spinservers.com.

Spin Servers is a US-based provider of dedicated servers & affordable private cloud solutions. Our motto is to let you “spin up servers” fast, seamlessly, and affordably.

--

--