To clear out (delete all data from) a bucket in InfluxDB v2 using the built-in web client (InfluxDB UI), you can't directly "clear" a bucket with one button, but you can delete data from it using the Data Explorer or the Delete Data UI. Here’s how to do it:
✅ Option 1: Use the Delete Data UI
-
Log into your InfluxDB UI (e.g., http://localhost:8086).
-
Go to the "Data" tab in the left sidebar.
-
Select "Buckets".
-
Find the bucket you want to clear, click the ⋮ (three dots) next to it.
-
Choose "Delete Data" — this opens the Delete Data interface.
Here, you'll specify:
- Start Time:
1970-01-01T00:00:00Z
- Stop Time:
now()
- (Optional) A predicate if you want to delete only specific measurements.
-
Click Delete to remove the data in that time range.
✅ All data will be permanently deleted from the bucket in the specified range.
✅ Option 2: Delete via the Data Explorer using Flux (Advanced)
If you prefer using Flux in the Data Explorer, note that while you can query and view data, Flux doesn't support deleting data directly. Deletion must be done through the Delete API or the UI as in Option 1.
🧹 Alternative: Delete and Recreate the Bucket (if starting fresh)
If you're testing and can afford to start from scratch:
- Go to Buckets.
- Click the ⋮ next to your test bucket.
- Select "Delete" to remove the entire bucket.
- Then click "Create Bucket" to recreate it.
💡 Notes
- Deleting data is permanent — InfluxDB does not have a trash or rollback for deletions.
- Make sure your organization and authorization token have delete permissions if you’re using the API instead.
Let me know if you'd like to see how to do this via CLI or API.