Deploy React App on Heroku

Tech Geek
2 min readJan 7, 2020

--

Requirements:

  1. Node / NPM — Click the link and download the installer
  2. Git — Click the link and download the installer
  3. Heroku CLI — Click the link and download the installer

With your terminal still, open navigate to your React app folder and change directory into it. Now we need to connect our project to Heroku. If you haven’t already installed the Heroku CLI. To make sure it’s installed correctly run this command:

  • heroku — version

You should see your Heroku CLI version. Once that is installed we need to setup up Heroku git repository by running these commands:

  1. heroku login (Enter your Heroku credentials)
  2. git init
  3. git add .
  4. git commit -m “initial commit”
  5. heroku create (You should see two links after running this command. Copy the second one)
  6. git remote add heroku PASTE THE LINK YOU JUST COPIED
  7. git push heroku master

Once you run the last command Heroku will start to run some tests on your app. If everything goes right you should see a successful deploy message. Now you’re able to navigate to your app by running:

  • heroku open

Anytime you make changes to your app and want to re-deploy the only commands you need to run are:

  1. git add .
  2. git commit -m “any message goes here”
  3. git push heroku master

Enjoy your free hosting! Cheers...

--

--

Tech Geek
Tech Geek

Written by Tech Geek

I’m a software developer from India, currently working with blockchain.

No responses yet