InfluxDB: Getting started
How to quickly set up and manage InfluxDB with best practices
👋 Welcome to the Stackhero documentation
Stackhero delivers a fully managed InfluxDB cloud environment, designed for speed and simplicity:
- Unlimited writes, queries, dashboards, tasks, and buckets.
- Unlimited data retention: keep your metrics as long as you need.
- Unlimited network and disk transfers, with no hidden limits.
- One-click updates: always access the latest features and fixes.
- Consistent performance and strong security on your own private, dedicated infrastructure.
With Stackhero, you can focus on your data and insights. Getting started with InfluxDB cloud hosting only takes a few minutes, and every setup is optimized for long-term reliability.
Managing InfluxDB users
InfluxDB does not provide user management directly through its web UI. You can efficiently handle user creation and administration using the InfluxDB CLI.
Using the InfluxDB CLI
You can access the InfluxDB CLI via Docker. For example, you can run this command:
docker run -it influxdb:2.8 /bin/bash
Remember to use the correct version tag for your InfluxDB instance instead of
2.8.
After launching the container, create a configuration. Replace <XXXXXX>.stackhero-network.com with your actual InfluxDB domain:
influx config create \
--config-name adminConfig \
--active \
--username-password admin \
--org admin \
--host-url https://<XXXXXX>.stackhero-network.com
Once configured, you can use the InfluxDB CLI to manage users. For example, to create a new user:
influx user create --name <user> --password <password>
Preventing disk space saturation
InfluxDB is optimized for large volumes of time series data. Because it does not automatically delete old data, unmanaged databases can quickly fill up available storage. Stackhero helps you avoid this by supporting built-in InfluxDB features for efficient data management.
InfluxDB provides two main solutions:
- Retention policies: Automatically delete data older than a specified period, such as 365 days. This keeps your storage use predictable and avoids manual cleanup.
- Downsampling data: Store high-resolution data for recent periods and aggregated data for older periods. For example:
- Keep 1-second resolution for the last 5 minutes.
- Store maximum, minimum, and average values at 1-minute intervals for the past 24 hours.
- Retain hourly aggregates for older data.
Retention policies let you store relevant history without consuming excessive disk space. For more on downsampling, see the official InfluxDB downsampling documentation.
Configuring data retention in InfluxDB
By default, InfluxDB retains data indefinitely. For most time series use cases, setting a retention period for each bucket ensures you keep only the data you need and prevent uncontrolled storage growth.
To configure retention:
- Open the InfluxDB web UI.
- Go to "Data", then select "Buckets".
- Click "Settings" next to the relevant bucket.
- Under "Delete data older than", choose your preferred retention period.
Data older than the selected retention period will be permanently deleted.
InfluxDB stores data in shards. Shards containing only expired data are deleted automatically. If a shard includes both expired and current data, it remains until all its data is expired. By default, shards cover 7 days of data. When you set a new retention policy, up to nearly 7 days of outdated data could remain until the next shard cycle. For further details, refer to the InfluxDB shard documentation.
Sending data from Node.js to InfluxDB
You can find practical examples for sending data from Node.js to InfluxDB in this InfluxDB Getting Started repository.