---
title: "Running a Project"
description: "Run a project with docker or with PHP on the host: the commands up, down, install and serve."
version: "1.0"
---

> Documentation Index
> Fetch the complete documentation index at: https://crest.phalcon.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Running a Project

A project runs with docker, or with PHP on the host (see [Quick start](/1.0/quick-start)). For the Crest that runs `up`, `down` and `install`, see [The global Crest and the project Crest](/1.0/how-crest-works#the-global-crest-and-the-project-crest).

With docker, use `crest up`, `crest install` and `crest down` (see [The launcher](/1.0/how-crest-works#the-launcher)). `crest down` stops and removes the containers. `up --build` rebuilds the image first, and `down --volumes` also removes the named volumes.

Without docker, `crest serve` starts PHP's built-in web server for the project (see [With PHP on the host](/1.0/quick-start#with-php-on-the-host)). `.htrouter.php` is the router script of PHP's built-in server. `serve` runs `php -S 127.0.0.1:8080 -t public .htrouter.php` in the project root. The router and the document root (`public`) are the same as in the container.

The port is `--port`, else `APP_PORT` from the environment, else `APP_PORT` in the project `.env`, else 8080. docker compose reads `APP_PORT` in the same order.

`serve` reads `.env` as docker compose does: the last `APP_PORT` line wins, and `export`, `APP_PORT: <port>`, quotes and `#` comments are allowed. `serve` does not expand `${...}`: a value with `${...}` stops `serve` with an error.

`serve` finds the project root from a subfolder. A global Crest passes `serve` to the Crest in `vendor/`, as it does the other project commands (see [The global Crest and the project Crest](/1.0/how-crest-works#the-global-crest-and-the-project-crest)). `serve` stops before PHP starts if `.htrouter.php` or `<vendor-dir>/autoload.php` is missing. `vendor-dir` is a setting of composer (see [Configuration](/1.0/configuration)).

The server uses the PHP that runs Crest. PHP options on the command line, for example `-d extension=phalcon.so`, do not reach the server. Put such settings in `php.ini`.

Press Ctrl+C to stop the server. If the server continues to run, for example after Crest stopped in a different way, stop its PHP process. The command is the same in both flavors:

```bash
pkill -f -- '-S 127.0.0.1:8080'
```

Use your port if it is not 8080.

Source: https://crest.phalcon.io/1.0/running/index.mdx
