Namraj Pudasaini
Jun 18, 2026
Setting up a web development environment on Ubuntu from scratch can feel tedious. This guide walks through installing the most common tools you will need, along with basic configuration for Git and SSH.
Refresh the package lists first. apt installs from a cached index, and on a fresh or long-idle machine that index is stale enough that installs fail with Unable to locate package:
sudo apt-get update
Run this once per session before installing anything. It does not upgrade any software — it only updates the list of what is available.
Git is the version control system used by almost every development team. Install it with apt:
sudo apt-get update
sudo apt-get install git
Once installed, configure your identity so commits are attributed to you:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Node.js lets you run JavaScript outside the browser, and npm is its package manager. The Ubuntu repositories may have an older version, so use the NodeSource repository for the latest LTS release:
sudo apt-get install nodejs npm
If node is not found after installation, create a symlink:
sudo ln -s /usr/bin/nodejs /usr/bin/node
Verify the installation:
node --version
npm --version
Ubuntu's own nodejs package tends to lag behind the current LTS release, and it stays pinned to whatever the distro shipped with. If you need a specific version, or need to switch versions between projects, install nvm and skip the apt package entirely. That also means global npm installs no longer need sudo.
Composer is the dependency manager for PHP projects. Install it globally:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
PHP CodeSniffer checks your PHP code against coding standards. Install it through PEAR:
sudo pear install --alldeps php_codesniffer
These tools automate tasks like minification, compilation, and package management. Install them globally with npm:
sudo npm install -g grunt-cli
sudo npm install --global gulp
sudo npm install -g bower
If you work with WordPress, WP-CLI lets you manage installations from the command line:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
SSH keys let you authenticate with GitHub and remote servers without entering a password each time.
Generate a key if you do not already have one:
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -f ~/.ssh/id_rsa -N ""
else
echo "SSH key already exists"
fi
Copy the public key to your clipboard and add it to GitHub or your server:
cat ~/.ssh/id_rsa.pub
Almost all of these tools report their version with --version, the quickest way to confirm an install worked before moving on:
git --version
composer --version
If a command comes back as "not found" despite installing cleanly, the binary is probably just not on your PATH.
With Git, Node.js, npm, and your SSH key in place, you have the foundation for most web development workflows. Add Composer if you work with PHP, and WP-CLI if you manage WordPress sites. From here you can install framework-specific tools as your projects require.