Skip to main content

How To Set Up a Linux machine for web development

These are the steps needed to set up a Linux machine for web development. These instructions use an Ubuntu Distro.

The environments that I am installing are:

Visual Studio Code#

follow the link above and download the .deb.

  • I saved it to a location and right clicked the file and selected "Open with Software Install".
  • I then opened Visual Studio Code from Applications. I did save it as a favorite.
  • I opened a new terminal in VSCode to run the following commands:
ensure Linux is up to date
sudo apt-get update

NodeJS#

Installing NodeJS
sudo apt install nodejs

NPM#

Install NPM
sudo apt install npm

n#

Node.js version management: no subshells, no profile setup, no convoluted API, just simple. (Note: n is not supported natively on Windows.)

Install n
sudo npm install -g n
Make sure you have latest Node. Docusaurus 2 requires 12.13.0 or above
sudo n latest
node -v # to check node version

git#

install git and configure with your github credentials
sudo apt install git
git config --global user.name "<YOUR GITHUB USERNAME>"
git config --global user.email YOUR.GITHUB@EMAIL

yarn#

  • Docusaurus provides an easy way to publish to GitHub Pages. This is where our code for our blog lives.
  • this method uses yarn to build the static site before deploying to GitHub Pages.
install yarn
sudo apt install curl #first install curl
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - #curl adds the yarn repo to access the package. the -sS swith supreses the progress bar, but displays any errors
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y
yarn --version # check version ...

if version reads 0.32+git or similar something went wrong. do this:

remove and reinstall yarn
sudo apt remove cmdtest
sudo apt remove yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn -y