# Render

> Deploy Pegasus applications to Render platform with PostgreSQL, Redis, automatic builds, and Celery worker support for web services.

Pegasus supports deploying to [Render](https://render.com/) as a standard Python application.

### Prerequisites

[Section titled “Prerequisites”](#prerequisites)

If you haven’t already, create your Render account.

To use celery you will need to upgrade to a paid plan.

### Deploying

[Section titled “Deploying”](#deploying)

Once you’ve logged into Render you can create your app as follows:

1. In the Render dashboard, create a new blueprint
2. Connect your GitHub or Gitlab account and select your project’s repository
3. Configure the *Blueprint Name* and select the branch you want to deploy from
4. Review the configuration, add settings and click ‘Apply’

This will kick off the process to create your PostgreSQL database and Redis instances as well as deploy your web application (configured in your project’s `render.yaml` file).

**After deploying, review the [production checklist](/deployment/production-checklist) for a list of common next steps**

### Build Script

[Section titled “Build Script”](#build-script)

The `build.sh` file is run by Render to run the commands needed to build the app, as [described here](https://render.com/docs/deploy-django#create-a-build-script). This is also where “release” commands like `collectstatic` and `migrate` run.

If there are other commands (e.g. `./manage.py bootstrap_subscriptions`) that you want to run on every deploy you can add them to `build.sh`.

If you enable celery, it will use the `build_celery.sh` file, which runs the basic build steps, but not the “release” commands. You generally should not need to modify this file.

#### (Optional) Running Migrations in the Release Phase

[Section titled “(Optional) Running Migrations in the Release Phase”](#optional-running-migrations-in-the-release-phase)

If you want, you can optionally run the database migrations in the release phase using Render’s [Deploy steps](https://render.com/docs/deploys#deploy-steps) functionality.

This is not required, and notably **it is not supported on Render’s free tier**, but may lead to a more consistent deployment process.

To do this, first remove the following lines from `deploy/build.sh`:

```bash
echo "Running database migrations"
python manage.py migrate
```

Then create the following file at `deploy/pre_deploy.sh`:

```bash
#!/usr/bin/env bash