> For the complete documentation index, see [llms.txt](https://seenode.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seenode.gitbook.io/docs/deploying/build-and-start-command.md).

# Build & Start command

### Overview

The **build command** and **run command** are essential for preparing and starting your application. These commands are executed inside the working directory and must be correctly defined to ensure the application runs smoothly.

* The **build command** installs dependencies and compiles or prepares the application for execution.
* The **run command** starts the application, making it available for requests.

###

### Example usage

#### Node.js application

**Repository structure**

```
/my-repo
│── package.json
│── server.js
│── .gitignore  # Ensure node_modules/ is ignored
```

**Build command**

```bash
npm install
```

**Run command**

```bash
node server.js
```

***

#### Fastapi application

**Repository structure**

```
/my-repo
│── requirements.txt
│── main.py
│── app/
```

**Build command**

```bash
pip install -r requirements.txt
```

**Run command**

```bash
uvicorn main:app --host 0.0.0.0 --port 8000
```

***

#### Django application

**Repository structure**

```
/my-repo
│── requirements.txt
│── manage.py
│── myproject/
```

**Build command**

```bash
pip install -r requirements.txt
```

**Run command**

```bash
python manage.py runserver 0.0.0.0:8000
```

***

#### Go application

**Repository structure**

```
/my-repo
│── main.go
│── go.mod
│── go.sum
```

**Build command**

```bash
go build -o app .
```

**Run command**

```bash
./app
```

###

### Advanced usage

Sometimes, additional commands need to be executed before starting the application. For example, running database migrations before launching the server. You can join multiple commands using `&&`, or simply place them on a new line, which automatically joins them with `&&`.

#### Running database migrations before starting the application

**Django example**

```bash
python manage.py migrate && python manage.py runserver 0.0.0.0:8000
```

Or written on multiple lines:

```bash
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
```

**Fastapi example (using alembic migrations)**

```bash
alembic upgrade head && uvicorn main:app --host 0.0.0.0 --port 8000
```

Or written on multiple lines:

```bash
alembic upgrade head
uvicorn main:app --host 0.0.0.0 --port 8000
```

###

### Conclusion

Setting the correct **build command** and **run command** ensures your application installs dependencies and starts correctly. Always verify these commands based on your application’s framework and dependencies.
