{"id":26813,"date":"2022-05-23T11:09:10","date_gmt":"2022-05-23T11:09:10","guid":{"rendered":"https:\/\/www.bacancytechnology.com\/blog\/?p=26813"},"modified":"2024-12-27T08:39:27","modified_gmt":"2024-12-27T08:39:27","slug":"deploy-react-app-on-heroku","status":"publish","type":"post","link":"https:\/\/www.bacancytechnology.com\/blog\/deploy-react-app-on-heroku","title":{"rendered":"How to Deploy React App on Heroku?"},"content":{"rendered":"<p><i><strong>Are you looking for the simplest tutorial to deploy React app on Heroku? Do you want to deploy a project last minute and don\u2019t know how to do it? Here\u2019s the tutorial for you! <\/strong><\/i><\/p>\n<p><i><strong>In this tutorial, we have a simple to do ReactJS app which we will use to deploy. You can use any existing application or create a new one using create-react-app. Don\u2019t worry, we will discuss the steps from scratch.<\/strong><\/i><\/p>\n<h2>Introduction<\/h2>\n<p>Done with the development? It\u2019s time to deploy now! There are many services with which you can deploy your application. Heroku is one of them. It is an obvious choice when it comes to deployment. It provides facility to deploy, manage, and scale the application. You may find it intimidating but working with Heroku is super easy!<\/p>\n<h2>Login to Heroku Account<\/h2>\n<p>Go to <a href=\"https:\/\/id.heroku.com\/login\" target=\"_blank\" rel=\"noopener\">Heroku <\/a> and login to your account<\/p>\n<p>After successful login you will be redirected to dashboard page.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Dashboard-Page-min.png\" alt=\"Heroku Dashboard Page\" width=\"1100\" height=\"479\" class=\"aligncenter size-full wp-image-26831\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Dashboard-Page-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Dashboard-Page-min-300x131.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Dashboard-Page-min-1024x446.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Dashboard-Page-min-768x334.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<h2>Create a New Application<\/h2>\n<p>Click <i>create a new app<\/i> for getting started with application deployment.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-a-New-Application-min.png\" alt=\"Create a New Application\" width=\"1100\" height=\"505\" class=\"aligncenter size-full wp-image-26832\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-a-New-Application-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-a-New-Application-min-300x138.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-a-New-Application-min-1024x470.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-a-New-Application-min-768x353.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>As shown below, fill in the required fields and hit the Create app button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-app-button-min.png\" alt=\"Create app button\" width=\"1100\" height=\"473\" class=\"aligncenter size-full wp-image-26834\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-app-button-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-app-button-min-300x129.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-app-button-min-1024x440.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Create-app-button-min-768x330.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p class=\"boxed bg--secondary\" style=\"border: 1px solid #c7c7c7; box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);\"><strong><i><span style=\"font-size:22px; color:#000;\">Are you looking for proficient ReactJS developers highly-skilled with development and deployment as well?<\/span><br \/>\nContact Bacancy today and <a href=\"https:\/\/www.bacancytechnology.com\/hire-reactjs-developer\" target=\"_blank\" rel=\"noopener\">hire React developers<\/a> to start building your dream project!<\/i><\/strong><\/p>\n<h2>Add Buildpacks<\/h2>\n<p>To deploy React app on Heroku, we need to add buildpacks. Click on the Settings tab and then click on Add buildpack button inside the Buildpacks section.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Add-Buildpacks-min.png\" alt=\"Add Buildpacks\" width=\"1100\" height=\"821\" class=\"aligncenter size-full wp-image-26836\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Add-Buildpacks-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Add-Buildpacks-min-300x224.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Add-Buildpacks-min-1024x764.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Add-Buildpacks-min-768x573.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>Our React buildpack URL is https:\/\/github.com\/mars\/create-react-app-buildpack. Copy this URL and add it to buildpack like below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/React-buildpack-URL-min.png\" alt=\"React buildpack URL\" width=\"1100\" height=\"530\" class=\"aligncenter size-full wp-image-26837\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/React-buildpack-URL-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/React-buildpack-URL-min-300x145.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/React-buildpack-URL-min-1024x493.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/React-buildpack-URL-min-768x370.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>After that click on the Save Changes button. The Buildpacks section will now contain the URL which we have added. Refer to the below screenshot for the same.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Save-Changes-min.png\" alt=\"Save Changes\" width=\"1100\" height=\"396\" class=\"aligncenter size-full wp-image-26838\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Save-Changes-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Save-Changes-min-300x108.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Save-Changes-min-1024x369.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Save-Changes-min-768x276.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<h2>Deploy React App on Heroku: Using Heroku CLI<\/h2>\n<p>Click on the Deploy tab for deploying React app using Heroku Git.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min.png\" alt=\"Deploy tab for deploying React app\" width=\"1100\" height=\"493\" class=\"aligncenter size-full wp-image-26840\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-300x134.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-1024x459.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-768x344.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>There are three deployment methods for deploying an app on Heroku.<\/p>\n<p>1. Heroku Git<\/p>\n<p>2. Github<\/p>\n<p>3. Container Registry<\/p>\n<p>Here we will choose the first option for deployment: Heroku Git. Click to proceed further.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Git-min.png\" alt=\"Heroku Git\" width=\"1100\" height=\"487\" class=\"aligncenter size-full wp-image-26842\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Git-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Git-min-300x133.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Git-min-1024x453.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Heroku-Git-min-768x340.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>After clicking on the Heroku Git option the page below will appear. <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-1.png\" alt=\"Deploy tab for deploying React app\" width=\"1100\" height=\"493\" class=\"aligncenter size-full wp-image-26845\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-1.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-1-300x134.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-1-1024x459.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Deploy-tab-for-deploying-React-app-min-1-768x344.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<p>Now, we need to install Heroku CLI on our machine. Visit <a href=\"https:\/\/devcenter.heroku.com\/articles\/heroku-cli#install-the-heroku-cli\" target=\"_blank\" rel=\"noopener\">Heroku CLI<\/a> for the same.<\/p>\n<p>You can check the version using the following command<\/p>\n<pre>heroku \u2013version<\/pre>\n<p>After successfully installing heroku-cli, go to your project directory and use these commands for setting up Heroku repository.<\/p>\n<pre>\/\/ login\r\nheroku login\r\n\r\n\/\/ Create a new Git repository\r\ngit init\r\nheroku git:remote -a bacancy-todo-task\r\n\r\n\/\/ Deploy your application\r\ngit add .\r\ngit commit -am \"first commit\"\r\ngit push --set-upstream heroku master:main<\/pre>\n<p>Once done with firing the commands you have successfully deploy React app on Heroku.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/achieve-the-tutorials-goal-Deploy-React-app-on-Heroku-min.png\" alt=\"Tutorial goal achieved\" width=\"1100\" height=\"567\" class=\"aligncenter size-full wp-image-26846\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/achieve-the-tutorials-goal-Deploy-React-app-on-Heroku-min.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/achieve-the-tutorials-goal-Deploy-React-app-on-Heroku-min-300x155.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/achieve-the-tutorials-goal-Deploy-React-app-on-Heroku-min-1024x528.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/achieve-the-tutorials-goal-Deploy-React-app-on-Heroku-min-768x396.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<h2>Run the Application<\/h2>\n<p>Using <mark>heroku open<\/mark> you can check the application running on the URL.<\/p>\n<p>Now our application has been deployed successfully. So now we will go to https:\/\/bacancy-todo-task.herokuapp.com\/ URL and access our application.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Run-the-application-min-1.png\" alt=\"Run the application\" width=\"1100\" height=\"145\" class=\"aligncenter size-full wp-image-26847\" srcset=\"https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Run-the-application-min-1.png 1100w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Run-the-application-min-1-300x40.png 300w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Run-the-application-min-1-1024x135.png 1024w, https:\/\/www.bacancytechnology.com\/blog\/wp-content\/uploads\/2022\/05\/Run-the-application-min-1-768x101.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>Voila! Done with our deployment! Now you see deploying your application on Heroku wasn\u2019t a tough job after all. I hope you have understood the tutorial: How to Deploy React App on Heroku. Now start building your demo application and successfully deploy it on Heroku. Feel free to write us back if you have any suggestions, feedback, or queries. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you looking for the simplest tutorial to deploy React app on Heroku? Do you want to deploy a project last minute and don\u2019t know how to do it? Here\u2019s the tutorial for you! In this tutorial, we have a simple to do ReactJS app which we will use to deploy. You can use any [&hellip;]<\/p>\n","protected":false},"author":151,"featured_media":26850,"comment_status":"open","ping_status":"open","sticky":false,"template":"blog-new-template.php","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_lmt_disableupdate":"no","_lmt_disable":"","footnotes":""},"categories":[988],"tags":[],"coauthors":[2429],"class_list":["post-26813","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react"],"acf":[],"modified_by":"Binal Prajapati","_links":{"self":[{"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/posts\/26813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/users\/151"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=26813"}],"version-history":[{"count":0,"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/posts\/26813\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/media\/26850"}],"wp:attachment":[{"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=26813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=26813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=26813"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/blog\/wp-json\/wp\/v2\/coauthors?post=26813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}