ng serve

Builds and serves your app, rebuilding on file changes.

ng serve <project> [options]

ng s <project> [options]


Argument Description Value Type

The name of the project to build. Can be an application or a library.



Option Description Value Type Default Value

List of hosts that are allowed to access the dev server.


A browser builder target to serve in the format of project:target[:configuration]. You can also pass in more than one configuration name as a comma-separated list. Example: project:target:production,staging.


One or more named builder configurations as a comma-separated list as specified in the "configurations" section of angular.json. The builder uses the named configurations to run the given target. For more information, see https://angular.io/guide/workspace-config#alternate-build-configurations. Setting this explicitly overrides the "--prod" flag.

Aliases: -c


Don't verify connected clients are part of allowed hosts.

boolean false

Shows a help message for this command in the console.

true|false|json|JSON false

Enable hot module replacement.

boolean false

Host to listen on.

string localhost

Whether to reload the page on change, using live-reload.

boolean true

Opens the url in default browser.

Aliases: -o

boolean false

Enable and define the file watching poll time period in milliseconds.


Port to listen on.

number 4200

Deprecated: Use --configuration production instead.

Shorthand for "--configuration=production". Set the build configuration to the production target. By default, the production target is set up in the workspace configuration such that all builds make use of bundling, limited tree-shaking, and also limited dead code elimination.


Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server.


The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies.


The pathname where the app will be served.


Serve using HTTPS.

boolean false

SSL certificate to use for serving HTTPS.


SSL key to use for serving HTTPS.


Adds more details to output logging.


Rebuild on change.

boolean true

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.