> For the complete documentation index, see [llms.txt](https://docs.netmap.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netmap.dev/installation/quick-start.md).

# Quick Start

## 1. Create Directories

```bash
mkdir -p <install-dir>/data
cd <install-dir>
```

## 2. Generate Secrets

```bash
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
```

## 3. Create Environment File

```dotenv
SECRET_KEY=<secret-key>
MASTER_KEY=<fernet-master-key>
APP_URL=http://localhost:8080
CORS_ORIGINS=["http://localhost:8080"]
TRUSTED_HOSTS=["localhost","127.0.0.1"]
AUTH_COOKIE_SECURE=false
SECURE_HSTS_ENABLED=false
```

Save it as `<install-dir>/.env`.

## 4. Create Compose File

```yaml
services:
  netmap:
    image: xoriin/netmap:latest
    restart: unless-stopped
    env_file:
      - ./.env
    environment:
      APP_ENV: production
      APP_PORT: "8080"
      DATA_DIR: /app/data
      DATABASE_URL: sqlite:////app/data/netmap.db
      PUID: "1000"
      PGID: "1000"
    network_mode: host
    volumes:
      - ./data:/app/data
    tmpfs:
      - /tmp
    cap_add:
      - NET_RAW
```

## 5. Start

```bash
docker compose up -d
docker compose ps
curl --fail http://127.0.0.1:8080/api/health
```

Expected response:

```json
{"status":"ok"}
```

## 6. Create The First Account

Open `http://localhost:8080/` and complete the setup form. The first account becomes the initial administrator.

## 7. Add Your First Device

Open Inventory or Topology and create a device with at least a display name and IP address.

## 8. Generate An API Key

Open Profile, create an API key, and store the plaintext value immediately.

## 9. Test API Access

```bash
API_URL="http://localhost:8080"
API_KEY="<api-key>"

curl --fail-with-body \
  --url "${API_URL}/api/v1/auth/me" \
  --header "X-API-Key: ${API_KEY}" \
  --header "Accept: application/json"
```

Expected result: JSON for the API-key owner.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.netmap.dev/installation/quick-start.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
