Want to take a look at our new docs? Our new docs are now in beta. Have fun!

How to deploy on Heroku?

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

First, we want our application to listen on the host 0.0.0.0 and run in production mode:

heroku config:set HOST=0.0.0.0
heroku config:set NODE_ENV=production

You should see this in your Heroku dashboard (Settings section):

nuxt config vars Heroku

Heroku uses a Procfile (name the file Procfile with no file extension) that specifies the commands that are executed by the apps dynos. To start the Procfile will be very simple, and needs to contain the following line:

web: nuxt start

This will instruct run the nuxt start command and tell heroku to direct external HTTP traffic to it.

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.

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

Contributors

Contribution for this page is now closed. If you would like to contribute please check out our new docs are now in beta. Have fun!

Platinum Sponsors

Storyblok Support Us