# Deploying an application Deploying your application is the process of compiling, or building, your code and hosting the JavaScript, CSS, and HTML on a web server. This section builds on the previous steps in the [Getting Started](start "Try it: A basic application") tutorial and shows you how to deploy your application. ## Prerequisites A best practice is to run your project locally before you deploy it. To run your project locally, you need the following installed on your computer: * [Node.js](https://nodejs.org/en/). * The [Angular CLI](https://cli.angular.io/). From the terminal, install the Angular CLI globally with: ```sh npm install -g @angular/cli ``` With the Angular CLI, you can use the command `ng` to create new workspaces, new projects, serve your application during development, or produce builds to share or distribute. ## Running your application locally 1. Download the source code from your StackBlitz project by clicking the `Download Project` icon in the left menu, across from `Project`, to download your files. 1. Create a new Angular CLI workspace using the [`ng new`](cli/new "CLI ng new command reference") command, where `my-project-name` is what you would like to call your project: ```sh ng new my-project-name ``` This command displays a series of configuration prompts. For this tutorial, accept the default settings for each prompt. 1. In your newly CLI-generated application, replace the `/src` folder with the `/src` folder from your `StackBlitz` download. 1. Use the following CLI command to run your application locally: ```sh ng serve ``` 1. To see your application in the browser, go to http://localhost:4200/. If the default port 4200 is not available, you can specify another port with the port flag as in the following example: ```sh ng serve --port 4201 ``` While serving your application, you can edit your code and see the changes update automatically in the browser. To stop the `ng serve` command, press `Ctrl`+`c`. {@a building} ## Building and hosting your application 1. To build your application for production, use the `build` command. By default, this command uses the `production` build configuration. ```sh ng build ``` This command creates a `dist` folder in the application root directory with all the files that a hosting service needs for serving your application.