Skip to content

Guide · Open source

How to use angular-cli: install, create and serve an Angular app

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Angular CLI is a command-line tool for initializing, developing, scaffolding and maintaining Angular applications from a terminal. It is the official tooling for the Angular web framework and is maintained by the Angular team. This guide shows you how to install it, create a new workspace, and start a local development server.

Angular CLIangular/angular-cli · ★ 27k · MIT

Quick start

  1. 1Check Node.js. Install Node.js, which includes npm, before going further.
  2. 2Install the CLI. Run npm install -g @angular/cli in your terminal.
  3. 3Create a workspace. Run ng new followed by your project name.
  4. 4Open the project folder. Change into the new project directory with cd.
  5. 5Start the dev server. Run ng serve to launch the local development server.

What you need before you install the Angular CLI

The Angular CLI is distributed as an npm package, so the main prerequisite is Node.js, which includes npm (Node Package Manager). Install Node.js first, then use npm to install the CLI.

The CLI only works with the Angular web framework. If you are not building an Angular application, it is not the right tool.

  • Node.js, which includes npm

Install the Angular CLI globally

Run the following command in your terminal to install the Angular CLI globally with npm. The -g flag makes the ng command available across projects.

npm install -g @angular/cli

Create a new Angular workspace

Use ng new followed by a project name to create a new workspace. Replace [PROJECT NAME] with the name you want for your project.

ng new [PROJECT NAME]

Run the application locally

Move into the project folder you created, then start the application with ng serve. The CLI runs a local development server for you.

cd [PROJECT NAME] ng serve

Where to learn more about the Angular CLI

The official documentation at angular.dev/tools/cli covers getting started, the CLI commands, workspace and project file structure, workspace configuration and schematics. The project also links to a Quickstart guide, which the README describes as getting started in 5 minutes.

The CLI is one package in a monorepo that also contains the Angular Build System, Schematics and other tools, so you can explore those separately if you need them.

  • Getting started (Quickstart)
  • CLI command reference
  • Workspace and project file structure
  • Workspace configuration
  • Schematics

What people use it for

  • Starting a new Angular web application from a terminal
  • Initializing a project workspace with a standard setup
  • Running a local development server while building an app
  • Scaffolding parts of an Angular app from the command line
  • Maintaining an existing Angular project with standard commands

Frequently asked questions

Is angular-cli free to use?

Yes. The Angular CLI is released under the MIT licence, which is an open-source licence. The source code is publicly available on GitHub.

What do I need to install before angular-cli?

You need Node.js, which includes npm (Node Package Manager). The README's setup relies on Node.js and npm, so a non-Node.js toolchain is not covered by this setup.

How do I install angular-cli?

Run npm install -g @angular/cli in your terminal. The -g flag installs it globally so the ng command works in any folder.

How do I create a new Angular project with the CLI?

Run ng new followed by your project name, for example ng new [PROJECT NAME]. Then cd into the project folder and run ng serve to start the local development server.

Is the Angular CLI the same as Vite, Nx or Create React App?

No. The Angular CLI is the official tool for the Angular framework, while Vite, Nx and Create React App are comparable projects in the wider JavaScript tooling space. Pick the CLI if you are building with Angular; the others are for different frameworks or setups.

Can I use angular-cli for a React or Vue project?

No. The tool only works with the Angular framework. For other frameworks, look at tools built for them, such as Vite or Create React App.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

The Angular CLI is the right choice for developers starting or maintaining an Angular web application who want the official, Angular-team-maintained setup and standard terminal commands. It is not suitable if you do not use Angular, want a visual app builder, or need a toolchain that does not rely on Node.js and npm.

Install options & downloads