Set Up Nightscout Using Heroku

18 Feb
Guides > Setup Guides > Set Up Nightscout Using Heroku

Heroku is an alternative to Azure for hosting of your Nightscout site. Pricing has changed over the last few years, but currently (2017), Heroku is again free to use for a 24×7 site.

The following directions specifically guide you through setting up a Nightscout site (for the first time) on Heroku.

IMPORTANT NOTE: Heroku automatically creates an mLab database for you during the setup process. You do not need to set up mLab separately. With the Deploy to Heroku setup, the mLab portion will be handled automatically.

To create your Nightscout website on Heroku:

  1. Create a GitHub account and your own fork of the CGM-Remote-Monitor. (This process is described in Step 1 on this page. Complete Step 1 and return this this page for Heroku setup.)
  2. Create a Heroku account. (Directions not provided. Follow the directions at Heroku to set up an account.)
  3. Go to your GitHub account, and select the CGM-Remote-Monitor.
  4. In the repository, scroll down to the README.md file, and click the purple “Deploy to Heroku” button. (Scroll down to it; do not click it from the list. If you click the README.md link in the list and then try the purple button, you will see this error: “No app.json located in the repo URL provided.” Scroll down to the purple “Deploy to Heroku” button instead.)
    Heroku - Deploy

  5. On the Heroku screen that opens, fill in the information requested:
    • App Name: this will be the name of your site (part of the URL)
      Heroku - Site Name

    • Config Variables: many of these you can adjust later, once your site is up and running, but you need to deal with a few of them during setup:
      • Mongo Collection: leave it at the default “entries”
      • API Secret: Enter a “secret” passphrase you will use for your site. It must be at least 12 characters. Be sure and write it down.
      • ENABLE: This is the variable that turns on all the features you want to use. There are many possible features and plugins available! To get started, try turning on popularly uses plugins by typing this string in, a space between each word, as shown: careportal, basal, bwp, iob, cob, cage, sage, iage, azurepush (If you know that you are setting up a “bridge” site, also enter the word bridge. If you have an Alexa and want to use it with Nightscout, also enter alexa.)
      • DISPLAY_UNITS: Enter your default display units. Choices: mg/dl (the default) or mmol.
      • BRIDGE_USER_NAME and BRIDGE_PASSWORD: If you are setting up a bridge site, enter the Dexcom user information in these fields.
  6. After you have filled in your variables, click the big “Deploy” button at the bottom of the screen.
  7. Heroku will begin deployment, which you will see in a box at the bottom of the page.
    Heroku - Running

  8. Be patient. This can take several minutes.
  9. Once Heroku tells you the app has been successfully deployed, click the “View” button to open the site in a browser. If the deployment was successful (and there are no errors with the variables you input), the site will be black with time and dashes. Once data is available from the uploader, data will show.
    Heroku - Success

  10. Your website url takes this format: http://YOURSITE.herokuapp.com

There are additional variables you may want/need to set later. To do so, return to your Heroku dashboard. Click “Settings,” and then click “Reveal config variables” to access the variables and make changes or additions.