> 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/get-started/quick-start.md). Agents can also search and read this documentation through its [MCP server](https://docs.netmap.dev/~gitbook/mcp).

# Quick Start

This procedure starts the published NetMap image with Docker Compose and the default bridge network. It is suitable for a first local deployment. For ARP/MAC discovery or Microsoft DHCP checks that need the host's LAN address, switch to host networking after reading [Docker Compose](https://docs.netmap.dev/install-and-upgrade/docker-compose.md).

## Before You Begin

You need:

* Docker Engine and Docker Compose v2;
* a host directory where NetMap can write persistent data; and
* TCP access to the web port from your browser.

Do not expose the initial setup page directly to the public internet. Put NetMap behind an HTTPS reverse proxy or restrict the port with your firewall before inviting users.

## 1. Create The Installation Directory

```bash
mkdir -p "$PWD/netmap/data"
cd "$PWD/netmap"
```

The `data/` directory will contain `netmap.db`, `firewall.db`, their SQLite sidecars, and application backups. Do not delete it when recreating the container.

## 2. Generate The Required Secrets

Run these commands on a machine with Python 3:

```bash
python3 -c 'import secrets; print(secrets.token_urlsafe(32))'
python3 -c 'import base64, os; print(base64.urlsafe_b64encode(os.urandom(32)).decode())'
```

The first output is the `SECRET_KEY`. The second is a Fernet-compatible `MASTER_KEY`. Generate each once, copy the values exactly, and keep them in a password manager or secret store. Do not regenerate them during an upgrade.

## 3. Create `.env`

Save this file as `netmap/.env`, replacing both placeholders and changing `PUID`/`PGID` if necessary. Run `id` on the host to see your user and group IDs.

```dotenv
APP_ENV=production
APP_PORT=8080
APP_URL=http://localhost:8080
DATA_DIR=/app/data
DATABASE_URL=sqlite:////app/data/netmap.db

SECRET_KEY=<paste-the-secret-key>
MASTER_KEY=<paste-the-fernet-master-key>

CORS_ORIGINS=["http://localhost:8080"]
TRUSTED_HOSTS=["localhost","127.0.0.1"]
AUTH_COOKIE_SECURE=false
SECURE_HSTS_ENABLED=false

PUID=1000
PGID=1000
LOG_LEVEL=info
```

For an HTTPS deployment, replace the URL/origin/host values and enable the secure cookie and HSTS settings only after TLS is working. See [Reverse Proxy and HTTPS](https://docs.netmap.dev/install-and-upgrade/reverse-proxy.md).

## 4. Create `docker-compose.yml`

```yaml
services:
  netmap:
    image: xoriin/netmap:latest
    container_name: netmap
    restart: unless-stopped
    env_file:
      - ./.env
    volumes:
      - ./data:/app/data
    ports:
      - "8080:8080"
      - "5514:1514/udp"
      - "5514:1514/tcp"
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: "5"
```

The syslog mappings are optional. Remove them if this installation will not receive syslog. Docker's default capabilities already include `NET_RAW` for ICMP/network tools and `NET_BIND_SERVICE` for low-port operations such as DHCP checks. Do not add `cap_drop: ALL`: NetMap also needs other default capabilities at startup, and the container exits without them.

## 5. Validate And Start

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

The health request should return:

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

If the container is still starting, wait a few seconds and repeat the health request. Check logs with `docker compose logs --tail=200 netmap` if it does not become healthy.

## 6. Complete First-Run Setup

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

1. Review Admin → System and confirm the application URL and retention values.
2. Confirm that the data directory is writable and persistent.
3. Add a test device in Inventory and run a safe monitoring check.
4. Configure a backup before adding production data.

After the first account exists, later visits use the sign-in screen.

<figure><picture><source srcset="https://4241216552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgPqKPcA5Ik65L8fL0ntv%2Fuploads%2Fgit-blob-3c0f4738abb78a92331e285cf2573a94d763e763%2Fsign-in-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://4241216552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgPqKPcA5Ik65L8fL0ntv%2Fuploads%2Fgit-blob-4ce82fad18dd4ec63832d028600a94263f454464%2Fsign-in-light.png?alt=media" alt="The NetMap sign-in screen, with the brand panel and username and password fields." width="800"></picture><figcaption><p>The NetMap sign-in screen.</p></figcaption></figure>

## 7. Optional API Smoke Test

To check that the API works, create a key and run the first requests in [API Quick Start](https://docs.netmap.dev/index/quick-start.md). Read [API Keys](https://docs.netmap.dev/index/authentication.md#api-keys) before you use keys in automation.

## Stop, Start, And Remove

Stop the service without deleting data:

```bash
docker compose stop
```

Start it again:

```bash
docker compose start
```

Remove the container and network while retaining the bind-mounted data:

```bash
docker compose down
```

Do not run `docker compose down -v` for this bind-mounted installation unless you have deliberately reviewed what else the Compose project owns.

## Next Steps

* [Docker Compose](https://docs.netmap.dev/install-and-upgrade/docker-compose.md) for host networking, ports, logging, and source builds;
* [Choose a Data Directory](https://docs.netmap.dev/index-1/storage.md) for ownership and backup planning;
* [Configure Environment Variables](https://docs.netmap.dev/index-1/configuration.md);
* [Add a Device](https://docs.netmap.dev/how-to-guides/add-device.md); and
* [Verify a New Installation](https://docs.netmap.dev/operations/health-checks.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
