How to Install and Configure Chronograf on Ubuntu 26.04 LTS
Set up Chronograf with InfluxDB 1.x, Telegraf and Kapacitor on Ubuntu 26.04 LTS from the InfluxData repository, with logins enabled and ports locked down.
Chronograf is InfluxData's web interface for the InfluxDB 1.x stack: it graphs metrics that Telegraf collects into InfluxDB and manages alert rules that Kapacitor evaluates. This guide installs all four components on Ubuntu 26.04 LTS from the InfluxData package repository, turns on authentication, connects the pieces and restricts network access. The same steps work on Ubuntu 24.04 LTS. Ubuntu 16.04 is long past standard support, and the old habit of downloading individual .deb files leaves you without updates, so the repository is used here instead.
Chronograf is still maintained (the 1.11 series is current) and is built for InfluxDB 1.x. InfluxData's newest database, InfluxDB 3, is a different product; this guide stays with the 1.x stack that Chronograf, Kapacitor and InfluxQL dashboards are designed around.
Requirements
- A server running Ubuntu 26.04 LTS or 24.04 LTS, 64-bit.
- A user with
sudorights. The examples usedeploy. - The public IP address of the computer you will browse from (the examples use
198.51.100.25).
Add the InfluxData repository
Install the helper tools, download the repository signing key, check its fingerprint and register the repository. The second command only writes the keyring if the fingerprint matches the one InfluxData publishes.
sudo apt update
sudo apt install -y wget curl gnupg
wget -q https://repos.influxdata.com/influxdata-archive.key
gpg --show-keys --with-fingerprint --with-colons ./influxdata-archive.key 2>&1 | grep -q '^fpr::*24C975CBA61A024EE1B631787C3D57159FC2F927:$' && cat influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/keyrings/influxdata-archive.gpg > /dev/null
echo 'deb [signed-by=/etc/apt/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
sudo apt update
If /etc/apt/keyrings/influxdata-archive.gpg does not exist afterwards, the fingerprint check failed: do not continue until you have compared the key with the fingerprint shown in the InfluxData installation documentation.
Install and secure InfluxDB
The repository also carries InfluxDB 2 and 3 under other package names. The package called influxdb is the 1.x server that Chronograf expects.
sudo apt install -y influxdb
sudo systemctl unmask influxdb.service
sudo systemctl enable --now influxdb
Check that the HTTP API answers on port 8086:
curl -G http://localhost:8086/query --data-urlencode "q=SHOW DATABASES"
InfluxDB accepts unauthenticated requests until you create an admin user and enable authentication. Open the shell:
influx
Create an admin user, a database for Telegraf and a user that may only write to that database. Replace both passwords.
CREATE USER admin WITH PASSWORD 'ChangeThisAdminPassword' WITH ALL PRIVILEGES
CREATE DATABASE telegraf
CREATE USER telegraf WITH PASSWORD 'ChangeThisTelegrafPassword'
GRANT ALL ON telegraf TO telegraf
exit
Edit /etc/influxdb/influxdb.conf and, in the [http] section, set:
auth-enabled = true
Restart the service and confirm that credentials are now required:
sudo systemctl restart influxdb
curl -G http://localhost:8086/query -u admin:ChangeThisAdminPassword --data-urlencode "q=SHOW DATABASES"
Install Telegraf
Telegraf is the agent that collects metrics. Its packaged configuration enables basic system inputs (CPU, memory, swap, disk, disk I/O, kernel, processes, system) but no output, so add one in a drop-in file before starting it.
sudo apt install -y telegraf
Create /etc/telegraf/telegraf.d/influxdb.conf:
[[outputs.influxdb]]
urls = ["http://127.0.0.1:8086"]
database = "telegraf"
skip_database_creation = true
username = "telegraf"
password = "ChangeThisTelegrafPassword"
The file contains a password, so limit who can read it, then start the agent:
sudo chown root:telegraf /etc/telegraf/telegraf.d/influxdb.conf
sudo chmod 640 /etc/telegraf/telegraf.d/influxdb.conf
sudo systemctl enable --now telegraf
sudo systemctl status telegraf --no-pager
Install Kapacitor
Kapacitor processes the data stream and sends alerts (email, Slack, webhooks and many other handlers). It needs the InfluxDB admin account because it creates subscriptions.
sudo apt install -y kapacitor
In /etc/kapacitor/kapacitor.conf, find the [[influxdb]] section and fill in the credentials:
[[influxdb]]
enabled = true
default = true
name = "localhost"
urls = ["http://localhost:8086"]
username = "admin"
password = "ChangeThisAdminPassword"
Start it and list the (still empty) task table to prove the API is reachable:
sudo systemctl enable --now kapacitor
kapacitor list tasks
Install Chronograf and enable a login
sudo apt install -y chronograf
Without further configuration Chronograf listens on every interface on port 8888 and lets anyone in. The simplest protection is HTTP basic authentication with an htpasswd file; Chronograf also supports OAuth 2.0 providers, which InfluxData recommends when you have one available. Create the password file:
sudo apt install -y apache2-utils
sudo mkdir -p /etc/chronograf
sudo htpasswd -c /etc/chronograf/.htpasswd deploy
sudo chown -R chronograf:chronograf /etc/chronograf
sudo chmod 600 /etc/chronograf/.htpasswd
The packaged systemd unit reads environment variables from /etc/default/chronograf. Create that file with:
HTPASSWD=/etc/chronograf/.htpasswd
Start the service:
sudo systemctl enable --now chronograf
sudo systemctl status chronograf --no-pager
Basic authentication sends the password with every request, so add TLS before using it over the internet: either set TLS_CERTIFICATE and TLS_PRIVATE_KEY in the same file, or place Chronograf behind a reverse proxy that terminates HTTPS.
Restrict access with the firewall
InfluxDB (8086) and Kapacitor (9092) listen on all interfaces by default, and nothing outside the server needs them in this setup. Allow SSH, allow Chronograf only from your own address, and let UFW drop the rest:
sudo ufw allow OpenSSH
sudo ufw allow from 198.51.100.25 to any port 8888 proto tcp
sudo ufw enable
sudo ufw status
Connect Chronograf to InfluxDB and Kapacitor
Open http://203.0.113.10:8888 (your server's address) and sign in with the htpasswd account. The welcome wizard asks for:
- Connection URL:
http://localhost:8086 - Connection name: any label, for example
InfluxDB - Username / Password: the InfluxDB
adminaccount - Telegraf database name:
telegraf
In the next steps pick the suggested dashboards (the System dashboard matches Telegraf's default inputs) and add Kapacitor with the URL http://localhost:9092. You can change both later under Configuration. The Host List page should show your server within a minute, and Alerting lets you build alert rules and configure where Kapacitor sends them.
Monitor other hosts
For another Linux server, install Telegraf there and point its [[outputs.influxdb]] URL at this server; you then have to open port 8086 to that host only, for example sudo ufw allow from 203.0.113.20 to any port 8086 proto tcp.
Network devices that only speak SNMP can be polled from the Telegraf instance on this server. Install the SNMP tools:
sudo apt install -y snmp
Then create /etc/telegraf/telegraf.d/snmp.conf. Numeric OIDs are used so that no vendor MIB files are required:
[[inputs.snmp]]
agents = ["udp://203.0.113.30:161"]
version = 2
community = "your-community"
agent_host_tag = "source"
[[inputs.snmp.field]]
name = "hostname"
oid = ".1.3.6.1.2.1.1.5.0"
is_tag = true
[[inputs.snmp.table]]
name = "interface"
inherit_tags = ["hostname"]
oid = ".1.3.6.1.2.1.31.1.1"
[[inputs.snmp.table.field]]
name = "ifName"
oid = ".1.3.6.1.2.1.31.1.1.1.1"
is_tag = true
Test the new input once, then restart the agent:
sudo -u telegraf telegraf --config /etc/telegraf/telegraf.conf --config-directory /etc/telegraf/telegraf.d --test --input-filter snmp
sudo systemctl restart telegraf
Updates and troubleshooting
All four packages update with the rest of the system:
sudo apt update
sudo apt upgrade
When something does not show up in Chronograf, read the service logs in the order the data flows:
sudo journalctl -u telegraf -n 50 --no-pager
sudo journalctl -u influxdb -n 50 --no-pager
sudo journalctl -u kapacitor -n 50 --no-pager
sudo journalctl -u chronograf -n 50 --no-pager
A 401 or "unable to parse authentication credentials" message in the Telegraf or Kapacitor log means the user name or password in its configuration does not match the InfluxDB account.
Frequently asked questions
Does Chronograf work with InfluxDB 2 or InfluxDB 3?
Chronograf is designed around InfluxDB 1.x and InfluxQL. InfluxDB 2 has its own built-in web interface, and recent Chronograf releases added a connection type for InfluxDB 3, but Kapacitor alerting and the Telegraf dashboards described here belong to the 1.x stack.
Where does Chronograf keep its dashboards and settings?
In a single BoltDB file, /var/lib/chronograf/chronograf-v1.db. Stop the service and copy that file to back up dashboards, connections and alert rule definitions.
Can several people have separate accounts?
Add more users to the htpasswd file with sudo htpasswd /etc/chronograf/.htpasswd name, but every basic-auth user is a full administrator. Role-based access (viewer, editor, admin) requires configuring one of the OAuth 2.0 providers.
Why does the InfluxDB service need systemctl unmask?
InfluxData's installation instructions include it because the unit can be left masked after package installation; unmasking a unit that is not masked does nothing, so the command is safe to run either way.