---
title: "Deploy a release"
method: POST
path: "/v2/projects/{project_id}/releases"
tags: ["Deployments"]
---

# Deploy a release

`POST /v2/projects/{project_id}/releases`

## Request

- Base URL: `https://api.liara.ir`
- URL: `https://api.liara.ir/v2/projects/{project_id}/releases`
- Auth: HTTP bearer

Starts a new release of the app, from an uploaded `sourceID` or, for `docker` apps, from an `image`. Send exactly one of them. Releases that are still building or deploying are cancelled. Source releases are built first; image releases are deployed directly.

**Limit:** the number of deployments per day depends on your bundle plan. Team permission: `deploy`, `operate` or `manage`.

## Path parameters

- `project_id` string, required

## Query parameters

- `teamID` string: 24-character hexadecimal ID.

## Request body

- CreateRelease
  - `type` 'node' | 'next' | 'react' | 'vue' | 'angular' | 'static' | 'laravel' | 'php' | 'django' | 'flask' | 'python' | 'netcore' | 'dotnet' | 'go' | 'docker', required: The app's platform.
  - `port` integer, required: The port your app listens on. For `static`, `react`, `vue`, `angular`, `laravel`, `php`, `django` and `flask` it's always `80`, and for `next` always `3000`, whatever you send.
  - `sourceID` string: From `POST /v2/projects/{project_id}/sources`.
  - `image` string: Only for `docker` apps. A container image to deploy instead of source code.
  - `envs` object: If not empty, replaces all of the app's environment variables.
  - `args` string[]: Arguments to start the app with.
  - `cron` string[]: Scheduled jobs, each a cron schedule followed by a command. Only for `next`, `laravel`, `php`, `python`, `django`, `flask` and `go`.
  - `disks` DiskMount[]
    - `name` string, required: Name of one of the app's disks.
    - `mountTo` string, required: Where to mount it. Relative paths are relative to your app's root directory; `docker` apps must use absolute paths. Can't be `/`.
  - `healthCheck` object: Command that checks whether the app is healthy. Times are in milliseconds.
    - `command` string[]
    - `interval` integer
    - `timeout` integer
    - `retries` integer
    - `startPeriod` integer
  - `message` string: A note about the release. Longer text is cut off.
  - `gitInfo` object: Information about the commit being deployed, shown with the release.
    - `branch` string
    - `commit` string
    - `message` string
    - `committedAt` string
    - `remote` string
    - `tags` string[]
    - `author` object
      - `name` string
      - `email` string
  - `platformConfig` object: Platform-specific build settings. The allowed fields depend on `type`: | Platform | Fields | |----------|--------| | `node` | `version` (`8`, `10`, `11`, `12`, `14`, `16`, `18`, `20`, `22`, `24` or `latest`), `npmAudit`, `npmCiFallback`, `timezone`, `mirror` | | `next` | `nodeVersion` (`20`, `22`, `24`), `modifyConfig`, `npmCiFallback`, `mirror` | | `react`, `angular` | `mirror`, `sourceMap` | | `vue` | `mirror` | | `laravel` | `phpVersion` (`7.2`–`8.4`, `legacy` or `old-release 8.2`), `timezone`, `npmMirror`, `composerMirror`, `routeCache`, `configCache`, `buildAssets`, `ssr`, `modifyImagickPolicy`, `installDevDependencies`, `reverb`, `reverbPath`, `modifyHtaccess` | | `php` | `version` (`7.2`–`8.4`), `timezone`, `composerMirror` | | `django` | `pythonVersion` (`3.7`–`3.13`), `nodeVersion` (`14`, `16`, `18`, `20`), `timezone`, `settingsFile`, `modifySettings`, `collectStatic`, `compileMessages`, `geospatial`, `pipTimeout`, `mirror` | | `flask` | `pythonVersion` (`3.7`–`3.13`), `nodeVersion` (`14`, `16`, `18`, `20`), `appModule`, `timezone`, `mirror` | | `python` | `version` (`3.8`–`3.13`), `timezone`, `mirror` | | `netcore`, `dotnet` | `version` (`2.1`, `2.2`, `3.0`, `3.1`, `5.0`, `6.0`, `7.0`, `8.0`, `9.0` or `10.0`), `timezone`, `finalDllName`, `csprojectFile` | | `go` | `version` (`1.21`–`1.25`), `cgoEnabled`, `mainFile`, `timezone` | `mirror` (and `npmMirror` / `composerMirror`) download packages through Liara's package mirrors.
  - `build` object
    - `args` object: Build arguments.
    - `cache` boolean: Reuse cached layers from earlier builds.
    - `location` 'iran' | 'germany': Where to build. If omitted, a default is chosen for the app's platform. Your bundle plan must allow `germany`.
    - `dockerfile` string: Path of the Dockerfile, for `docker` apps.

## Response `201`

The release was created.

- object
  - `releaseID` string

## Other responses

- `400`: The body or `teamID` is invalid. For example: both or neither of `sourceID` and `image` were sent, a disk doesn't exist, a disk is mounted on `/`, a `docker` app uses a relative mount path, the app is frozen (`frozen_project`), or the image couldn't be found or declares volumes that have no disk mounted on them.
- `401`: The API token is missing, invalid or expired.
- `403`: With `teamID`: you aren't a member of the team (`team_not_found`), or you don't have the required permission on this app (`no_permission`).
- `404`: The app doesn't exist.
- `428`: You've reached today's deployment limit (`max_deployment_count_in_day`), or your bundle plan doesn't allow the `germany` build location (`germany_builder_not_allowed`).

---

[API](https://skmtc.dev/liara-cloud/apis/paas.md) - [All operations](https://skmtc.dev/liara-cloud/apis/paas/llms.txt) - [OpenAPI document](https://skmtc.dev/liara-cloud/apis/paas/revisions/610162e8a623?raw)
