You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/influxdb/v1/introduction/install/docker.md
+57-5Lines changed: 57 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,6 @@ This guide covers Docker installation, configuration, and initialization options
35
35
-[Access the InfluxDB CLI](#access-the-influxdb-cli)
36
36
-[Next steps](#next-steps)
37
37
38
-
39
38
## Install and run InfluxDB
40
39
41
40
### Pull the InfluxDB v1.x image
@@ -44,8 +43,34 @@ This guide covers Docker installation, configuration, and initialization options
44
43
docker pull influxdb:{{< latest-patch >}}
45
44
```
46
45
46
+
### Volume permissions
47
+
48
+
> \[!Important]
49
+
> The InfluxDB Docker container runs as user influxdb with UID/GID 1500.
50
+
> When mounting volumes for persistent storage, ensure the mounted directory on the host is owned by UID/GID 1500, or InfluxDB may not have permission to write data.
51
+
52
+
Set the correct ownership before starting the container:
53
+
54
+
#### Create the data directory
55
+
56
+
mkdir -p data
57
+
58
+
#### Set ownership to UID/GID 1500
59
+
60
+
sudo chown -R 1500:1500 data
61
+
47
62
### Start InfluxDB
48
63
64
+
> \[!Important]
65
+
> On MacOS due to issues related to docker desktop's VM and local binds
66
+
> you must use either a *delegated local directory* or a *named volume* when starting a container.
67
+
68
+
{{< tabs-wrapper >}}
69
+
{{% tabs %}}
70
+
[Linux/Windows](#)
71
+
[MacOS (Docker Desktop)](#)
72
+
{{% /tabs %}}
73
+
{{% tab-content %}}
49
74
Start a basic InfluxDB container with persistent storage:
50
75
51
76
```bash
@@ -54,7 +79,31 @@ docker run -p 8086:8086 \
54
79
influxdb:{{< latest-patch >}}
55
80
```
56
81
57
-
InfluxDB is now running and available at http://localhost:8086.
82
+
{{% /tab-content %}}
83
+
{{% tab-content %}}
84
+
On MacOS, you must use either a *delegated local directory* or a *named volume* when starting an InfluxDB container.
85
+
86
+
**Option A: Use a delegated local directory**
87
+
88
+
```bash
89
+
docker run -p 8086:8086 \
90
+
-v $PWD/data-test2:/var/lib/influxdb:delegated \
91
+
influxdb:{{< latest-patch >}}
92
+
```
93
+
94
+
**Option B: Use a named docker volume (still local, but managed by Docker Desktop)**
95
+
96
+
```bash
97
+
docker run -d --name influxdb \
98
+
-p 8086:8086 \
99
+
-v influxdb-data:/var/lib/influxdb \
100
+
influxdb:{{< latest-patch >}}
101
+
```
102
+
103
+
{{% /tab-content %}}
104
+
{{< /tabs-wrapper >}}
105
+
106
+
InfluxDB is now running and available at <http://localhost:8086>.
58
107
59
108
## Configure InfluxDB
60
109
@@ -92,7 +141,7 @@ docker run -p 8086:8086 \
92
141
93
142
### Automatic initialization (for development)
94
143
95
-
> [!Warning]
144
+
> \[!Warning]
96
145
> Automatic initialization with InfluxDB v1 is not recommended for production.
97
146
> Use this approach only for development and testing.
98
147
@@ -109,6 +158,7 @@ docker run -p 8086:8086 \
109
158
```
110
159
111
160
Environment variables for user creation:
161
+
112
162
-`INFLUXDB_USER`: Create a user with no privileges
113
163
-`INFLUXDB_USER_PASSWORD`: Password for the user
114
164
-`INFLUXDB_READ_USER`: Create a user who can read from `INFLUXDB_DB`
@@ -146,10 +196,11 @@ docker run -p 8086:8086 \
146
196
```
147
197
148
198
Supported script types:
199
+
149
200
- Shell scripts (`.sh`)
150
201
- InfluxDB query language files (`.iql`)
151
202
152
-
> [!Important]
203
+
> \[!Important]
153
204
> Initialization scripts only run on first startup when the data directory is empty.
154
205
> Scripts execute in alphabetical order based on filename.
155
206
@@ -166,6 +217,7 @@ Replace `<container-name>` with your InfluxDB container name or ID.
166
217
## Next steps
167
218
168
219
Once you have InfluxDB running in Docker, see the [Get started guide](/influxdb/v1/introduction/get-started/) to:
0 commit comments