{"id":1133,"date":"2019-09-27T07:22:33","date_gmt":"2019-09-27T07:22:33","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=1133"},"modified":"2019-11-27T09:57:50","modified_gmt":"2019-11-27T09:57:50","slug":"deploying-laravel-project-on-heroku-server","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/","title":{"rendered":"Deploying Laravel Project On Heroku Server"},"content":{"rendered":"<p><strong>Heroku<\/strong> is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in a cloud. Applications written in most of the languages available out there can be deployed remotely on Heroku without any hurdle. Also, one can keep track of the changes (through version control support in Heroku) and test their functionalities globally on Heroku.<br \/>\n<br \/>\nOne can create a laravel project on Heroku Cloud and can make their applications live with URL provided by Heroku and test their functionality giving the application a feel of live deployment.<br \/>\n<br \/>\nLet\u2019s commence with the procedure by following the steps below.<br \/>\n<\/p>\n<ol>\n<li>\n<strong>Installing Heroku CLI<\/strong><br \/>\nInstall Heroku Command Line by running the below command in terminal &#8211;<br \/>\n<\/p>\n<pre>sudo snap install --classic heroku<\/pre>\n<p><small>(In this post, we have used Ubuntu 18.04 OS . For other OS, visit  <a href=\"https:\/\/devcenter.heroku.com\/articles\/heroku-cli#download-and-install\" style=\"color:blue;\">Heroku CLI<\/a> )<\/small><br \/>\n<br \/>\nAnd, to verify whether Heroku CLI is successfully installed, run &#8211; <\/p>\n<pre>heroku --version<\/pre>\n<p>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/heroku-version.png\" alt=\"heroku-version\" \/><\/p>\n<p>\n<\/li>\n<li>\n<strong>Create Laravel Application<\/strong><br \/>\nNow, for installing Laravel Application, we are using the composer. In the terminal, run the below command &#8211;<\/p>\n<pre>composer create-project laravel\/laravel herokularavel --prefer-dist<\/pre>\n<\/li>\n<li>\n<strong>Creating Procfile<\/strong><br \/>\nA <strong>Procfile<\/strong> is a text file that is normally kept inside the root of the project and it basically specifies the commands that will run at the time of startup. So, create a file name Procfile and add the below line to it and save it in the root of the project created.<br \/>\n<\/p>\n<pre>web: vendor\/bin\/heroku-php-apache2 public\/<\/pre>\n<p>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/heroku-editor.png\" alt=\"heroku-editor\"\/>\n<\/li>\n<li>\n<strong>Make Your Project a Git Repo<\/strong><br \/>\nRun the following command to initialize your project as Git repository. Already, initializing your project as git repo will make it easy to be implemented on Heroku otherwise, some errors come into picture while you are directly migrating your project\/application into Heroku server.<\/p>\n<pre>git init<\/pre>\n<p>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/heroku-git.png\" alt=\"\" \/>\n<\/li>\n<li>\n<strong>Log into your Heroku account<\/strong><br \/>\nLog into the Heroku account from the terminal. Here I was already logged into my Heroku account from a browser, so the terminal redirected me directly to the browser and back to the terminal after successful login.<\/p>\n<pre>heroku login<\/pre>\n<p>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/heroku-login.png\" alt=\"\"\/><br \/>\n<br \/>\nNow, the terminal will redirect to browser &#8211;<br \/>\n<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/login-heroku.png\" alt=\"\"\/><br \/>\n<br \/>\nAfter a successful login, the terminal will show a message like &#8211;<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/logging-done.png\" alt=\"\" \/>\n<\/li>\n<li>\n<strong>Creating a Heroku Application<\/strong><br \/>\nExecute <code style=\"font-size: 12px;\">heroku create<\/code> in terminal to create a Heroku application. Heroku will provide a random name to your application, along with URI for git repo and URL to access your application<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/heroku-create.png\" alt=\"\"\/><br \/>\n<br \/>\nAfter the creation of application on Heroku Server &#8211;<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/heroku-create1.png\" alt=\"\"\/><\/p>\n<\/li>\n<li>\n<strong>Laravel Encryption Key Setup<\/strong><br \/>\nNow, we need to configure the laravel encryption key with the <a href=\"https:\/\/studysection.com\/heroku-platform-foundation\" style=\"color:blue;\">Heroku Application.<\/a> Run the following command in the terminal to view the encryption key of laravel application and copy the same.<\/p>\n<pre>php artisan key:generate --show<\/pre>\n<p>It will return a key like this &#8211;<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/generate.png\" alt=\"\"\/><br \/>\n<br \/>\nCopy the key and paste it after <code style=\"font-size: 12px;\">heroku config:set APP_KEY=<\/code>  in terminal.<br \/>\nIt will look something like this &#8211; <code style=\"font-size: 12px;\">heroku config:setAPP_KEY=base64:Rst************************zzwA=<\/code><br \/>\n<br \/>\n<img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/app-key.png\" alt=\"\"\/>\n<\/li>\n<li>\n<strong>Pushing Laravel Project to GIT<\/strong><br \/>\nAfter setting up the <a href=\"https:\/\/studysection.com\/laravel-5.x-advanced\" style=\"color:blue;\">Laravel application <\/a> on Heroku, we will push the laravel code into Git using the following command &#8211;<\/p>\n<pre>git add .<\/pre>\n<p>After pushing, commit the same on Git using the command &#8211; <\/p>\n<pre>git commit -m \"Laravel Project Deployment on Heroku\"<\/pre>\n<p>At last we will push the code on Heroku Server &#8211;<\/p>\n<pre>git push heroku master<\/pre>\n<\/li>\n<li>\n<strong>Start the Application<\/strong><br \/>\nExecute the following command to run the Heroku application &#8211; <\/p>\n<pre>heroku open<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/laravel.png\" alt=\"\"\/><br \/>\n<br \/>\nAfter that, you can visit application anytime globally via generated URL in Step 6<br \/>\nI.e. <a style=\"color:blue;\" href=\"https:\/\/aqueous-plateau-61450.herokuapp.com\/\">https:\/\/aqueous-plateau-61450.herokuapp.com\/<\/a>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Heroku is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in<\/p>\n","protected":false},"author":1,"featured_media":1156,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[156,192,65,193],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Study section blog for Deploying Laravel Project On Heroku Server<\/title>\n<meta name=\"description\" content=\"Heroku is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in a cloud.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Study section blog for Deploying Laravel Project On Heroku Server\" \/>\n<meta property=\"og:description\" content=\"Heroku is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in a cloud.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-27T07:22:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-27T09:57:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/laravel-heroku.png\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"Deploying Laravel Project On Heroku Server\",\"datePublished\":\"2019-09-27T07:22:33+00:00\",\"dateModified\":\"2019-11-27T09:57:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/\"},\"wordCount\":522,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"Heroku\",\"Heroku CLI\",\"laravel\",\"Laravel Application\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/\",\"url\":\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/\",\"name\":\"Study section blog for Deploying Laravel Project On Heroku Server\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2019-09-27T07:22:33+00:00\",\"dateModified\":\"2019-11-27T09:57:50+00:00\",\"description\":\"Heroku is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in a cloud.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploying Laravel Project On Heroku Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Study section blog for Deploying Laravel Project On Heroku Server","description":"Heroku is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in a cloud.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/","og_locale":"en_US","og_type":"article","og_title":"Study section blog for Deploying Laravel Project On Heroku Server","og_description":"Heroku is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in a cloud.","og_url":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2019-09-27T07:22:33+00:00","article_modified_time":"2019-11-27T09:57:50+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/09\/laravel-heroku.png","type":"image\/png"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"Deploying Laravel Project On Heroku Server","datePublished":"2019-09-27T07:22:33+00:00","dateModified":"2019-11-27T09:57:50+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/"},"wordCount":522,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["Heroku","Heroku CLI","laravel","Laravel Application"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/","url":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/","name":"Study section blog for Deploying Laravel Project On Heroku Server","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2019-09-27T07:22:33+00:00","dateModified":"2019-11-27T09:57:50+00:00","description":"Heroku is PaaS i.e Platform as a Service Cloud platform, where developers can code, deploy, and run applications entirely in a cloud.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/deploying-laravel-project-on-heroku-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Deploying Laravel Project On Heroku Server"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":548,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1133"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=1133"}],"version-history":[{"count":20,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1133\/revisions"}],"predecessor-version":[{"id":1608,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1133\/revisions\/1608"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/1156"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=1133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=1133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=1133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}