Skip to content

gianmarcomurru/heroku-starter-medusa

Repository files navigation

Medusa

Deploy Medusa App on Heroku

The following documentation will guide you through the one-click creation of a new Medusa project hosted on Heroku. Follow the steps below to get ready.
Deploy

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

Setup

1. Install Heroku

Ubuntu

sudo snap install --classic heroku

MacOS

brew tap heroku/brew && brew install heroku

Windows

Download the appropriate installer for your Windows installation:

64-bit installer 32-bit installer

2. Login to Heroku from your terminal

heroku login

Follow the instructions on your terminal

3. Install MedusaCLI

git clone https://github.com/gianmarcomurru/heroku-starter-medusa.git
cd heroku-starter-medusa

4. Create an Heroku App

HEROKU_PROJECT=medusa-$(uuid | cut -d "-" -f1)
heroku create $HEROKU_PROJECT
heroku git:remote -a $HEROKU_PROJECT

5. Install Postgresql and Redis on Heroku

Postgresql

Install Postgresql using this command

heroku addons:create heroku-postgresql:hobby-dev

RedisToGo

⚠️ Heroku requires you to add a payment method before installing RedisToGO

heroku addons:create redistogo:nano

6. Configure the environment variables on Heroku

heroku config:set NODE_ENV=production
heroku config:set MY_HEROKU_URL=$(heroku info -s | grep web_url | cut -d= -f2)
heroku config:set JWT_SECRET=your-super-secret
heroku config:set COOKIE_SECRET=your-super-secret-pt2
heroku config:set NPM_CONFIG_PRODUCTION=false

7. Build the project

npm install cross-env babel-preset-medusa-package

8. Push changes to Heroku

git add .
git commit -m "Deploy Medusa App on Heroku"
heroku buildpacks:set heroku/nodejs
git push heroku HEAD:master

9. Check Heroku build logs

heroku logs -n 500000 --remote heroku --tail

Visit docs.medusa-commerce.com for further guides.

Website | Notion Home | Twitter | Docs

tags: MedusaJS Heroku Documentation

About

A Medusa starter that works with Heroku

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published