You are browsing Nuxt 2 docs. Go to Nuxt 3 docs, or learn more about Nuxt 2 Long Term Support.

Page traduite Le contenu de cette page peut être déprécié.

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!