# Specify port for ng serve

> You can specify the port using --port argument. Moreover, you can use ng serve --port 0 to auto assign an available port.

- Canonical: https://preview.arshadmehmood.com/today-i-learned/angular2/specify-port-for-ng-serve/
- Section: angular2
- Author: Arshad Mehmood

You can specify the port using `--port` argument. Moreover, you can use `ng serve --port 0` to auto assign an available port.

```js
  ng serve --port 5050
```

