# Nightscout

Nightscout puts readings from a continuous glucose monitor (CGM) on a website of your own, so the people who help look after someone with diabetes can follow along: a parent at work, a grandparent, a carer, or the school nurse. It was built in 2014 by parents of children with Type 1 diabetes who wanted to see their child's readings while the child was at school, and it has been community-built ever since.

Your phone's uploader app sends the readings to your Nightscout. Everyone you share it with sees the same graph, trends and treatment notes in a browser or a follower app.

ElfHosted runs Nightscout, unmodified, at its own address. We keep it running and updated, and back up its database every day. Your readings are private by default: nobody can see them without a token you give them.

> [!WARNING]
>
> **Nightscout is not a medical device**
>
> Nightscout is community software for sharing data. It is not a medical device, and it is not approved for making treatment decisions. Keep using your CGM's own app and alarms. Nightscout's alerts depend on your uploader app, your phone's connection and your follower's device as well as on the server, so treat them as an extra, never as the only alarm.

[Get a 7-day trial of ElfHosted Nightscout! 🪄](<https://store.elfhosted.com/product/nightscout/>)

## How do I access Nightscout?

Nightscout is available:

- From your dashboard: [https://your-username.elfhosted.com](<https://your-username.elfhosted.com>)
- Directly: [https://your-username-nightscout.elfhosted.com](<https://your-username-nightscout.elfhosted.com>)

> [!NOTE]
>
> **Signed-in users see their own URLs**
>
> The addresses above show the general pattern. [Sign in](<https://docs-internal.elfhosted.com/app/nightscout/>) and these become your personal, clickable links.

## How do I set it up?

### 1\. Choose your API secret

Nightscout needs an **API secret** before it will start: a password of at least 12 characters that your uploader app uses to send readings, and that unlocks the admin tools. Until you set one, your Nightscout address shows a "Boot error" page saying the API\_SECRET setting is missing. That is expected on a new instance.

Pick a long secret you don't use anywhere else, and set it with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>):

Quick-paste into Nightscout's environment variables using ElfBot

```
API_SECRET=choose-a-long-secret-of-12-or-more-characters
```

Nightscout restarts with it, and the boot error is replaced by your Nightscout.

While you're there, set the units your family reads in:

Quick-paste into Nightscout's environment variables using ElfBot

```
DISPLAY_UNITS=mmol
```

Use `mmol` for mmol/L or `mg/dl` for mg/dL.

### 2\. Connect your uploader app

Your uploader is the app that reads the CGM and sends the readings on (which one depends on your CGM and phone: see [Nightscout's guide to uploaders](<https://nightscout.github.io/>)). In its Nightscout settings, enter your Nightscout address, [https://your-username-nightscout.elfhosted.com](<https://your-username-nightscout.elfhosted.com>), and your API secret. Check the graph on your Nightscout page fills in with the next reading.

### 3\. Share it with the family

Your readings are **private by default**: someone who opens your Nightscout address sees nothing until they're signed in. Give each follower their own access token rather than your API secret, so you can take it away later without changing anything else:

1. Open your Nightscout, sign in with your API secret, and go to **Admin Tools**.
2. Under **Subjects**, add one per person (*"Nana", "School nurse"*) with the **readable** role.
3. Each subject gets an access link with its own token. Send that link to that person.

To stop someone seeing the readings, delete their subject.

> [!TIP]
>
> **Prefer an open page?**
>
> If you'd rather anyone with the address could see the graph, as Nightscout behaves out of the box elsewhere, set `AUTH_DEFAULT_ROLES=readable` with ElfBot. We default to private because these are health readings, and the address is reachable from anywhere so uploaders and followers can use it.

## What do we look after, and what don't we?

- **We run it and keep it updated.** Nightscout and its database run in your own space at ElfHosted, with nothing at home to keep switched on.
- **We back up the database every day.** If something goes wrong with your data, ask us on [Discord](<https://discord.elfhosted.com>).
- **We don't touch your readings or your devices.** Your uploader app, your phone, your CGM and its sensors, and your alarm settings are yours to set up and keep working.
- **Keep a second way to be alerted.** If your phone loses signal or the uploader stops, Nightscout has nothing new to show. Your CGM's own app and alarms are the ones to rely on.

## How do I get support for Nightscout?

1. For general use of Nightscout, refer to the [official site](<https://github.com/nightscout/cgm-remote-monitor>) or to one of the links in the resources section below.
2. For specific support re your ElfHosted configuration / account, see the [ElfHosted support options](</get-help/>)!

## Nightscout resources

- [Nightscout (*official site*)](<https://github.com/nightscout/cgm-remote-monitor>)
- [Nightscout Nightscout documentation](<https://nightscout.github.io/>)
- [Nightscout Website](<https://nightscout.info/>)
