> ## Documentation Index
> Fetch the complete documentation index at: https://nango-scrips-ref.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy Nango with Heroku

<Info>
  These instructions only apply for **free** self-hosting features, not Enterprise features ([feature list](/host/cloud)).
</Info>

<Note>Read the [self-hosting instructions](/host/self-host/self-hosting-instructions) before deploying to production.</Note>

[![Deploy to heroku](https://mintlify.s3-us-west-1.amazonaws.com/nango-scrips-ref/images/nango-deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/NangoHQ/nango-heroku)

### Deployment Information[](#deployment-information "Direct link to Deployment Information")

The Heroku template generates a dedicated Nango Server instance as well as a
separate Postgres database.

Heroku no longer has a free tier, so using this template requires that you set
up your payment information in your Heroku account. This template uses the
lowest tier (\$7/month for the server, \$5/month for the database).

The Nango server will not work right away after you deploy the app on Heroku.
You need to set 2 environment variables in your Heroku app settings:

* `NANGO_SERVER_URL`: the full URL of your Heroku app (or your custom domain)
* `NANGO_DATABASE_URL`: the value for the `DATABASE_URL` Heroku config var, to
  which you should append `?sslmode=no-verify` (i.e.
  `<DATABASE_URL>?sslmode=no-verify`)

Finally, you should restart the app and it will work.

You do not need to set the `SERVER_PORT` environment variable.
