Deploy Nuxt on Dokku
How to deploy a Nuxt application on Dokku?
We recommend to read Dokku documentation for the setup and Deploying a Node.js Application on Digital Ocean using Dokku .
For the example, we will call our Nuxt application my-nuxt-app.
We need to tell Dokku to install the devDependencies of the project (to be able to launch npm run build):
// on Dokku Server
dokku config:set my-nuxt-app NPM_CONFIG_PRODUCTION=false YARN_PRODUCTION=false
Also, we want our application to listen on the host 0.0.0.0 and run in production mode:
// on Dokku Server
dokku config:set my-nuxt-app HOST=0.0.0.0 NODE_ENV=production
You should see these 3 lines when you type dokku config my-nuxt-app

Then, we tell Dokku to launch npm run build via the scripts.dokku.predeploy script in our project app.json:
create a file name app.json in our project root folder
{
"scripts": {
"dokku": {
"predeploy": "npm run build"
}
}
}
To launch the application we run npm run start using the Procfile :
web: npm run start
Finally, we can push our app on Dokku with:
// commit your change before push.
git remote add dokku dokku@yourServer:my-nuxt-app
git push dokku master
Voilà! Our Nuxt application is now hosted on Dokku!
Mag
Stefan Huber
Olga Bulat
Maciek Palmowski
Sébastien Chopin
Daniel Roe
Clément Ollivier
Paiva
Florian Reuschel
Rishi Raj Jain
Savas Vedova
Steven Soekha
Vinícius Alves
Kareem Dabbeet
Valentín Costa
Ryan Skinner
Alex Hirzel
Ajeet Chaulagain
René Eschke
Nico Devs
Muhammad
Nazaré da Piedade
Naoki Hamada
Tom
Yann Aufray
Anthony Chu
Nuzhat Minhaz
Lucas Portet
Richard Schloss
bpy
Antony Konstantinidis
Hibariya
Jose Seabra
Eze
Florian LEFEBVRE
Lucas Recoaro
Julien SEIXAS
Hugo
Sylvain Marroufin
Spencer Cooley
Piotr Zatorski
Vladimir Semenov
Harry Allen
kazuya kawaguchi
Unai Mengual
Hyunseung
Alexandre Chopin
pooya parsa
Nick Medrano
Mosaab Emam
Ilja
Heitor Ramon Ribeiro
Nero
Yoon Han
Ikko Eltociear Ashimine