I have gone through various documentation to deploy my first nuxt application, honestly, I had a hard time finding the right guide which could help me to make my application live. Finally, after a thorough workout, I could make it work live.

Set current directory (CD) to the root of the folder where you are intended to put your application and upload your files and folders there. (Do not upload node_modules and .nuxt folder)

Once your files are there in the folder, run npm install, and the process will install all the required dependencies

Open package.json file which is located in your application’s root folder and locate line “dev”: “nuxt”, and replace it with “dev”: “nuxt –hostname nuxtjs.projects.itinnovator.in –port 49000”, of course, replace your domain name.

Next, run npm run dev. Now the application is running on https://nuxtjs.projects.itinnovator.in:49000

The question is this is still in development mode, and once you close the connection in putty, it will stop working. So how can we have it permanently there?

When you finished your development and ready to go live, follow below steps

run npm run build

open the package.json file and add a new line after “generate” command in scripts “deploy”: “pm2 start npm –name jigesh — start” (Change “Jigesh” with your application name)

run npm run deploy

Above steps have added your application to pm2 server which will keep it open forever. Now you can turn off putty to test it. However, this is not the exact end, how can you access your site with domain name https://nuxtjs.projects.itinnovator.in rather than https://nuxtjs.projects.itinnovator.in:49000?

I knew that was the question moving around in your mind, so my next solution is for that.