Magento 2 on Heroku

Magento 2

Magento 2 on Heroku is what powers the online shop. This is a blog running on Heroku. Look for a post on integrating the two in the future. My first step was to deploy to Heroku. Here’s one of the few resources I found, but it is a good one.

In a nutshell, download the latest 2.x version from Then unpack, create a local git repository & commit.

$ mkdir Magento
$ cd Magento
$ tar xjvf ~/Downloads/Magento-CE-2.3.4-2020-01-16-11-26-09.tar.bz2
$ git init
$ git add .
$ git commit -m "Initial commit of Magento"

Normally, you would have to move auth.json.sample to auth.json in the repository to allow Composer to pull from the Magento repository. The PHP buildpack for Heroku will use the value of the COMPOSER_AUTH environment variable instead. It should also be in JSON format, as shown below.

$ heroku create
$ heroku config:set COMPOSER_AUTH='{ "http-basic": { "": { "username": "<public-key>", "password": "<private-key>" }}}'
$ git push heroku master

Need an authentication key? I relied on the following documentation.

Are you using WordPress and Magento 2 on Heroku? Tell me about it in the comments!