InfluxDB 2
InfluxDB is a purpose-built time series database optimised for storing and querying metrics, events, and real-time analytics. It is commonly paired with Grafana for infrastructure monitoring and IoT data pipelines.
Software included
Section titled “Software included”| Component | Version |
|---|---|
| InfluxDB | 2.x |
| Ubuntu | 24.04 LTS |
Getting started
Section titled “Getting started”1. Connect to your VM
Section titled “1. Connect to your VM”ssh ubuntu@<your-vm-ip>2. Wait for first-boot configuration
Section titled “2. Wait for first-boot configuration”On the first boot, a setup script runs automatically. It:
- Starts InfluxDB and waits for it to become ready
- Runs the initial setup with a randomly generated admin password and API token
- Creates the default organisation (
zsoftly) and bucket (default) - Saves all credentials to
/etc/influxdb/credentials.txt
This takes under 60 seconds. Track progress:
journalctl -u influxdb-first-boot.service -f3. Retrieve credentials
Section titled “3. Retrieve credentials”sudo cat /etc/influxdb/credentials.txtThis file contains the admin username, password, organisation, default bucket, and API token. It is only readable by root.
4. Access the InfluxDB UI
Section titled “4. Access the InfluxDB UI”Open a browser and navigate to:
http://<your-vm-ip>:8086Log in with the admin username and password from the credentials file.
5. Connect via the CLI
Section titled “5. Connect via the CLI”The influx CLI is pre-installed. Configure it with the credentials from the file:
TOKEN=$(sudo awk '/^Token:/{print $NF}' /etc/influxdb/credentials.txt)influx config create \ --config-name default \ --host-url http://localhost:8086 \ --org zsoftly \ --token "$TOKEN" \ --activeVerify the connection:
influx pingManaging InfluxDB
Section titled “Managing InfluxDB”# Check service statussystemctl status influxdb
# Restartsudo systemctl restart influxdb
# View logssudo journalctl -u influxdb -fConfiguration file: /etc/influxdb/config.toml
Security
Section titled “Security”Port 8086 is accessible on the VM’s network interface. UFW is enabled and allows SSH (port 22) only by default.
To allow browser or API access from a specific IP:
sudo ufw allow from <trusted-ip> to any port 8086To access the UI without opening the firewall, use an SSH tunnel:
# Run this on your local machinessh -L 8086:localhost:8086 ubuntu@<your-vm-ip>
# Then open in browserhttp://localhost:8086