---
title: "templates in devlanes.yaml"
url: https://devlanes.run/docs/reference/config/project/templates/
description: "Reference for the templates key in devlanes.yaml."
---

# templates in devlanes.yaml

A top-level key of [`devlanes.yaml`](/docs/reference/config/project/).

## `templates`

Type: mapping of names to mappings.

Named service settings that services reuse with `extends: <template>`. The service inherits every setting of the template and its own settings win: mappings (`env`, `ready`, `stop`, preset options, `run_script`) merge by key, lists (`tags`, `hosts`, `sync`) and single values replace. Setting `run` or `run_script` drops the inherited other one, and one `ready` probe (`tcp`, `http`, `log`, `cmd`) drops the inherited probe. Templates may extend other templates, are never started themselves, and are applied after every project file and local override is merged.

```yaml devlanes
templates:
  fastify-api:
    platform: node
    ready:
      http:
        path: /-/health
    tags:
      - api
```

### `templates.<name>`

Type: mapping.

A long-running process started with the lane, such as a dev server or a worker. Each service gets its own port from the lane's block (`PORT`, `${{ self.port }}`); devlanes stops it with the lane and never restarts it when it exits. A service needs `run` or `run_script`, directly or through `extends`.

Takes the same keys as [`services.<name>`](/docs/reference/config/project/services/#services-name).

```yaml devlanes
templates:
  fastify-api:
    hosts: api.${{ lane.domain }}
    run_script:
      file: apps/api/package.json
      name: dev
    tags:
      - api
```
