Deploying the NextJS app on Heroku

You can use heroku cli to deploy the NextJS app on Heroku. First download Heroku CLI and then login to Heroku through heroku login command.

heroku git:remote -a appName
git remote -v 
git subtree push --prefix=js-nodejs/awesometut/ heroku main
  • heroku git:remote -a appName - This command will add remote for heroku repo
  • git remote -v - Check if heroku repo is listed in remotes
  • git subtree push --prefix=js-nodejs/awesometut/ heroku main - Push the changes from main branch to heroku. Here I am using subtree but you can have simple push command without prefix if you are not using git subtree.
Complex problems, Simple Solutions