CLI

serve

Command
ng serve
ng dev
ng s

Builds and serves your application, rebuilding on file changes.

Arguments

project

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

Value Typestring

Options

allowed-hosts

List of hosts that are allowed to access the dev server. This option has no effect when using the 'application' or other esbuild-based builders.

Value Typearray
build-target

A build 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.

Value Typestring
configuration
Aliasc

One or more named builder configurations as a comma-separated list as specified in the "configurations" section in angular.json. The builder uses the named configurations to run the given target. For more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations.

Value Typestring
disable-host-check

Don't verify connected clients are part of allowed hosts. This option has no effect when using the 'application' or other esbuild-based builders.

Value TypebooleanDefaultfalse
force-esbuild

Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system.

Value TypebooleanDefaultfalse
headers

Custom HTTP headers to be added to all responses.

Value Typearray
headers

Custom HTTP headers to be added to all responses.

Value Typestring
help

Shows a help message for this command in the console.

Value Typeboolean
hmr

Enable hot module replacement.

Value Typeboolean
host

Host to listen on.

Value TypestringDefaultlocalhost
inspect

Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are enabled.

Value Typestring
live-reload

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

Value TypebooleanDefaulttrue
open
Aliaso

Opens the url in default browser.

Value TypebooleanDefaultfalse
poll

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

Value Typenumber
port

Port to listen on.

Value TypenumberDefault4200
prebundle

Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled. This option has no effect when using the 'browser' or other Webpack-based builders.

Value Typeboolean
proxy-config

Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server.

Value Typestring
public-host

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. This option has no effect when using the 'application' or other esbuild-based builders.

Value Typestring
serve-path

The pathname where the application will be served.

Value Typestring
ssl

Serve using HTTPS.

Value TypebooleanDefaultfalse
ssl-cert

SSL certificate to use for serving HTTPS.

Value Typestring
ssl-key

SSL key to use for serving HTTPS.

Value Typestring
verbose

Adds more details to output logging.

Value Typeboolean
watch

Rebuild on change.

Value TypebooleanDefaulttrue
Jump to details