Skip to content

Commit e6eb2b4

Browse files
committed
docs: add data persist section to Docker README
1 parent 9cfa2bf commit e6eb2b4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

influxdb/content.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,28 @@ docker exec -it influxdb3-enterprise influxdb3 generate token --admin
4747
docker exec -it influxdb3-enterprise influxdb3 create database enterprise_db --token <your_admin_token>
4848
```
4949

50+
## Mount data to persist across restarts
51+
52+
To persist the `/var/lib/influxdb3` directory, use a volume mount:
53+
54+
```bash
55+
docker run -d --name influxdb3-core \
56+
-v influxdb3-data:/var/lib/influxdb3 \
57+
-p 8086:8086 \
58+
influxdb:3
59+
```
60+
61+
Or bind a to a local host directory:
62+
63+
```bash
64+
docker run -d --name influxdb3-core \
65+
-v $PWD/influxdb3-data:/var/lib/influxdb3 \
66+
-p 8086:8086 \
67+
influxdb:3
68+
```
69+
70+
Ensure the directory exists and has appropriate write permissions.
71+
5072
# What is InfluxDB?
5173

5274
InfluxDB is the time series data platform designed to handle high write and query workloads. Using InfluxDB, you can collect, store, and process large amounts of timestamped data, including metrics and events for use cases such as DevOps monitoring, application metrics, IoT sensors, and event monitoring.

0 commit comments

Comments
 (0)