Max SchmittMS
20th January 2019

How to deploy a Next.js app to Dokku

If you haven't already, create your Next.js app by following the procedure outlined in the Next.js docs.

To deploy a Next.js app to Dokku, you have to do two things:

1. Tell Dokku to build the app before running it:

app.json

{
"scripts": {
"dokku": {
"predeploy": "npm run build"
}
}
}

2. Tell Dokku how to start the app:

Procfile

web: npm start -- --port $PORT

That's it! :)