# Set up and check your key

> Deepgram workshops › Field inspection logger workshop › Set up and check your key
> Web version: https://workshops.deepgram.com/events/field-inspection-logger/setup

### Get ready for step 1 {#set-up}

**Goal:** Get the kit running on step 1, and see the page say **Ready** in green, which means Deepgram accepts your key.

We're building a web page that listens to you talk and writes your inspection report for you.

**Step 1 of 7.** Done: none yet. Now: step 1, server and key check. Still to come: steps 2 to 7.

**So far:** a Deepgram API (application programming interface) key and a computer with a microphone.

**In this step, you'll:**

- Get the kit and add your key.
- Start the app and open the page in your browser.
- See Deepgram accept your key.

Use the way to run the app you chose on the [overview](/events/field-inspection-logger/overview#get-the-kit): a Codespace, your own computer, or Docker. Not sure? Use the Codespace.

This page has every command you need. Each kit setup page has the same steps in more detail: [Codespace](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/setup-codespace.md), [your own computer](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/setup-own-computer.md), or [Docker](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/setup-docker.md).

### Open a terminal {#open-a-terminal}

A terminal is a window where you type a command and press Enter. The computer runs it and prints its answer in the same window. Copy each command from the grey box, paste it in, and press Enter.

- **Mac.** Press Command and Space together to open Spotlight. Type `Terminal` and press Enter. To paste, press Cmd+V.
- **Windows.** Click the Start menu, type `PowerShell`, and click **Windows PowerShell**. To paste, right-click inside the window or press Ctrl+V.
- **Codespace.** The terminal is built in. It's the panel at the bottom of the editor. If you don't see it, open the menu with the three lines at the top left, then choose **Terminal** and **New Terminal**.

On your own computer or with Docker, check that git is there first. Run `git --version`. It should print a version number. If it doesn't, see the fixes below.

On your own computer, also check Node, the free program that runs the app. Run `node -v`. It must print `v20.12.0` or higher, such as `v22.11.0`. If it prints a lower number or says "command not found" or "not recognized", install the LTS version from [nodejs.org](https://nodejs.org), then open a new terminal.

With Docker, also open Docker Desktop and wait until it says **Engine running**. Leave it open for the whole workshop.

**You should see:** a window with a line where you can type.

### Get the kit and go to step 1 {#get-step-one}

1. On your own computer or with Docker, download the kit in the terminal you opened. In a Codespace, the kit is already there, so skip to step 3.

   ```
   git clone https://github.com/deepgram-devs/field-inspection-logger-workshop.git
   ```

   This makes a folder called `field-inspection-logger-workshop` in your home folder, where a new terminal starts. We call it the project folder.

2. Move into the project folder. Run this in every new terminal you open for the workshop. In a Codespace, a new terminal already starts there.

   ```
   cd field-inspection-logger-workshop
   ```

3. Go to step 1. Codespace or your own computer:

   ```
   npm run step 1
   npm install
   ```

   Docker:

   ```
   docker compose run --rm app npm run step 1
   ```

   The first time, Docker downloads what it needs, so this can take a few minutes.

   You'll see `You are on step 1: Server and key check.` Some advice about restarting follows. Ignore it for now, because the app isn't running yet.

**You should see:** the `You are on step 1` line in the terminal.

On Windows, PowerShell may say that running scripts is disabled. See [Scripts are disabled on Windows](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/troubleshooting.md#scripts-are-disabled-on-windows).

### Add your key {#add-your-key}

The app reads your key from a settings file called `.env` in the project folder. You make it by copying the example file. Do this only once. If you run the copy command again later, it replaces your key with an empty line.

```
cp .env.example .env
```

That works on a Mac, in Windows PowerShell, and in a Codespace. In the older Windows Command Prompt, use `copy .env.example .env` instead.

Open the file. On a Mac, run `open -e .env`. On Windows, run `notepad .env`. Either way, the file opens in a new text window. Names that start with a dot are hidden in Finder, so use the command instead of looking for the file.

In a Codespace, click `.env` in the file list on the left. If you don't see it, click the refresh arrow at the top of the file list.

The file has a line that reads `DEEPGRAM_API_KEY=`. Paste your key right after the equals sign, on the same line, with no spaces and no quotes. Save the file with Cmd+S on a Mac or Ctrl+S on Windows.

If a text window opened, close it. Then go back to the terminal.

**You should see:** your key on the `DEEPGRAM_API_KEY=` line, saved.

Put your key only in `.env`, never in `.env.example`. The kit keeps `.env` on your computer, while `.env.example` is shared with everyone.

### Start the app and check your key {#check-that-it-works}

1. Start the app. Codespace or your own computer: run `npm start`. Docker: run `docker compose up --watch`. You'll see `Inspection logger running at http://localhost:3000`.

   This terminal is now **the app terminal**: the terminal where the app is running. It stays busy while the app runs, so you can't type other commands in it. Leave it open.

2. Open **a second terminal**, another terminal window in the same project folder. Other commands go there while the app runs.

   - **Mac.** Click **Shell** in the menu bar, then **New Window**, then the first item in the list.
   - **Windows.** Open **Windows PowerShell** from the Start menu again. This opens another window.
   - **Codespace.** Click the plus sign at the top right of the terminal panel. It opens in the project folder, so you're done.

   On a Mac or Windows, move the new window into the project folder:

   ```
   cd field-inspection-logger-workshop
   ```

3. In your browser, go to http://localhost:3000. In a Codespace, use the **Open in Browser** button or the **Ports** tab instead. The app opens only on this computer, so no one else on your network can use your key.
4. Look at the label at the top of the page. It says **Step 1: Server and key check**.
5. Look at the status line, the colored bar near the top. It says "Checking your Deepgram key..." in grey, then turns green and says **Ready**. On a slow or blocked network, the grey line can stay for about 8 seconds.

There's nothing to click in this step.

**You should see:** the status line say **Ready** in green. If it turns red, read what it says and use the fixes below.

### Fix what looks wrong {#if-something-looks-wrong}

The page checks the key only when it loads. After a key fix, restart the app and reload the page. To restart, press Ctrl+C in the app terminal and run `npm start`. With Docker, run `docker compose restart app` in your second terminal.

- **"No key found. Put DEEPGRAM_API_KEY in the .env file."** Put your key in the file named `.env`, not `.env.example`, and save it. See [No key found](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/troubleshooting.md#no-key-found).
- **"Deepgram rejected the key. Check for a typo or an extra space."** Copy the key again from the Deepgram console, paste it right after the equals sign in `.env`, and save. See [Key typos](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/troubleshooting.md#key-typos).
- **The terminal says the app needs Node 20.12 or newer.** Install a newer Node from nodejs.org, or use a Codespace or Docker.
- **`git --version` says "command not found" or "not recognized".** On a Mac, a box may offer to install developer tools. Click **Install**, wait, and try again. On Windows, install git from [git-scm.com](https://git-scm.com), then open a new terminal. If your work computer blocks the install, use a Codespace.
- **A command says it can't find a file.** The terminal is in the wrong folder. Run `cd field-inspection-logger-workshop` and try again. In a Codespace, run `cd /workspaces/field-inspection-logger-workshop`.

For anything else, such as a port already in use or the page not opening, find what you see in the [Start here](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/troubleshooting.md#start-here) table. To ask for help, follow [Asking for help](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/troubleshooting.md#asking-for-help). Never paste your key.

### Move between steps {#move-between-steps}

Every later page starts with the same switch. Codespace or your own computer:

1. Click in the app terminal and press Ctrl+C to stop the app. On a Mac, that's Control, not Cmd.
2. Run `npm run step N`, with the step's number. You'll see `You are on step N` and the step's name.
3. Run `npm start`, then reload the page.

Docker: the app restarts by itself. In your second terminal, run `docker compose run --rm app npm run step N`. Wait about 10 seconds, then reload the page.

If the page looks stuck after you switch, restart the app, then reload the page. If the step command prints an error and no `You are on step` line, see [The step command shows an error](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/troubleshooting.md#the-step-command-shows-an-error).

If you changed any files, the step command saves your changes before it switches, and says so. Your `.env` file is never touched.

### See why it works (optional) {#under-the-hood}

The app has two halves. The server runs in the app terminal and holds your key. The page runs in your browser and asks the server questions at addresses such as `/api/health`. The key never reaches the browser.

**Ready** means Deepgram recognized your key. It doesn't check what the key is allowed to do. To read the code, open `server.js` and the `checkKey` function in `src/app.js`. The kit's [step 1 page](https://github.com/deepgram-devs/field-inspection-logger-workshop/blob/main/docs/step-1.md) has more.

### Confirm you're ready for step 2 {#ready-for-step-two}

You're set up when the page in your browser shows two things. The colored status line near the top is green and says **Ready**. The label at the top names **Step 1: Server and key check**. Leave the app running, and go on to step 2 when the host does.
