Nightscout in Render


Too complicated? Not what you’re looking for?

Consider a hosted Nightscout service! Check for easier solutions here.


Render

Render Free

You can create your Nightscout site in Render.

Pros:

  • No credit card required

Cons:

  • The free plan doesn’t guarantee any reliability

  • App will sleep after 15 minutes

  • Render URLs are considered unsafe by some internet providers

  • Relying on the MongoDB Atlas database



Step 0: Create a database

Render doesn’t include a database

Make sure you created one before starting your Nightscout web app creation with Render. Come back here when you have a MONGODB_URI connection string.

Migrating?

Copy the connection string from your previous platform: edit the variables and look for MONGODB_URI. If you don’t see MONGODB_URI but see MONGO_CONNECTION (NOT MONGO_COLLECTION): use its value.


Step 1: Create a GitHub account and fork the Nightscout project

Continue with Step 2.

Create a GitHub account

a) Click this link to create a GitHub account: https://github.com/

Enter your email and click Sign up for GitHub

../../../_images/NewNS00a.png

b) Enter a password and a username (anything you want and that is accepted, not very important).
Type n to decline advertisement emails.

../../../_images/NewNS00.png

c) Play and solve the puzzle then click Create account

../../../_images/NewNS01.png

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).

../../../_images/NewNS02.png

e) If a personalization sequence starts, click Skip personalization at the bottom.

../../../_images/NewNS03.png

f) Leave the page that opened as it is. Don’t close it.

../../../_images/NewNS04.png

You have created your GitHub account. Now fork the Nightscout project.


Fork the Nightscout project

a) Click here to log in at GitHub: https://github.com/login.
Enter your username or email and your password. Click Sign in

../../../_images/UpdateNS00.png

If you already have a fork of cgm-remote-monitor in GitHub

Delete or update your current cgm-remote-monitor fork before continuing.

b) Open this link https://github.com/nightscout/cgm-remote-monitor. Click on Fork

../../../_images/NewNS29.png

Confirm with Create fork

Warning

Make sure you deselect Copy the master branch only.

../../../_images/NewNS51.png

c) Wait for a moment

../../../_images/NewNS30.png

d) You now have a copy (fork) of the Nightscout project repository in your own GitHub.

../../../_images/UpdateNS30.png

Update your Nightscout fork

  • Click here to log in at GitHub: https://github.com/login.

  • Enter your username or email and your password. Click Sign in

../../../_images/UpdateNS00.png

  • Select your own cgm-remote-monitor project (not nightscout/cgm-remote-monitor)

../../../_images/UpdateNS01.png

  • Your repository will open. If you see This branch is xxx commits behind nightscout:master you need to update.

  • Select Fetch upstream

../../../_images/UpdateNS01a.png

  • Select Fetch and merge

../../../_images/UpdateNS01b.png

  • After a moment, your repository should display This branch is up to date with nightscout:master

../../../_images/UpdateNS01c.png

You have now updated your GitHub cgm-remote-monitor repository.


If you ran into trouble, you can redeploy the project.



Step 2: Create a Render account

a) Open a new browser page in Render and select GET STARTED FOR FREE

../../../_images/Render01.png

b) Sign up with GitHub

../../../_images/Render02.png

c) Authorize Render

../../../_images/Render03.png

d) COMPLETE SIGN UP with your GitHub account email

../../../_images/Render04.png

e) Check your inbox and click the confirmation link

../../../_images/Render05.png


Step 3 - Deploy Nightscout in Render

Select below how you want to do this:

Step 4: Create your Nightscout service

  • From the dashboard, create a new Web Service.

../../../_images/RenderD01.png

  • Select Deploy an existing image from a registry then Next.

../../../_images/RenderD02.png

  • In the field Image URL type:

nightscout/cgm-remote-monitor:latest

Then Next.

../../../_images/RenderD03.png

  • InName put the name of your Nightscout site (Render will add an extension if it’s not unique).

../../../_images/RenderD04.png

  • Select the Region closer to where you live.

../../../_images/RenderD05.png

  • Select the Free instance type, knowing it will fall asleep (we’ll fix that later on).

../../../_images/RenderD06.png

  • Clicking the button + Add Environment Variable add the following two variables, and in the box on the right the matching value:

HOSTNAME	0.0.0.0
PORT		1337

../../../_images/RenderD07.png

You now need to setup core variables for your site:

  • Clicking the button + Add Environment Variable add the following three variables:

  • MONGODB_URI paste your database connection string from Step 0 above

  • 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.

