You are reading Nuxt 2 docs. Head over nuxt.com for Nuxt 3 docs.

Deploy Nuxt on Heroku

How to deploy Nuxt on Heroku?


We recommend you read the Heroku documentation for Node.js .

You can set up and configure your app via the Heroku dashboard or the Heroku CLI .

First, we create our app. Then we add the Node.js buildpack and configure the app to listen on the host 0.0.0.0:

heroku create myapp
heroku buildpacks:set heroku/nodejs
heroku config:set HOST=0.0.0.0

Your app's Settings section on the Heroku dashboard should contain this:

nuxt config vars Heroku

Finally, we can push the app on Heroku with:

git push heroku master

To deploy a non-master branch to Heroku use:

git push heroku develop:master

where develop is the name of your branch.

You can optionally configure automatic deploys from a selected branch of your app's GitHub repository in the Deploy section of your app in the Heroku dashboard.

Voilà! Your Nuxt application is now hosted on Heroku!

Edit this page on GitHub Updated at Thu, Feb 9, 2023