Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
User data code used to setup NodeJS environment on cloud servers such as DigitalOcean and Vultr.
## Copy/paste this script code into the "User Data" textarea that appears when selecting
## the "User Data" checkbox upon setting up your new DigitalOcean Droplet.
## Update Ubuntu
apt-get update
## Install NodeJS and NPM
curl -sL | bash -
apt-get install nodejs -y
## Install Gulp globally so that it can be run from the command line
npm install --global gulp-cli
## Append code to end of sudoers file that allows the www-data user to execute sudo commands
## Only use this code if working on a non-live/DEV server as it makes the server less secure
echo 'www-data ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.