Warning

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.

  • Define your DISPLAY_UNITS

Acceptable choices for the units used in Nightscout are mg/dl or mmol/L (or just mmol).

  • Once all three variables have been set, Create web Service

../../../_images/RenderD08.png

  • Your Nightscout site will be deployed. Wait until the operation completes after some minutes.

../../../_images/Render13.png

../../../_images/Render14.png

Congratulations. You created your new Nightscout site with Render.


Step 4: Add the render.yaml template

../../../_images/UpdateNS00.png

  • Select your own cgm-remote-monitor project.

../../../_images/UpdateNS01.png

  1. Open the branches list

  2. Type render

  3. Select Create a branch: render from ‘master’

../../../_images/NewBranch.png

  • Select Add File - Create new file

../../../_images/AddFile.png

  • Type render.yaml for the name. Leave it open like that for now.

../../../_images/Yaml00.png

  • Open the render.txt template from here and edit it with a notepad app, select all, copy and paste into the GitHub page you have open from above.

../../../_images/Yaml01.png

  • Scroll up the page in GitHub and select Commit changes top right.

../../../_images/Yaml02.png

  • Confirm with Commit changes.

../../../_images/Yaml03.png

  • Your cgm-remote-monitor project is ready for Render Blueprints deploy.


Step 5: First deploy in Render

a) Select Blueprints

../../../_images/Render06.png

b) Then New blueprint instance

../../../_images/Render07.png

c) Connect your cgm-remote-monitor project

../../../_images/Render08.png

d) Enter a name for your blueprint (anything simple, Nightscout is ok)

../../../_images/Render09.png

e) Click the drop down menu of Branch (1) then select render (2)

../../../_images/Render10.png

You now need to setup core variables for your site:

../../../_images/Render11.png

f) In MONGODB_URI paste your database connection string from Step 0 above

g) 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.

Warning

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) Define your DISPLAY_UNITS
Acceptable choices for the units used in Nightscout are mg/dl or mmol/L (or just mmol).


i) Once all three variables have been set, Apply

../../../_images/Render12.png

j) Your Nightscout site will be deployed. Wait until the operation completes after some minutes.

../../../_images/Render13.png

../../../_images/Render14.png

Congratulations. You created your new Nightscout site with Render.

The following step is important, don’t skip it.


Step 6: Delete the render branch

Hint

In order to deploy your site with a blueprint, you needed to modify your GitHub repository. Now you want to remove this modification so that you’ll be able to update it normally.

../../../_images/UpdateNS00.png

  • Select your own cgm-remote-monitor project.

../../../_images/UpdateNS01.png

  • Click on branches to display all.

../../../_images/Render18.png

  • Locate the render branch and click on the bin icon to delete it.

../../../_images/Render19.png

You have successfully removed the temporary modification required to deploy a new Render site.

../../../_images/Render20.png

  • Your Render site will redeploy using the normal master branch of cgm-remote-monitor, wait a few minutes until the operation completes.



  • From the menu, Dashboard, then select your web service.

../../../_images/Render15.png

../../../_images/Render16.png

  • This is your new Nightscout site, click on the URL to open it

../../../_images/Render17.png


New Nightscout Setup


a) Your Nightscout site should open and direct you to a new profile creation.

../../../_images/NewNS50.png

b) 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.

../../../_images/NewNS44.png

c) Browse down to Authentication status and click Authenticate. Enter your API secret. Click Update.

../../../_images/NewNS45.png

d) Click Save.

../../../_images/NewNS46.png

e) If the following pop-up shows up click OK, and check status (upper right of the window).

../../../_images/NewNS47.png

f) 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 Profile Editor.

../../../_images/NewNS43.png

Privacy warning

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


g) Dexcom Share users should see data flowing in after some minutes. xDrip+ users (including Medtronic CareLink followers) should setup the uploader as shown here. xDrip4iOS users here. AAPS and Loop: consult the relative documentation.

../../../_images/NewNS48.png

You have completed a new Nightscout site creation. You can continue here now.

The following section provides more information that you might not need to use now.




Editing Variables in Render


../../../_images/Render02.png

  • Select your web service

../../../_images/Render16.png

  • Go to Environment, your variables will display

../../../_images/Render21.png

  • You can modify variables by making the changes directly in the text boxes.
    You can also add variables with Add environment variable.
    When you’re done, scroll down and Save changes.

../../../_images/Render23.png

  • Wait a few minutes for your site to redeploy. You can track the status in Events.

../../../_images/Render24.png