New Nightscout Users⌁
Welcome to Nightscout! There are many ways to get started with Nightscout that the Nightscout community supports. Nightscout is DIY (Do It Yourself), even if you don’t feel confident that you have the necessary skills, give it a try. You’ll find people that are willing to help you setting it up in many Facebook groups. For free. Paying it forward.
If you find it too complex or the maintenance too demanding you might be interested in Nightscout as a service.
Components, costs and complexity will depend on the solution you want to implement.
For an overview of other possibilities, see vendors.
Security and safekeeping⌁
It's highly important you understand you have to take computer security seriously when setting up Nightscout. We assume you have full legal ownership of all data being stored in your installation of Nightscout and that there are thus no liabilities you'd need to respond to regarding the data. Depending on how you use Nightscout, an unauthorized user could cause harm by for example changing the CGM data shown by Nightscout. We have no evidence of this having ever happened to anyone, but to keep it that way, take the following guidelines to heart:
- Use the same email address for all accounts to ensure you have access to the accounts going forward. Do not use a disposable email address.
- Do not use the same password for all your accounts, and choose passwords that are not easy to guess.
- Do not use the API_SECRET for the Atlas database password.
- Do not use your Dexcom or CareLink user name or password for Nightscout components.
- Do not share the API_SECRET or other passwords to your accounts to others.
- Do not use Nightscout or any related applications on rooted and/or otherwise compromized devices, and ensure you always have the latest operating system and virus protection updates installed.
If you want to read more about Nightscout security, including about additional configuration options to make your installation more secure, please check our security guide.
Print this document to record all information during installation. Store it together securely with your diabetes documentation.
Here is a step-by-step guide for completing your own Nightscout site DIY style.⌁
APPLIES TO: +
Create your Heroku, GitHub, and Atlas accounts from a computer.⌁
Do not change device/computer/browser during the setup process!
If you have unexpected issues when creating your site, restart with another browser.
If this is not your first attempt to deploy Nightscout
You might want to do some cleanup before.
Step 1: Create a GitHub account⌁
If you already have a GitHub account and previously forked cgm-remote-monitor
Make sure you delete your current cgm-remote-monitor fork using Step 1 of this guide (ONLY STEP1!).
You do not need several GitHub accounts for several Nightscout sites. You can connect one GitHub account to multiple Heroku apps and accounts.
a) Click this link to create a GitHub account: https://github.com/
Enter your email and click
Sign up for GitHub
b) Enter a password and a username (anything you want and that is accepted, not very important).
n to decline advertisement emails.
c) Play and solve the puzzle then click
d) GitHub will send you a verification code. Open your mail and check your inbox (check your spam-folder if not received after a couple of minutes).
e) A personalization sequence will start, click
Skip personalization at the bottom.
f) Leave the page that opened as it is. Don't close it.
Step 2: Create a Heroku account⌁
a) Click this link to create an Heroku account: https://signup.heroku.com/login
b) Enter mandatory data (*) and click
CREATE FREE ACCOUNT
c) Heroku will send a confirmation email, open your mail and check your inbox (check your spam-folder if not received after a couple of minutes).
d) Click on the activation link
e) Create a password, it is important that you write it down for later usage. Click
SET PASSWORD AND LOG IN
CLICK HERE TO PROCEED
Read and accept Salesforce terms of service.
Se sei residente in Italia, abilita l'interruttore
Are you domiciled in Italy, leggi e accetta le condizioni supplementari.
g) Your Heroku page will open, click on your profile picture, in the top right corner, and select
h) Click on
Add credit card
j) Enter your credit card information and click
Unless you voluntarily select billable features, your credit card information is only used for verifications and you will not be charged anything. Worst case you’ll be charged $0.00
k) You should now have 2 pages open: Heroku and GitHub. Leave them open.
Step 3: Create an Atlas account⌁
a) Open another tab at: https://www.mongodb.com/cloud/atlas and click
Get started now
b) Enter your information, click
MongoDB Atlas will send you an email, if you don't receive it check your Spam folder.
In the email you received from MongoDB Atlas (mongodb-atlas @ mongodb.com), click on
Another browser tab will open with your confirmed MongoDB account,
Enter some information (like below) and click
Create a cluster in Shared Clusters (FREE)
If you ever see this, just STOP
We're building a free cluster: you don't need to provide any billing information.
d) Leave all default values and click
Atlas will create your default cluster, wait until it is complete... (can take more than 3 minutes)
e) Click on
f) Click on
Allow Access from Anywhere
If you don't allow access from anywhere (IP 0.0.0.0/0) Nightscout will not be able to access your database.
g) Click on
Add IP Address
h) Add a database username (for example
nightscout) and a database password (in the example below
soo5ecret but please change it!).⌁
Database credentials: Do not use your Atlas account credentials. Do not use special characters: only letters and numbers.
Write down these credentials in the boxes below (yes, in this browser window you're reading now, unless you're reading a printed version). You’ll need them later.
i) Then click
Create Database User.
j) Click on
Choose a connection method
Connect your application
l) Copy the connection string: click
Copy and paste it somewhere to edit it (like Notepad).
m) Paste the string in the box below (yes, in this browser window you're reading now, unless you're reading a printed version).
It should be similar to this (
xxxxx will be different):
n) Invent a name for your database, this is not a critical information (for example
mycgmic), note that default is
o) Click the
Generate button (just here below this line: in this browser window you're reading):
The connection string will appear here
Keep this string safely aside, it is called your
p) If you want to do it manually: replace
<password> with your database password as noted previously (in the example below
<dbname> by any text you want, say
mycgmic for example. The result will be like this:
There are no < and > characters in the final string, neither for password nor for database name.
Step 4: Fork and deploy cgm-remote-monitor⌁
If you previously forked cgm-remote-monitor before reaching this step, you should delete the existing cgm-remote-monitor repository before proceeding
Delete your current cgm-remote-monitor fork using Step 1 of this guide (ONLY STEP1!).
a) You should now have 3 pages opened in your browser: Heroku, Atlas, and Github, Make sure you are logged-in on each one (i.e. not asking you to login) before you continue.
b) Click this link https://github.com/nightscout/cgm-remote-monitor, a new GitHub page will open. Click on
c) Wait for a moment
d) Scroll down and click
Deploy to Heroku
You're getting into the core setup of your site
Below you'll see the minimum required configuration, you can modify the variables later in Heroku.
e) Enter your CGM in the Cloud site name: invent a name you will use to see your BG in the cloud. Confirm that the name is available.
f) Don’t change the region.
Scroll down and setup the following variables:
API_SECRET will be your Nightscout site password, it needs to be at least 12 characters long and you should NOT use spaces if you use @ or ! symbols remember you will probably need to express them using Percent encoding in your uploader and downloader apps. If you're not sure on how to do this, it is recommended to use only letters (uppercase + lowercase) and digits.
The API_SECRET is the main password allowing full access to your Nightscout site. Make sure it's reasonably secure (mix uppercase and lowercase letters, plus digits) and do no not share it publicly. If you think you exposed it by mistake, it is recommended that you change it.
h) If you want to link your Dexcom Share account as a data source, complete the following lines:
If you use a DIY closed loop system it is recommended that you let it upload to Nightscout instead of importing using Dexcom Share and the
MOST COMMON ERRORS
BRIDGE_USER_NAME are NOT visible from within your Dexcom app or online account. These values are what you entered into your Dexcom mobile app when you logged into that app for the VERY FIRST time. The
BRIDGE_USER_NAME is not an email address. The most common error on initial Nightscout setups is that people incorrectly use an old account or an old password. To test your username and password, go to Dexcom's Clarity page (check here for USA accounts and here for the others) and try logging in to your Dexcom account. If your account info isn't valid, or you don't see any data in your Clarity account... you need to figure out your actual credentials before moving ahead.
Some people have had problems with their bridge connecting when their Dexcom passwords are entirely numeric. If you have connection issues in that case, try changing your password to something with a mix of numbers and letters.
You need to have at least one follower to use Dexcom Share. See here.
i) Linking your CareLink account as a data source is not functional anymore with Heroku. Do not use the plugin below. There are alternative solutions with an Android phone and a private version of xDrip+ (recommended), or (not recommended: verify availability for your pump and country) a computer or a Raspberry Pi to bridge CareLink to Nightscout.
j) Select the units you’re using in
DISPLAY_UNITS acceptable choices are
mmol/L (or just
ENABLE, copy and paste the following words (separated by a space) so that won't have to think about which you want now:
careportal basal dbsize rawbg iob maker cob bwp cage iage sage boluscalc pushover treatmentnotify loop pump profile food openaps bage alexa override speech cors
You find more information about the
ENABLE words on the: Setup page
l) Now you need the connection string you defined during the Atlas cluster creation (as the example below, but not the string below). Copy and paste it in the
MONGODB_URI variable field.
If you compiled all the fields and successfully generated the string this is what you should copy in
Sorry... something is missing for me to make it automatically...
If you preferred to make it yourself, make sure it looks like this:
m) Scroll down to the end of the list and click
n) WAIT until completion (will take some time). Do not interrupt the process until it's complete.
o) Then click
View (if nothing happens, click
Manage App ->
Open App, in upper right corner)
p) Your Nightscout site should open and direct you to a new profile creation.
q) Setup your
Time zone and eventually all other fields. Do not leave any fields empty. If you don't know which value to use, just use the default value. You can change these values later at any time.
r) Browse down to
Authentication status and click
Authenticate. Enter your API secret. Click
t) If the following pop-up shows up click
OK, and check status (upper right of the window).
u) If you need to modify your profile after this, authenticate with the lock icon (top right of the page): enter your API secret. Then click on the hamburger menu and select
Anyone with access to the URL of your Nightscout site, can view your BG and run reports of your data. It it strongly recommended that you enable security to your site once you're done with the setup.
v) Dexcom Share and CareLink users should see data flowing in after some minutes. Other uploaders like xDrip+, Spike, xDrip4iOS, etc will need to be setup with the Nightscout address and API secret in the app.
- Finally, you might want to modify the
PAPERTRAIL_API_TOKENline. Heroku offers a free, tiny amount of Papertrail service (this is like a logging service for how the site is running), but this generates a lot of confusion to most people later on, when they get a message that their "Free Papertrail Service has run out of room". Papertrail is not needed, edit the line and add
DISABLEDat the end, so that you can recover the function if you need it later.
Step 5: Uploader setup⌁
Continue to uploader setup.
Editing Config Vars in Heroku⌁
- Select your app
- Scroll down and click
Reveal Config Vars
- You can modify the values clicking on the pen icon
- Change the contents of
Valueas needed then click
Changing a variable and saving a new value will restart your site, if the change is not actuated you might also want to restart all dynos.