How To Host Your Next.js Application For Free On Heroku

Photo by imgix on Unsplash

Some Definitions

Prerequisites

npx create-next-app name-of-app
npm buildor yarn build
view of built nextjs app
npm startoryarn start
Nextjs running on a mac
yarn dev
"start": "next start -p $PORT","heroku-postbuild": "npm run build"
creating a new repository
HostNextjsOnHeroku
$ git init
$ git remote add origin https://github.com/just1and0/HostNextjsOnHeroku.git
$ git add .
$ git commit -m "initial commit"
$ git push -u origin master
creating a new app on Heroku
creating a new app on Heroku

Conclusion

Founder of React Native Nigeria 🇳🇬 👻👻Building cheef.ng 👻👻 JS Lover ● Don’t forget to 👏 and follow!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store