package.json, installs dependencies, builds, and serves your app on a public URL.
Prerequisites
Before you start, make sure you have:- A Miget account.
- Git installed locally and your app in a Git repository.
- A Next.js app with a
package.json.
package.json scripts must include a build and start command so the buildpack can detect and run your app:
package.json
Every app on Miget must listen on
0.0.0.0:5000. Miget sets an immutable PORT=5000 environment variable, and public ingress only reaches port 5000. next start respects the PORT env var, so it binds to 5000 automatically - you don’t need to configure anything. See Ports for details.Deploy
Create an application
Go to app.miget.com, select New, then Application. Give your app a name, select the resource it should run in, and select Next.
Choose the builder
Select Auto detection (Miget Buildpacks) as the builder, pick a size, then select Next. Miget will detect Node.js from your
package.json.Select the deployment method
Select git push, then Create. Copy the git token shown - you’ll need it to authenticate your push.
This guide uses git push, but it’s one of several ways to deploy. You can also connect a GitHub repository for auto-deploys and pull request previews, deploy from a public Git repository, or push a prebuilt container image. See all deployment methods.
Add a database (optional)
Need persistent storage? Add a PostgreSQL database to your app:- Open your app’s Addons tab.
- Add a PostgreSQL addon.
DATABASE_URL environment variable (a postgres://... connection string) into your app. Read it in your code:
Next steps
Git push to builder
Learn how the git push deployment flow works end to end.
GitHub integration
Connect a repository for auto-deploys and PR previews.
Custom domains
Point your own domain at your Next.js app.
Fair Scheduler
Understand how Miget shares compute across your apps.

