> 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/operations/backups.md).

# Backups

Backups protect the part of NetMap that cannot be recreated from the Docker image. Treat backups as an operational requirement before upgrades, configuration changes, and restore testing.

## What To Back Up

Back up:

* `data/`
* `.env`
* `docker-compose.yml`
* any secret files referenced by `SECRET_KEY_FILE`, `MASTER_KEY_FILE`, or `OIDC_CLIENT_SECRET_FILE`
* reverse-proxy configuration needed to reach NetMap

The data directory contains both the main app database and firewall/syslog database.

## Filesystem Backup

Stop NetMap before a simple filesystem backup so SQLite WAL sidecars are in a consistent state:

```bash
cd <install-dir>
docker compose stop
tar -czf "netmap-backup-$(date +%Y%m%d-%H%M%S).tar.gz" data .env docker-compose.yml
docker compose up -d
```

Verify:

```bash
curl --fail http://127.0.0.1:8080/api/health
```

## Application Backup

SuperAdmins can use the backup endpoint:

```
GET /api/v1/exports/backup
```

Use the UI Exports/Admin backup controls where available. This is preferable when you cannot stop the container.

## Retention

Keep enough restore points to recover from:

* accidental deletion;
* failed upgrade;
* database corruption;
* compromised administrator or API key;
* unnoticed syslog volume growth.

## Backup Verification

A backup is not complete until it has been restored in a safe test location. Verify:

* `/api/health` returns `{"status":"ok"}`;
* login works;
* devices and topology load;
* IPAM data is present;
* security/syslog history is present if expected;
* API keys behave as expected.

## Related Pages

* [Storage](/configuration/storage.md)
* [Restores](/operations/restores.md)
* [Disaster Recovery](/operations/disaster-recovery.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 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/operations/backups.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.
