|
| 1 | +--- |
| 2 | +title: 'Install on Heroku' |
| 3 | +tags: ['heroku', 'docker'] |
| 4 | +keywords: ['NocoDB Heroku', 'Install NocoDB', 'NocoDB Docker'] |
| 5 | +--- |
| 6 | + |
| 7 | +Heroku is a cloud platform that makes it easy to deploy and scale applications. This guide shows how to get **NocoDB** running on Heroku using a pre-configured template with minimal setup. |
| 8 | + |
| 9 | +## Quick Deploy Button |
| 10 | + |
| 11 | +[](https://www.heroku.com/deploy/?template=https://github.com/nocodb/nocodb) |
| 12 | + |
| 13 | +Click the button above to spin up NocoDB on Heroku instantly. Just follow the guided setup. Once finished, your instance will be live at a Heroku-generated URL. |
| 14 | + |
| 15 | +## Pricing & Requirements |
| 16 | + |
| 17 | +Since Heroku retired its free plans in 2022, deploying NocoDB now incurs minimal costs: |
| 18 | + |
| 19 | +| Component | Plan | Estimated Cost | |
| 20 | +| ------------------- | ------------------- | -------------- | |
| 21 | +| App Server (`web`) | Basic Dyno | \$7/month | |
| 22 | +| Database (Postgres) | `heroku-postgresql` | \$5/month | |
| 23 | +| Cache (Redis) | `heroku-redis` | \$3/month | |
| 24 | + |
| 25 | +You can scale up these resources based on usage. See [Scaling](#scaling) for details. |
| 26 | + |
| 27 | +## Connecting External Storage (Optional) |
| 28 | + |
| 29 | +By default, uploaded files are stored temporarily in the dyno and are lost on restart. To retain files across restarts, configure NocoDB to use an S3-compatible bucket. |
| 30 | + |
| 31 | +Go to **Settings → Reveal Config Vars** in the Heroku dashboard and add: |
| 32 | + |
| 33 | +``` |
| 34 | +NC_AWS_ACCESS_KEY_ID=your-access-key |
| 35 | +NC_AWS_SECRET_ACCESS_KEY=your-secret-key |
| 36 | +NC_AWS_BUCKET=your-bucket-name |
| 37 | +NC_AWS_REGION=us-east-1 |
| 38 | +NC_AWS_ENDPOINT=https://s3.amazonaws.com |
| 39 | +NC_AWS_CUSTOM_DOMAIN=your.custom.domain (optional) |
| 40 | +``` |
| 41 | + |
| 42 | +### Using DigitalOcean Spaces or Others |
| 43 | + |
| 44 | +You can use any S3-compatible provider (e.g., DigitalOcean, Wasabi): |
| 45 | + |
| 46 | +``` |
| 47 | +NC_AWS_ENDPOINT=https://ams3.digitaloceanspaces.com |
| 48 | +NC_AWS_REGION=ams3 |
| 49 | +NC_AWS_CUSTOM_DOMAIN=your-space-name.ams3.digitaloceanspaces.com |
| 50 | +``` |
| 51 | + |
| 52 | +## Fixing Common Login Errors |
| 53 | + |
| 54 | +If you receive a “Could not connect to the API server” error, you probably need to set the public URL. |
| 55 | + |
| 56 | +1. Go to **Settings → Reveal Config Vars** in your Heroku app. |
| 57 | +2. Add or edit the `NC_PUBLIC_URL` variable: |
| 58 | + |
| 59 | + ``` |
| 60 | + NC_PUBLIC_URL=https://your-app-name.herokuapp.com |
| 61 | + ``` |
| 62 | + |
| 63 | + Replace `your-app-name` with the actual name of your Heroku app. |
| 64 | + |
| 65 | +## Scaling |
| 66 | + |
| 67 | +Heroku starts you off with a basic dyno and minimal add-ons. You can improve performance by scaling up your dyno type or increasing worker count. |
| 68 | + |
| 69 | +### Adjusting Worker Count |
| 70 | + |
| 71 | +NocoDB can handle more load with multiple workers. Each worker needs \~512MB RAM. |
| 72 | + |
| 73 | +To increase: |
| 74 | + |
| 75 | +1. Go to **Settings → Reveal Config Vars**. |
| 76 | +2. Add or update: |
| 77 | + |
| 78 | + ``` |
| 79 | + NC_WORKER_COUNT=2 |
| 80 | + ``` |
| 81 | + |
| 82 | +### Postgres Add-on |
| 83 | + |
| 84 | +The default `heroku-postgresql:mini` tier supports up to 10,000 rows. For larger datasets, upgrade to a higher-tier plan. |
| 85 | + |
| 86 | +### Redis Add-on |
| 87 | + |
| 88 | +Likewise, `heroku-redis:mini` supports 20 connections. Estimate needed connections using: |
| 89 | + |
| 90 | +``` |
| 91 | +DYNO_COUNT * WORKER_COUNT * 15 |
| 92 | +``` |
| 93 | + |
| 94 | +Then upgrade accordingly. |
| 95 | + |
| 96 | +## Custom Domains |
| 97 | + |
| 98 | +To run NocoDB under your own domain: |
| 99 | + |
| 100 | +1. Add your domain via **Settings → Domains** in Heroku. |
| 101 | +2. Update your `NC_PUBLIC_URL` variable: |
| 102 | + |
| 103 | + ``` |
| 104 | + NC_PUBLIC_URL=https://yourdomain.com |
| 105 | + ``` |
| 106 | + |
| 107 | +## Required Environment Variables |
| 108 | + |
| 109 | +| Variable Name | Description | |
| 110 | +| -------------------------- | -------------------------------------------------------------------- | |
| 111 | +| `SECRET_KEY` | Secret string for securing sessions | |
| 112 | +| `NC_JWT_SECRET` | Secret used to sign JWT tokens | |
| 113 | +| `NC_PUBLIC_URL` | Public-facing URL (e.g., [https://example.com](https://example.com)) | |
| 114 | +| `NC_WORKER_COUNT` | Number of workers to run | |
| 115 | +| `NC_AWS_ACCESS_KEY_ID` | S3 access key | |
| 116 | +| `NC_AWS_SECRET_ACCESS_KEY` | S3 secret key | |
| 117 | +| `NC_AWS_BUCKET` | Name of your S3 bucket | |
| 118 | +| `NC_AWS_REGION` | (Optional) AWS region or equivalent | |
| 119 | +| `NC_AWS_ENDPOINT` | (Optional) Custom endpoint URL | |
| 120 | +| `NC_AWS_CUSTOM_DOMAIN` | (Optional) Custom domain for static file hosting | |
| 121 | + |
| 122 | +## Updating NocoDB on Heroku |
| 123 | + |
| 124 | +To pull the latest version of NocoDB: |
| 125 | + |
| 126 | +1. Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) |
| 127 | +2. Authenticate: |
| 128 | + |
| 129 | + ``` |
| 130 | + heroku login |
| 131 | + ``` |
| 132 | +3. Deploy from source: |
| 133 | + |
| 134 | + ```bash |
| 135 | + git clone https://github.com/nocodb/nocodb.git |
| 136 | + cd nocodb |
| 137 | + heroku git:remote -a YOUR_APP_NAME |
| 138 | + git push heroku master |
| 139 | + ``` |
| 140 | + |
| 141 | +> Replace `YOUR_APP_NAME` with your actual Heroku app name. |
| 142 | +
|
| 143 | +## Cleaning Up (Optional) |
| 144 | + |
| 145 | +If you cloned the repo just for updating, you can clean up afterward: |
| 146 | + |
| 147 | +```bash |
| 148 | +cd .. |
| 149 | +rm -rf nocodb |
| 150 | +``` |
0 commit comments