--- title: "app.json" description: "Declare environment variables, process counts, a post-deploy script, and PostgreSQL or Valkey addons for your app in an app.json manifest." --- Place an `app.json` file at the root of your repository (or in your **Project Path**) and Miget reads it on every build. The format follows the Heroku [app.json schema](https://devcenter.heroku.com/articles/app-json-schema), so an existing Heroku `app.json` usually works as-is. `app.json` is read for apps deployed through [GitHub](/deployments/github-integration) or [git push](/deployments/git-push-to-builder), including Dockerfile builds. Apps deployed from a [container registry](/deployments/container-registry) or a [Docker Compose stack](/deployments/docker-compose-stacks) don't use it. ## Supported fields | Field | What Miget does with it | |-------|-------------------------| | `env` | Sets each variable on your app. Variables that already exist on the app keep their current value. `"generator": "secret"` generates a random value. | | `formation` | Sets the replica count of each process type from `quantity`. `size` is ignored. | | `scripts.postdeploy` | Runs after the app is serving, unless you set a **Post-Deploy Command** in the dashboard. | | `buildpacks` | Selects the build language, like the `BUILDPACKS` variable. | | `addons` | Provisions managed [PostgreSQL](/databases/postgresql) and [Valkey](/databases/valkey) addons. See below. | ## Addons Each entry in `addons` becomes a regular managed addon on your app: it shows up under **Addons** in the dashboard, and you manage, resize, back up, and delete it like any other addon. ```json app.json { "addons": [ "heroku-postgresql:essential-1", "heroku-redis:premium-0" ] } ``` Miget provisions the addons during your app's first build that includes them, before the release phase or [pre-deploy command](/overview/buildpacks) runs, so migrations can connect right away. The build waits up to 5 minutes for the addons to become ready. ### Plan names You can write each addon as a Heroku plan or as a Miget shorthand: | You write | You get | |-----------|---------| | `heroku-postgresql:` or `postgres:` | PostgreSQL 16 at the given tier | | `postgres` | PostgreSQL 16 at `essential-0` | | `heroku-redis:`, `redis:` or `valkey:` | Valkey 7.2 at the given tier | | `redis` or `valkey` | Valkey 7.2 at `mini` | The shorthand names aren't valid on Heroku. Use them only if you don't need the file to keep working there. ### Sizes Each tier maps to a fixed Miget size. The addon's CPU, RAM, and disk count toward your plan's resources. **PostgreSQL** | Tier | CPU | RAM | Disk | |------|-----|-----|------| | `mini`, `hobby-dev`, `hobby-basic`, `essential-0` | 0.2 | 256 Mi | 1 Gi | | `essential-1` | 0.5 | 512 Mi | 10 Gi | | `essential-2` | 0.5 | 1 Gi | 32 Gi | | `standard-0`, `premium-0` | 1 | 4 Gi | 64 Gi | | `standard-2`, `premium-2` | 2 | 8 Gi | 256 Gi | | `standard-3`, `premium-3` | 2 | 15 Gi | 512 Gi | | `standard-4`, `premium-4` | 4 | 30 Gi | 768 Gi | | `standard-5`, `premium-5` | 8 | 61 Gi | 1 Ti | | `standard-6`, `premium-6` | 16 | 122 Gi | 1.5 Ti | | `standard-7`, `premium-7` | 32 | 244 Gi | 2 Ti | **Valkey** | Tier | CPU | RAM | Disk | |------|-----|-----|------| | `mini` | 0.2 | 64 Mi | 128 Mi | | `premium-0` | 0.2 | 128 Mi | 256 Mi | | `premium-1` | 0.2 | 256 Mi | 512 Mi | | `premium-2` | 0.5 | 512 Mi | 1 Gi | | `premium-3` | 0.5 | 1 Gi | 2 Gi | | `premium-5` | 1 | 2 Gi | 4 Gi | | `premium-7` | 2 | 8 Gi | 16 Gi | | `premium-9` | 4 | 12 Gi | 24 Gi | | `premium-10` | 8 | 28 Gi | 56 Gi | | `premium-12` | 16 | 56 Gi | 112 Gi | | `premium-14` | 32 | 112 Gi | 224 Gi | Tiers above 8 Gi RAM are meant for custom plans. Contact us at [hello@miget.com](mailto:hello@miget.com) if you need one. You can't set a custom CPU, RAM, disk size, or version in `app.json`, and `options` is ignored. To get a different size or version, pick the closest tier and change the addon afterwards in the dashboard, or add the addon from the dashboard instead of `app.json`. ### Connection variables Miget sets one connection URL on your app for each addon, named after the addon's `as` value: | Addon | Default variable | With `"as": "CACHE"` | |-------|------------------|----------------------| | PostgreSQL | `DATABASE_URL` | `CACHE_URL` | | Valkey | `REDIS_URL` | `CACHE_URL` | Use `as` to attach two addons of the same type: ```json app.json { "addons": [ { "plan": "heroku-postgresql:standard-0", "as": "DATABASE" }, { "plan": "heroku-postgresql:essential-0", "as": "ANALYTICS_DB" }, { "plan": "heroku-redis:premium-0", "as": "REDIS" } ] } ``` This app gets `DATABASE_URL`, `ANALYTICS_DB_URL`, and `REDIS_URL`. If the variable already exists on your app, Miget keeps its value and doesn't point it at the new addon. PostgreSQL addons created from `app.json` have **Public Access** turned on. Turn it off on the addon page if you only connect from apps on Miget. ### Redeploys and changes - **Redeploying** reuses the addon Miget already created for that `as` name. It doesn't create a second one. - **Changing a tier** in `app.json` doesn't resize an existing addon. Resize it in the dashboard. - **Removing an entry** from `app.json` doesn't delete the addon. Delete it in the dashboard. - **Addons you added in the dashboard** aren't matched to `app.json` entries. If your app already has a PostgreSQL addon from the dashboard, a `heroku-postgresql` entry creates a second database, and `DATABASE_URL` keeps pointing at the first one. Remove the entry from `app.json` in that case. ### Unsupported addons Miget provisions only PostgreSQL and Valkey from `app.json`. Other addons (for example `mongolab` or `papertrail`), [MySQL](/databases/mysql), and tiers not listed above are skipped, and the build continues without them.