Using influxdb version 2, I don't know how to save it

I installed influxdb into the docker container and ran the docker container. After that, I proceeded with the initial setup of influxdb. After that, when I checked to see if it was saved, no data was entered into influxdb. Even using influxdb version 2, I don’t know how to save it. : (

Hello @doosan0425,
You’ll have to configure a volume.

Step 1: Pull the InfluxDB Docker Image

First, make sure you have Docker installed. Then run:

bashCopy code

docker pull influxdb

This will download the latest InfluxDB image from the Docker Hub.

Step 2: Create a Data Volume

You can create a named volume to hold the InfluxDB data. Named volumes are managed by Docker and are more convenient to work with than bind mounts.

Create a named volume:

bashCopy code

docker volume create influxdb-volume

Step 3: Run the Container with the Volume Attached

Now run a new container, and attach the volume you’ve just created. Also, expose the InfluxDB API port (usually 8086):

bashCopy code

docker run -d \
  --name influxdb \
  -p 8086:8086 \
  -v influxdb-volume:/var/lib/influxdb \
  influxdb

Step 4: Configure InfluxDB (Optional)

You might want to pass some environment variables to set up an initial user, password, and databases. Here’s how you can do it:

bashCopy code

docker run -d \
  --name influxdb \
  -p 8086:8086 \
  -v influxdb-volume:/var/lib/influxdb \
  -e INFLUXDB_DB=mydb \
  -e INFLUXDB_ADMIN_USER=admin \
  -e INFLUXDB_ADMIN_PASSWORD=admin123 \
  influxdb

Step 5: Verify Installation

After the container starts up, you should be able to access the InfluxDB instance at http://localhost:8086.

What version are you using ?
Here’s another resource that might interest you