Skip to main content
Version: v6

ionic serve

Start a local dev server for app dev/testing

$ ionic serve [options]

Easily spin up a development server which launches in your browser. It watches for changes in your source files and automatically reloads with the updated build.

By default, ionic serve boots up a development server on localhost. To serve to your LAN, specify the --external option, which will use all network interfaces and print the external address(es) on which your app is being served.

Try the --lab option to see multiple platforms at once.

ionic serve uses the Angular CLI. Use ng serve --help to list all Angular CLI options for serving your app. See the ng serve docs for explanations. Options not listed below are considered advanced and can be passed to the Angular CLI using the -- separator after the Ionic CLI arguments. See the examples.

The dev server can use HTTPS via the --ssl option (experimental). There are several known issues with HTTPS. See issue #3305.

Examples

$ ionic serve 
$ ionic serve --external
$ ionic serve --lab
$ ionic serve -- --proxy-config proxy.conf.json

Options

--ssl

Description

Use HTTPS for the dev server

--prod

Description

Flag to use the production configuration

--external

Description

Host dev server on all network interfaces (i.e. --host=0.0.0.0)

--no-livereload

Description

Do not spin up dev server--just serve files

--no-open

Description

Do not open a browser window

--lab

Description

Test your apps on multiple platform types in the browser

Aliases-l

Advanced Options

--consolelogs

Description

Print app console logs to the terminal

--consolelogs-port =<port>

Description

Use specific port for console logs server

--configuration =<conf>

Description

Specify the configuration to use.

Aliases-c

--source-map

Description

Output sourcemaps

--host =<host>

Description

Use specific host for the dev server

Defaultlocalhost

--port =<port>

Description

Use specific port for the dev server

Aliases-p
Default8100

--public-host =<host>

Description

The host used for the browser or web view

--lab-host =<host>

Description

Use specific host for Ionic Lab server

Defaultlocalhost

--lab-port =<port>

Description

Use specific port for Ionic Lab server

Default8200

--browser =<browser>

Description

Specifies the browser to use (safari, firefox, google chrome)

Aliases-w

--browseroption =<path>

Description

Specifies a path to open to (/#/tab/dash)

Aliases-o