How to Install Bower on Ubuntu

Bower is a package manager for web development that provides a standardized approach to front-end package management. It maintains and monitors all packages, checks for updates, and uses a manifest file called bower.json to track dependencies. This article explains how to install Bower on Ubuntu.

Prerequisites

To install Bower, you need Node.js and NPM pre-installed on your system. First, verify that Node.js is installed by checking its version:

$ node -v

The output should display the Node.js version:

v6.9.2

Next, verify the NPM version:

$ npm -v

The output should show the NPM version:

3.10.9

If Node.js and NPM are not installed, you can install them using your system's package manager or download them from the official Node.js website.

Installing Bower

Once Node.js and NPM are available, install Bower globally using NPM:

$ sudo npm install -g bower

The installation output will show the Bower package being installed:

/usr/bin/bower -> /usr/lib/node_modules/bower/bin/bower
/usr/lib
`-- bower@1.8.0

Bower Commands

After installation, you can explore Bower's functionality by viewing its help information:

$ bower --help

This displays the available commands and options:

Usage:
    bower [<command>] [<args>]

Commands:
    cache               Manage bower cache
    help                Display help information about Bower
    home                Opens a package homepage into your favorite browser
    info                Info of a particular package
    init                Interactively create a bower.json file
    install             Install a package locally
    link                Symlink a package folder
    list                List local packages - and possible updates
    login               Authenticate with GitHub and store credentials
    lookup              Look up a single package URL by name
    prune               Removes local extraneous packages
    register            Register a package
    search              Search for packages by name
    update              Update a local package
    uninstall           Remove a local package
    unregister          Remove a package from the registry
    version             Bump a package version

Options:
    -f, --force         Makes various commands more forceful
    -j, --json          Output consumable JSON
    -l, --loglevel      What level of logs to report
    -o, --offline       Do not hit the network
    -q, --quiet         Only output important information
    -s, --silent        Do not output anything, besides errors
    -V, --verbose       Makes output more verbose
    --allow-root        Allows running commands as root
    -v, --version       Output Bower version
    --no-color          Disable colors

Example − Installing Bootstrap

To demonstrate Bower's functionality, install Bootstrap using the following command:

$ bower install bootstrap

The installation process will show progress information:

bower not-cached       bootstrap#*
bower resolve           bootstrap#*
bower download          https://github.com/twbs/bootstrap/archive/v3.3.7.tar.gz
bower progress          bootstrap#* received 0.1MB of 4.0MB downloaded, 3%
bower progress          bootstrap#* received 0.2MB of 4.0MB downloaded, 5%
bower extract           bootstrap#* archive.tar.gz
bower resolved          bootstrap#3.3.7
bower install           bootstrap#3.3.7

Key Features

  • Dependency Management − Automatically resolves and manages package dependencies

  • Version Control − Tracks package versions and handles updates

  • Flat Dependency Tree − Avoids nested dependencies to prevent version conflicts

  • Registry Integration − Access to thousands of packages from the Bower registry

Conclusion

Installing Bower on Ubuntu is straightforward with NPM. Once installed, Bower simplifies front-end package management by providing commands to install, update, and manage web dependencies efficiently. It streamlines the development workflow by automating package management tasks.

Updated on: 2026-03-17T09:01:38+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements