How to publish to Heroku

Heroku allows you to get your prototype online quickly. You can then share your prototype with others and test it with users and on different devices.

DO NOT enter real user data into prototypes hosted on Heroku. If your prototype stores or collects user data, talk to a security professional about appropriate security steps you must take.

A prototype deployed on Heroku is called an app.

1. Setup Git

Before you can use Heroku, you need to set up Git on your prototype.

2. Sign up to Heroku

If you’re new to Heroku, sign up for a free account (opens in new window). When asked what language you use, select node.js.

3. Install the Heroku toolbelt

Install the Heroku toolbelt (opens in new window).

The toolbelt lets you use Heroku through the terminal. You will need to restart the terminal after installing the toolbelt.

4. Login to Heroku

Log into your Heroku account by running:

heroku login

5. Choose a name for your app

You need a unique name for your app. The name is used in the url for your prototype. For example the name:

nhsuk-medicines-prototype

will create an app at:

nhsuk-medicines-prototype.herokuapp.com

6. Create your app

To create your app, enter in the terminal:

heroku apps:create [name of your app] --region eu

Replace [name of your app] with your app name from step 5.

7. Set a username and password

Prototypes made with the kit require a username and password when published online. This stops members of the public coming across your prototype by accident.

To set username:

heroku config:set PROTOTYPE_USERNAME=username_here --app [name of your app]

To set password:

heroku config:set PROTOTYPE_PASSWORD=password_here --app [name of your app]

8. Deploy your changes

Make sure any changes you've made to your prototype have been committed to git.

git add .
git commit -m "your commit message here"

Then push your work to Heroku:

git push heroku master

Deploying may take a minute or so.

9. View your prototype online

After your work is deployed, you will be able to view it on the web by visiting [name].herokuapp.com.

You can also open your prototype in a browser by running:

heroku open