How to Install and Set Up Angular 9 on Ubuntu 20.04

Angular is a JavaScript open-source framework which helps in developing single-page web applications suitable for web/mobile/desktop. So how can we easily install Angular on your Ubuntu system?

Let’s learn a bit about this framework before entering to the installation steps. Angular combines declarative templates, dependency injection, end to end tooling, and integrated best practices to solve development challenges. Angular empowers developers to build applications that live on the web, mobile, or the desktop.

We can work with Angular from our local system after installing Node.js that provides a light weight server to run this framework. Here, in this article, we will discuss all the steps to install Angular 9 on Ubuntu 20.04.

1. Install Nodejs

First, we need to install Nodejs on our system. The current latest version 14.2.0 of the Nodejs. can get by executing the below commands in our Terminal. You can also check the latest version of Nodejs binary distributions before installing this.

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt-get install -y nodejs

2. Update NPM(Optional)

Node Package Manager(NPM) is needed to install Angular CLI. It will be installed with the Nodejs itself, but we can update it to the latest version using the below command.

sudo npm install [email protected] -g

3. Install Angular CLI

Angular CLI helps us to create projects, generate application and library code, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.

It can simply be installed using NPM. So first, open Terminal and install the Angular CLI with the below command.

npm install -g @angular/cli

4. Creating a New Angular Application

We successfully installed Angular CLI on our system and now we can set up a workspace for Angular projects in our system and create a new app. This can be done with the below command.

ng new awesome-project

5. Running Our App

Now, the app we created can be run using ng serve.

cd awesome-project
ng serve --open

This launches the server, watches our files, and rebuilds the app as we make changes to those files.

The –open (or just -o) option automatically opens our browser to the below address.

http://localhost:4200

Summary

So, in this article, we have discussed the steps to install Angular 9 on an Ubuntu 20.04 system. These steps are verified by our team and 100% working.

Have a nice code !

Be the first to reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.