Deploying Laravel App to Heroku

You, LaravelHeroku
Back

The steps are very simple and Laravel works out of the box to support on Heroku. One major important thing is Laravel will not work without the APP_KEY variables so make sure you create that variable via the UI from your App settings or use the command as described below, how Laravel works on your local environment is that it has the .env file to provide the APP_KEY but Heroku doesn't need that to function.

First off in your Laravel project make sure you initialize the git repository where you have composer.json and other files. Heroku need composer.json in your root folder to run builds.

Okay, let's start with login in to Heroku,

heroku login

Then create new application

heroku apps:create

Set up buildpacks, you might not need both since you might do the npm stuff in your local and deploy the complied code.

heroku buildpacks:add heroku/php
heroku buildpacks:add heroku/nodejs

Set App related configs.

heroku config:set APP_KEY=YOURBASE64KEY

Replace the YOURBASE64KEY with your key.

Deploy Laravel App to Heroku

git push heroku master
© Heshan Wanigasooriya.RSS

🍪 This site does not track you.