Monitoring

Secure the TICK Stack: InfluxDB Auth, Chronograf OAuth and HTTPS

A default TICK stack install answers queries from anyone who can reach port 8086. On our lab box, an outside machine listed every database without a password, Kapacitor’s API on 9092 accepted requests from the internet, and Chronograf on 8888 handed its UI to the first visitor. Nothing in the packages turns InfluxDB authentication on for you, and the moment you do turn it on, Telegraf, Kapacitor and Chronograf all break in different ways.

Original content from computingforgeeks.com - post 188798

This guide closes each hole in an order that keeps the stack running. You get least-privilege users, Kapacitor API auth, loopback binds, an Nginx reverse proxy with Let’s Encrypt, and Chronograf OAuth. We completed the OAuth login end to end with Dex, a self-hosted OpenID Connect provider.

Every command below ran in November 2026 on an Ubuntu 26.04 LTS cloud VM with InfluxDB 1.13.2, Telegraf 1.40.3, Kapacitor 1.8.9 and Chronograf 1.11.7. The VM had a public address from the first minute, so every outside probe below came from a real second machine.

Starting point and the values used below

The finished layout puts Nginx in front as the only web entry point, with Chronograf and Dex behind it and every TICK API listening on loopback with credentials:

Secured TICK stack architecture: browser to Nginx over HTTPS 443, Nginx proxying to Chronograf and Dex on loopback, Chronograf reading InfluxDB and Kapacitor on 127.0.0.1

You need a working TICK stack first. If you do not have one, follow the TICK stack install on Ubuntu and come back with Telegraf writing into the telegraf database, a Kapacitor task enabled and Chronograf connected to both. The rest of this guide assumes these conditions:

  • InfluxDB 1.x, Telegraf, Kapacitor and Chronograf run on one Ubuntu host from the InfluxData apt repository.
  • A DNS A record for your Chronograf hostname points at the server’s public IP.
  • Ports 80 and 443 are reachable from the internet for the Let’s Encrypt HTTP-01 challenge.
  • You have sudo on the box and a second SSH session open while you change firewall rules.

Set the values once in your shell so every later command picks them up. Replace the domain with yours and replace each password with something long and random; openssl rand -hex 16 gives a good one. Stick to hex or plain letters and digits, because the Kapacitor admin password later sits inside a URL, where an @, : or / breaks it. LOGIN_EMAIL is the address you will sign in to Chronograf with, and LOGIN_DOMAIN is the email domain allowed to log in.

export SITE_DOMAIN="tick.example.com"
export ADMIN_EMAIL="[email protected]"
export LOGIN_EMAIL="[email protected]"
export LOGIN_DOMAIN="example.com"
export INFLUX_ADMIN_PASS="ChangeMe-Admin-01"
export TELEGRAF_PASS="ChangeMe-Telegraf-02"
export CHRONO_INFLUX_PASS="ChangeMe-Chrono-03"
export KAPA_INFLUX_PASS="ChangeMe-Kapa-04"
export KAPA_ADMIN_PASS="ChangeMe-KapaAdm-05"
export KAPA_CHRONO_PASS="ChangeMe-KapaChrono-06"
export DEX_USER_PASS="ChangeMe-Dex-07"

These variables live only in the current shell. If you log out halfway through, export them again before you continue, along with INFLUX_USERNAME and INFLUX_PASSWORD once the Telegraf section sets them, or the later sed and curl commands write empty strings into your configs.

The exposure on a default install

Before changing anything, look at what the packages bind to. InfluxDB, Kapacitor and Chronograf all listen on every interface by default, and only the InfluxDB backup port 8088 stays on loopback. That matters because a cloud VM’s public interface is one of those interfaces, so the services are reachable from the internet unless something else blocks them.

sudo ss -tlnp | grep -E ":(8086|8088|8888|9092) "

The asterisk in the local address column is the problem. It means any interface, including the public one, so each of these services answers whoever can route a packet to the box.

LISTEN 0      4096       127.0.0.1:8088      0.0.0.0:*    users:(("influxd",pid=3268,fd=4))
LISTEN 0      4096               *:8888            *:*    users:(("chronograf",pid=3308,fd=8))
LISTEN 0      4096               *:9092            *:*    users:(("kapacitord",pid=3302,fd=9))
LISTEN 0      4096               *:8086            *:*    users:(("influxd",pid=3268,fd=7))

From a second machine on the internet, we queried the lab server’s public address directly. InfluxDB returned the database list with no credentials at all:

curl -s "http://203.0.113.10:8086/query?q=SHOW%20DATABASES"

That reply is all an attacker needs to start reading or dropping data.

{"results":[{"statement_id":0,"series":[{"name":"databases","columns":["name"],"values":[["telegraf"],["_internal"]]}]}]}

The same outside probe got a 204 from Kapacitor’s ping, a 200 from InfluxDB’s query endpoint and a 200 from Chronograf’s /chronograf/v1/me. Read that as three open doors: write access to your time series, the ability to define or delete alert tasks, and a dashboard UI that can run any query against any connected source. If your server has a public IP and no cloud firewall in front of these ports, assume someone has already found them.

InfluxDB users with least privilege

Create the users before you enable authentication. InfluxDB 1.x lets you create the first admin while auth is off, and doing it in this order means you never lock yourself out. Each component gets its own account with only what it needs: Telegraf writes, Chronograf reads, and Kapacitor gets read for now (that changes in a moment, for a reason worth seeing).

influx -execute "CREATE USER admin WITH PASSWORD '${INFLUX_ADMIN_PASS}' WITH ALL PRIVILEGES"
influx -execute "CREATE USER telegraf WITH PASSWORD '${TELEGRAF_PASS}'"
influx -execute "GRANT WRITE ON telegraf TO telegraf"
influx -execute "CREATE USER chronograf WITH PASSWORD '${CHRONO_INFLUX_PASS}'"
influx -execute "GRANT READ ON telegraf TO chronograf"
influx -execute "CREATE USER kapacitor WITH PASSWORD '${KAPA_INFLUX_PASS}'"
influx -execute "GRANT READ ON telegraf TO kapacitor"
influx -execute "SHOW USERS"

Only admin should show true in the admin column. If any other account does, revoke it before going further, because an admin account in a service config is a full database takeover waiting for a leaked file.

user       admin
----       -----
admin      true
telegraf   false
chronograf false
kapacitor  false

The InfluxData authentication and authorization reference lists every privilege statement if you need per-database grants beyond these four users.

Authentication switched on, and what breaks

The [http] section of /etc/influxdb/influxdb.conf ships with auth-enabled commented out, which means off. Uncomment it and set it to true, then restart InfluxDB:

sudo sed -i 's/^  # auth-enabled = false/  auth-enabled = true/' /etc/influxdb/influxdb.conf
grep -n "^  auth-enabled" /etc/influxdb/influxdb.conf
sudo systemctl restart influxdb

The grep should return exactly one line. On our box it was line 336 under [http].

336:  auth-enabled = true

Give InfluxDB a moment to come back (we gave it 40 seconds before testing), then confirm that an anonymous request is refused. The CLI without credentials now fails:

influx -execute "SHOW DATABASES"

The same error comes back from every client that has not been given credentials yet.

ERR: unable to parse authentication credentials
Warning: It is possible this error is due to not setting a database.
Please set a database with the command "use <database>".
unable to parse authentication credentials

Ignore the hint about setting a database, because it is misleading here. Over HTTP the same request returns a clean 401, which is what you want an outside scanner to see. The sed keeps only the status line, the version header and the body:

curl -si "http://127.0.0.1:8086/query?q=SHOW%20DATABASES" | sed -n "1p;/^X-Influxdb-Version/p;\$p"

Status 401 with a JSON error and nothing else tells a scanner there is no anonymous access to probe:

HTTP/1.1 401 Unauthorized
X-Influxdb-Version: 1.13.2
{"error":"unable to parse authentication credentials"}

Now the fallout. Within a minute of the restart, all three consumers of InfluxDB were failing, and each one fails differently:

  • Telegraf keeps running but drops every metric with 401 Unauthorized, so you lose data silently.
  • Kapacitor refuses to start at all, because it cannot link its InfluxDB subscription.
  • Chronograf stays up but every query through its source proxy returns a 400 wrapping the 401.

Telegraf is the dangerous one because nothing looks down. The service stays active, so a status check passes while every metric is thrown away. Only its journal shows the drops.

2026-11-12T05:52:27Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized): unable to parse authentication credentials
2026-11-12T05:52:37Z E! [outputs.influxdb] E! [outputs.influxdb] Failed to write metric (will be dropped: 401 Unauthorized): unable to parse authentication credentials

Kapacitor goes to failed and its log at /var/log/kapacitor/kapacitor.log loops on this:

ts=2026-11-12T05:53:20.757Z lvl=error msg="encountered error" service=run err="open server: open service *influxdb.Service: failed to link subscription on startup: unable to parse authentication credentials"

Chronograf’s proxy reports the upstream status inside its own error body. Its API wants the X-Requested-With header on every call, so include it when you test from the shell:

curl -s -H "X-Requested-With: XMLHttpRequest" localhost:8888/chronograf/v1/sources/1/proxy -d "{\"query\":\"SHOW DATABASES\",\"db\":\"telegraf\"}"; echo

The 400 is Chronograf’s own status, and the 401 inside it is what InfluxDB actually said:

{"code":400,"message":"received status code 401 from server: err: unable to parse authentication credentials"}

Fix them in the order below, starting with Telegraf, because every minute it stays broken is a permanent gap in your history. Kapacitor comes next since alerts stop firing while it is down, and Chronograf last because a broken dashboard is visible and loses no data.

Telegraf credentials kept out of the main config

Do not paste the password into telegraf.conf. That file tends to get copied into config repositories and support tickets, and a password in it travels with every copy. Telegraf expands environment variables in its config, and the packaged systemd unit reads /etc/default/telegraf, so the secret can live in a root-only file instead. If you came from our install guide, /etc/telegraf/telegraf.d/influxdb.conf already exists with your network inputs in it: keep those inputs, add the three lines skip_database_creation, username and password shown below to its output block, and skip the check below. On a fresh config, make sure the main file has no active InfluxDB output, so there is only one:

grep -n '^\[\[outputs.influxdb' /etc/telegraf/telegraf.conf

No output means the stock file is clean. If a line comes back, comment out that whole block, header and keys together, then create a dedicated output file.

sudo vim /etc/telegraf/telegraf.d/influxdb.conf

The lab ran with exactly this file. The skip_database_creation line matters, because without it Telegraf tries to create the database at startup, and the telegraf user has no right to do that:

[[outputs.influxdb]]
  urls = ["http://127.0.0.1:8086"]
  database = "telegraf"
  skip_database_creation = true
  username = "telegraf"
  password = "${INFLUX_PASSWORD}"

Write the password into the environment file, lock it to root, and restart Telegraf.

echo "INFLUX_PASSWORD=${TELEGRAF_PASS}" | sudo tee /etc/default/telegraf >/dev/null
sudo chmod 600 /etc/default/telegraf
sudo systemctl restart telegraf

From here on, use environment variables for the influx CLI too. Passing -password on the command line puts it in your shell history and in ps output for every local user. The CLI reads INFLUX_USERNAME and INFLUX_PASSWORD:

export INFLUX_USERNAME=admin INFLUX_PASSWORD="${INFLUX_ADMIN_PASS}"
influx -database telegraf -execute "SELECT count(usage_idle) FROM cpu WHERE time > now() - 20s"

A non-zero count means points are landing again. Ours returned 3 for the last 20 seconds, and the journal showed no new E! lines after the restart:

name: cpu
time                count
----                -----
1794462828782877715 3

If you collect from other hosts, each remote Telegraf needs the same pair of files. The Telegraf input plugins guide covers the inputs side; the output block above works unchanged on those agents once you point urls at the right address.

Kapacitor’s InfluxDB account needs admin

Kapacitor reads data through an InfluxDB subscription, and on startup it lists and creates subscriptions. Open /etc/kapacitor/kapacitor.conf:

sudo vim /etc/kapacitor/kapacitor.conf

In the [[influxdb]] section (line 155 on ours), the username and password keys a few lines down are empty strings. Fill them with the kapacitor account you created, typing the real value of KAPA_INFLUX_PASS, since this file takes no shell variables:

  username = "kapacitor"
  password = "ChangeMe-Kapa-04"

Run sudo systemctl restart kapacitor. With only READ on telegraf, Kapacitor still refuses to start, and the log says exactly why:

ts=2026-11-12T05:54:30.019Z lvl=error msg="encountered error" service=run err="open server: open service *influxdb.Service: failed to link subscription on startup: error authorizing query: kapacitor not authorized to execute statement 'SHOW SUBSCRIPTIONS', requires admin privilege"

Least privilege runs into a hard requirement at this point. Subscription management is an admin statement in InfluxDB 1.x, so the Kapacitor account needs admin rights. Accept it, and compensate by protecting kapacitor.conf, which now holds an admin password: check it with ls -l, make sure no account outside root and the kapacitor service can read it, and keep it out of any config repository.

influx -execute "GRANT ALL PRIVILEGES TO kapacitor"
sudo systemctl reset-failed kapacitor
sudo systemctl restart kapacitor
influx -execute "SHOW SUBSCRIPTIONS"

Kapacitor starts, and its subscription on both databases is back.

name: telegraf
retention_policy name                                           mode destinations
---------------- ----                                           ---- ------------
autogen          kapacitor-fdc5477f-2ce2-476f-8aae-74d5c42d511a ANY  [http://localhost:9092]

name: _internal
retention_policy name                                           mode destinations
---------------- ----                                           ---- ------------
monitor          kapacitor-fdc5477f-2ce2-476f-8aae-74d5c42d511a ANY  [http://localhost:9092]

The reset-failed step clears systemd’s restart counter. Kapacitor crash-looped while it lacked credentials, and without the reset systemd may refuse to start it again until the rate limit expires.

Kapacitor’s own API behind a password

InfluxDB auth does not protect Kapacitor’s HTTP API on 9092. Anyone who reaches it can define, disable or delete alert tasks. Kapacitor OSS has its own user store, but there is an ordering trap: the users API is itself behind auth once [http] auth-enabled is on, so you must create users while that switch is still off. In /etc/kapacitor/kapacitor.conf, set these two lines in the [auth] section and leave [http] alone for now:

[auth]
  enabled = true
  meta-addr = ""

Emptying meta-addr is not optional. The packaged default points at an InfluxDB Enterprise meta node address, which tells Kapacitor to look users up in an Enterprise cluster you do not have. The Kapacitor auth documentation describes it as the Enterprise user store; empty means Kapacitor keeps users locally. Restart Kapacitor, then create an admin and a limited account for Chronograf:

sudo systemctl restart kapacitor
until curl -s -o /dev/null localhost:9092/kapacitor/v1/ping; do sleep 2; done
curl -s -XPOST http://localhost:9092/kapacitor/v1/users -d "{\"name\":\"kapadmin\",\"password\":\"${KAPA_ADMIN_PASS}\",\"type\":\"admin\"}"
curl -s -XPOST http://localhost:9092/kapacitor/v1/users -d "{\"name\":\"chronograf\",\"password\":\"${KAPA_CHRONO_PASS}\",\"type\":\"normal\",\"permissions\":[\"api\",\"config_api\"]}"

Each call echoes the user back without the password. Our first attempt at the Chronograf user listed fine-grained permissions like read_task and write_alert, and Kapacitor rejected the whole request with {"error":"invalid JSON"}. The JSON was valid; the permission names weren’t. api and config_api are the names that worked:

{
    "link": {
        "rel": "self",
        "href": "/kapacitor/v1/users/chronograf"
    },
    "name": "chronograf",
    "type": "normal",
    "permissions": [
        "api",
        "config_api"
    ]
}

Now enforce it. In the [http] section, set auth-enabled = true (line 57 on ours), then restart. The bare CLI is refused. Give the admin account to the CLI through KAPACITOR_URL rather than -url, so the password stays out of ps and your shell history:

sudo systemctl restart kapacitor
kapacitor list tasks
export KAPACITOR_URL="http://kapadmin:${KAPA_ADMIN_PASS}@localhost:9092"
kapacitor list tasks

The first command fails with the same message InfluxDB uses, and the second lists the task.

Error: unable to parse authentication credentials
ID        Type      Status    Executing Databases and Retention Policies
cpu_alert stream    enabled   true      ["telegraf"."autogen"]

Typing the URL each time gets old, so export KAPACITOR_URL in your admin shell instead. The bigger worry is whether InfluxDB can still push data into Kapacitor now that 9092 wants credentials. It can. Kapacitor authenticates subscription writes as an internal ~subscriber user, and the log shows them arriving with status 204:

ts=2026-11-12T05:57:00.004Z lvl=info msg="http request" service=http host=127.0.0.1 username=~subscriber start=2026-11-12T05:57:00.004175066Z method=POST uri=/write?consistency=&db=_internal&precision=ns&rp=monitor protocol=HTTP/1.1 status=204

Keep watching that line for a minute after the restart. A 204 there means alerts still see live data. Anything else means your tasks are running blind, so the alert you are relying on will not fire, and nothing in Chronograf will tell you.

Chronograf connection credentials

Chronograf stores a connection for InfluxDB and one for Kapacitor, and both were created without credentials. The Kapacitor proxy now fails the same way the InfluxDB one did:

curl -s -H "X-Requested-With: XMLHttpRequest" "localhost:8888/chronograf/v1/sources/1/kapacitors/1/proxy?path=/kapacitor/v1/tasks"; echo

Kapacitor’s refusal comes back through the proxy word for word:

{"error":"unable to parse authentication credentials","message":"unable to parse authentication credentials"}

You can edit both connections in the UI under Configuration, but do it now through the API, before OAuth is switched on and the API starts demanding a login. Chronograf rejects POST and PATCH calls without an X-Requested-With header, so include it:

H="X-Requested-With: XMLHttpRequest"
curl -s -o /dev/null -w "source %{http_code}\n" -H "$H" -XPATCH localhost:8888/chronograf/v1/sources/1 -d "{\"username\":\"chronograf\",\"password\":\"${CHRONO_INFLUX_PASS}\"}"
curl -s -o /dev/null -w "kapacitor %{http_code}\n" -H "$H" -XPATCH localhost:8888/chronograf/v1/sources/1/kapacitors/1 -d "{\"username\":\"chronograf\",\"password\":\"${KAPA_CHRONO_PASS}\"}"
curl -s -H "$H" localhost:8888/chronograf/v1/sources/1/proxy -d "{\"query\":\"SHOW MEASUREMENTS LIMIT 3\",\"db\":\"telegraf\"}"

Both updates return 200 and a query through the source proxy comes back with real measurements.

source 200
kapacitor 200
{"results":[{"statement_id":0,"series":[{"name":"measurements","columns":["name"],"values":[["cpu"],["disk"],["diskio"]]}]}],"uuid":"e2c68f57-505d-4ad4-8e52-f669d66d5271"}

If you prefer the UI, or want to confirm what the API stored, open Configuration and edit the InfluxDB connection. Put chronograf in Username, the password in Password, and click Update Connection. Chronograf never shows a saved password again, only “Value saved in server”:

Chronograf InfluxDB connection form with the read-only chronograf user
  1. 1Username
  2. 2Password
  3. 3Update Connection

The Kapacitor connection is edited on its own Configure Kapacitor Connection page, reached from the Kapacitor entry on the Configuration page. It takes the Kapacitor user you created earlier, not the InfluxDB one, so fill Username and password with the Chronograf account from Kapacitor’s user store and click Update:

Chronograf Kapacitor connection form with Kapacitor user credentials
  1. 1Username
  2. 2password
  3. 3Update

Mixing the two accounts up is the usual mistake here, and the symptom is an authentication error from the proxy like the ones shown earlier, so check which form you are in before saving.

One more grant is easy to miss. Chronograf’s status page reads alert history from a database named chronograf, and the read-only chronograf user had no rights on it. After the OAuth login later in this guide, the “Alerts” panel on the status page showed a 403. On a fresh install the database doesn’t even exist yet, so the grant fails until you create it:

influx -execute "CREATE DATABASE chronograf"
influx -execute "GRANT READ ON chronograf TO chronograf"
influx -execute "SHOW GRANTS FOR chronograf"

The Chronograf account should hold READ on exactly these two databases and nothing else:

database   privilege
--------   ---------
telegraf   READ
chronograf READ

Read-only is a deliberate choice. Chronograf can create databases and retention policies from its UI, and with this account those buttons fail. Do schema changes from the CLI as admin, and anyone who steals a Chronograf session cannot drop your data.

Every API bound to loopback

Passwords on 8086 and 9092 still leave the ports open to brute force and to the next authentication bypass. Nothing outside the host needs them, so bind all three services to 127.0.0.1. InfluxDB’s HTTP bind-address is commented out by default, Kapacitor’s is set to all interfaces, and Chronograf takes a HOST environment variable.

sudo sed -i 's|^  # bind-address = ":8086"|  bind-address = "127.0.0.1:8086"|' /etc/influxdb/influxdb.conf
sudo sed -i 's|^  bind-address = ":9092"|  bind-address = "127.0.0.1:9092"|' /etc/kapacitor/kapacitor.conf
echo "HOST=127.0.0.1" | sudo tee /etc/default/chronograf >/dev/null
sudo chmod 600 /etc/default/chronograf
sudo systemctl restart influxdb
until curl -s -o /dev/null -w "%{http_code}" 127.0.0.1:8086/ping | grep -q 204; do sleep 2; done
sudo systemctl restart kapacitor chronograf telegraf

The loop holds the other restarts until InfluxDB answers its ping again, so Kapacitor does not try to link its subscription against a server that is still opening shards. Ours took about 40 seconds. Then check the listeners:

sudo ss -tlnp | grep -E ":(8086|8088|8888|9092) " | awk '{print $4, $6}'

All four now show 127.0.0.1 as the local address.

127.0.0.1:8086 users:(("influxd",pid=5854,fd=19))
127.0.0.1:8088 users:(("influxd",pid=5854,fd=4))
127.0.0.1:9092 users:(("kapacitord",pid=5890,fd=10))
127.0.0.1:8888 users:(("chronograf",pid=5889,fd=8))

We expected the subscription to break here, since its destination is http://localhost:9092 and the bind changed underneath it. It did not. Thirty seconds later the Kapacitor log still showed ~subscriber writes to the telegraf database with status 204, and Telegraf logged zero errors. Now repeat the probe from a machine outside the server:

for p in 8086/ping 9092/kapacitor/v1/ping 8888/; do curl -sS -m 5 -o /dev/null -w "%{http_code}\n" "http://203.0.113.10:$p"; done

Every port now refuses the connection outright, and curl reports status 000 because no HTTP exchange happened at all. That is the result you want.

curl: (7) Failed to connect to 203.0.113.10 port 8086 after 12 ms: Could not connect to server
000
curl: (7) Failed to connect to 203.0.113.10 port 9092 after 12 ms: Could not connect to server
000
curl: (7) Failed to connect to 203.0.113.10 port 8888 after 13 ms: Could not connect to server
000

Add a host firewall as a second layer, so a future config change that rebinds a port does not silently expose it again. Install Nginx and certbot now, because the Nginx package ships the “Nginx Full” ufw profile and the rule below fails without it. Allow SSH before you enable ufw, or you will lock yourself out of a remote box. OpenSSH covers port 22 only, so allow your own port if sshd runs elsewhere; if you do get locked out, the provider’s web console and sudo ufw disable get you back in:

sudo apt install -y nginx certbot python3-certbot-nginx
sudo ufw allow OpenSSH
sudo ufw allow "Nginx Full"
sudo ufw --force enable
sudo ufw status

Only SSH, 80 and 443 are allowed in. If you followed our install guide, it also added a rule for 8888 from your admin network; find it with sudo ufw status numbered and remove it with sudo ufw delete and its number. If your provider also has a cloud firewall or security group, remove any rule there that opened 8086, 8888 or 9092 while you were setting the stack up:

Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
Nginx Full                 ALLOW       Anywhere
OpenSSH (v6)               ALLOW       Anywhere (v6)
Nginx Full (v6)            ALLOW       Anywhere (v6)

Remote Telegraf agents are the exception to “nothing outside needs 8086”. If you have them, do not reopen the port to the world. Put them on a private network or a WireGuard tunnel and allow only that source address with a ufw rule, so the password is never the only thing standing between the internet and your database.

Chronograf behind an Nginx reverse proxy with HTTPS

Chronograf on loopback is safe but unreachable. Nginx becomes the only web service facing the internet, terminates TLS, and forwards to 127.0.0.1:8888. The OAuth flow later needs HTTPS too, because the session cookie and the provider’s redirect must not travel in clear text. The OAuth section later adds Dex to this same Chronograf Nginx reverse proxy, so one certificate covers both. Nginx and certbot went in with the firewall step, so create the site file.

sudo vim /etc/nginx/sites-available/chronograf

Start with a plain HTTP server block. Certbot adds the TLS parts itself. The X-Forwarded-Proto header tells Chronograf the original request was HTTPS, and the longer read timeout keeps slow dashboard queries from being cut at Nginx’s 60 second default:

server {
    listen 80;
    listen [::]:80;
    server_name tick.example.com;

    location / {
        proxy_pass http://127.0.0.1:8888;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 300s;
    }
}

Put your hostname in place of the example, enable the site, drop the default site and reload:

sudo sed -i "s/tick.example.com/${SITE_DOMAIN}/" /etc/nginx/sites-available/chronograf
sudo ln -sf /etc/nginx/sites-available/chronograf /etc/nginx/sites-enabled/chronograf
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx

Request the certificate with the HTTP-01 challenge. Let’s Encrypt connects to port 80 on the name you give it, so DNS must already resolve to this server. The --redirect flag adds the HTTP to HTTPS redirect for you:

sudo certbot --nginx -d "${SITE_DOMAIN}" -m "${ADMIN_EMAIL}" --non-interactive --agree-tos --redirect

Our lab run used --register-unsafely-without-email in place of -m. The issuance steps are the same either way:

Account registered.
Requesting a certificate for tick.example.com

Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/tick.example.com/fullchain.pem
Key is saved at:         /etc/letsencrypt/live/tick.example.com/privkey.pem
This certificate expires on 2027-02-10.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.

Deploying certificate
Successfully deployed certificate for tick.example.com to /etc/nginx/sites-enabled/chronograf
Congratulations! You have successfully enabled HTTPS on https://tick.example.com

Check the redirect, the proxy and the certificate from outside the box.

curl -sI "http://${SITE_DOMAIN}/" | sed -n '1p;/^Location/p'
curl -sI "https://${SITE_DOMAIN}/" | sed -n '1p;/^Server/p'
echo | openssl s_client -connect "${SITE_DOMAIN}:443" -servername "${SITE_DOMAIN}" 2>/dev/null | openssl x509 -noout -subject -issuer -dates

Plain HTTP answers with a 301, HTTPS answers 200 through Nginx, and the issuer is Let’s Encrypt.

HTTP/1.1 301 Moved Permanently
Location: https://tick.example.com/
HTTP/1.1 200 OK
Server: nginx/1.28.3 (Ubuntu)
subject=CN=tick.example.com
issuer=C=US, O=Let's Encrypt, CN=YE1
notBefore=Nov 12 05:00:30 2026 GMT
notAfter=Feb 10 05:00:29 2027 GMT

Prove that renewal works now rather than two months from now. The dry run talks to the staging server and leaves your real certificate alone:

sudo certbot renew --dry-run

It ended with Congratulations, all simulated renewals succeeded, and systemctl list-timers certbot.timer showed the renewal timer armed. Let’s Encrypt stopped sending expiry reminder emails in 2025, so that timer and your own monitoring are the only warning you’ll get. The same Nginx and certbot pattern is used in our Graylog reverse proxy guide if you’re putting other dashboards on the same host.

DNS-01 when port 80 cannot be opened

If the server sits on a private network, or your policy forbids port 80 from the internet, use the DNS-01 challenge. Certbot proves control by creating a TXT record through your DNS provider’s API, so the server never has to be reachable. We did not run this path in the lab; the commands come from the certbot plugin documentation and the Ubuntu 26.04 package list. Each provider has a packaged plugin:

DNS providerUbuntu packageAuthenticatorWhat the credential must allow
Cloudflarepython3-certbot-dns-cloudflaredns-cloudflareAPI token with Zone:DNS:Edit on the one zone
AWS Route 53python3-certbot-dns-route53dns-route53route53:ListHostedZones, route53:GetChange, route53:ChangeResourceRecordSets on the hosted zone
DigitalOceanpython3-certbot-dns-digitaloceandns-digitaloceanToken with domain read, create and delete scopes
Google Cloud DNSpython3-certbot-dns-googledns-googleService account that can modify the managed zone
Linode (Akamai)python3-certbot-dns-linodedns-linodeAPI token that can edit the domain’s records
OVHpython3-certbot-dns-ovhdns-ovhGET on /domain/zone/, plus GET, PUT, POST, DELETE on /domain/zone/<your-zone>/*
BIND or any RFC 2136 serverpython3-certbot-dns-rfc2136dns-rfc2136TSIG key allowed to update the zone

Scope the credential as tightly as the provider allows. Whoever reads that file can issue or revoke certificates for the zone, so a token limited to one zone’s DNS records is the minimum standard. For Cloudflare, install the plugin and store the token in a root-only file:

sudo apt install -y python3-certbot-dns-cloudflare
sudo mkdir -p /root/.secrets
echo "dns_cloudflare_api_token = your-token-here" | sudo tee /root/.secrets/cloudflare.ini >/dev/null
sudo chmod 600 /root/.secrets/cloudflare.ini

Then request the certificate with the DNS authenticator and let the Nginx installer wire it into the same site file:

sudo certbot run -a dns-cloudflare -i nginx --dns-cloudflare-credentials /root/.secrets/cloudflare.ini -d "${SITE_DOMAIN}" -m "${ADMIN_EMAIL}" --agree-tos --non-interactive --redirect

Certbot records the credentials path in the renewal config, so the same timer renews over DNS-01 from then on. Keep the file at 600, because certbot warns about unsafe permissions on every run otherwise, and a token readable by other accounts can issue certificates for your whole zone.

Chronograf OAuth with a self-hosted OIDC provider

HTTPS encrypts the session, but Chronograf still lets anyone who opens the URL straight into the UI. Chronograf OAuth closes that gap. Once a TOKEN_SECRET and a provider are set, every page and API call needs a signed login token. Chronograf supports GitHub, Google, Auth0, Okta, GitLab and any generic OAuth 2.0 or OIDC provider. We used Dex with its built-in password database, because it runs on the same box, needs no outside account, and exercises the generic OIDC path that Keycloak, Authentik and corporate IdPs use too.

Dex runs as a container published on loopback only. Ubuntu’s docker.io package is enough, and apache2-utils provides htpasswd for the bcrypt password hash. If you would rather use Docker’s own repository, our Docker install guide for Ubuntu covers it.

sudo apt install -y docker.io apache2-utils
export DEX_TAG="v2.46.1" # pin: release tested in this guide #https://github.com/dexidp/dex/releases
sudo docker pull ghcr.io/dexidp/dex:${DEX_TAG}
export DEX_SECRET=$(openssl rand -hex 24)
export DEX_HASH=$(echo "${DEX_USER_PASS}" | htpasswd -BinC 10 mercy | cut -d: -f2)
sudo mkdir -p /etc/dex /var/lib/dex
sudo chown 1001:1001 /var/lib/dex

Dex runs unprivileged inside the container and has to write its SQLite file into /var/lib/dex. Handing the directory to UID 1001 is what worked in our run. Now create the Dex config:

sudo vim /etc/dex/config.yaml

The lab ran this structure. The issuer lives under /dex on the same hostname, so Nginx can serve both apps with one certificate, and the redirect URI is Chronograf’s callback for a provider named dex:

issuer: https://tick.example.com/dex

storage:
  type: sqlite3
  config:
    file: /var/dex/dex.db

web:
  http: 0.0.0.0:5556

enablePasswordDB: true

staticClients:
  - id: chronograf
    name: Chronograf
    secret: DEX_CLIENT_SECRET
    redirectURIs:
      - https://tick.example.com/oauth/dex/callback

staticPasswords:
  - email: [email protected]
    hash: "DEX_PASSWORD_HASH"
    username: mercy
    userID: 6c1f2a7e-2b1d-4c43-9a7b-3f1e8d2c0a11

Fill in your hostname, your login email, the generated client secret and the hash, then start the container. Dex listens on 0.0.0.0 inside the container, but the -p 127.0.0.1:5556:5556 mapping keeps it off the public interface:

sudo sed -i "s|tick.example.com|${SITE_DOMAIN}|g; s|DEX_CLIENT_SECRET|${DEX_SECRET}|; s|DEX_PASSWORD_HASH|${DEX_HASH}|; s|[email protected]|${LOGIN_EMAIL}|" /etc/dex/config.yaml
sudo chown root:1001 /etc/dex/config.yaml
sudo chmod 640 /etc/dex/config.yaml
sudo docker run -d --name dex --restart unless-stopped -p 127.0.0.1:5556:5556 -v /etc/dex/config.yaml:/etc/dex/config.yaml:ro -v /var/lib/dex:/var/dex ghcr.io/dexidp/dex:${DEX_TAG} dex serve /etc/dex/config.yaml

The email matters more than it looks. Chronograf matches users by email, and the GENERIC_DOMAINS restriction set below only lets LOGIN_DOMAIN in, so LOGIN_EMAIL has to sit in that domain or the login is refused. If you edit the config later, run sudo docker restart dex, because Dex reads it only at start. And if your shell dies before the Chronograf step, read the client secret back with export DEX_SECRET=$(sudo awk '/secret:/{print $2}' /etc/dex/config.yaml) instead of generating a new one that would not match.

The /dex/ location and the final vhost

Open the site file again, since certbot has added its TLS lines by now. Add a location /dex/ block in the 443 server, above the listen 443 ssl line:

sudo vim /etc/nginx/sites-available/chronograf

The complete file, as it ran in the lab with the hostname swapped for the example, looks like this:

server {
    server_name tick.example.com;

    location / {
        proxy_pass http://127.0.0.1:8888;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 300s;
    }

    location /dex/ {
        proxy_pass http://127.0.0.1:5556;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    listen 443 ssl; # managed by Certbot
    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/tick.example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/tick.example.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = tick.example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    listen [::]:80;
    server_name tick.example.com;
    return 404; # managed by Certbot


}

Note that proxy_pass for Dex has no trailing path, so the /dex/ prefix reaches Dex intact and matches its issuer URL. Run sudo nginx -t and reload; then curl -s "https://${SITE_DOMAIN}/dex/.well-known/openid-configuration" should return the discovery document with your HTTPS issuer.

Chronograf’s generic OAuth settings

Chronograf reads its OAuth settings from /etc/default/chronograf. Generate a long token secret: Chronograf signs every session JWT with it, so anyone holding it can forge a login.

export TOKEN_SECRET=$(openssl rand -base64 48 | tr -d "\n")
sudo vim /etc/default/chronograf

Replace the file’s contents with the following. GENERIC_NAME=dex sets both the callback path /oauth/dex/callback and the “Log in with Dex” button label. GENERIC_DOMAINS refuses any email outside that domain, and AUTH_DURATION=12h cuts the default 30 day cookie down to a working day, so a stolen laptop does not carry a month of access.

HOST=127.0.0.1
TOKEN_SECRET=TOKEN_SECRET_VALUE
PUBLIC_URL=https://tick.example.com
AUTH_DURATION=12h
GENERIC_NAME=dex
GENERIC_CLIENT_ID=chronograf
GENERIC_CLIENT_SECRET=DEX_CLIENT_SECRET
GENERIC_AUTH_URL=https://tick.example.com/dex/auth
GENERIC_TOKEN_URL=https://tick.example.com/dex/token
GENERIC_API_URL=https://tick.example.com/dex/userinfo
GENERIC_SCOPES=openid,profile,email
GENERIC_DOMAINS=example.com
REPORTING_DISABLED=true

Substitute the real values and restart. The file holds two secrets, so it stays at mode 600.

sudo sed -i "s|tick.example.com|${SITE_DOMAIN}|g; s|TOKEN_SECRET_VALUE|${TOKEN_SECRET}|; s|DEX_CLIENT_SECRET|${DEX_SECRET}|; s|^GENERIC_DOMAINS=.*|GENERIC_DOMAINS=${LOGIN_DOMAIN}|" /etc/default/chronograf
sudo chmod 600 /etc/default/chronograf
sudo systemctl restart chronograf

Two details from the run are worth knowing. The Chronograf security docs say GENERIC_SCOPES is space-delimited, yet the comma-separated value above produced a correct scope=openid+profile+email in the authorize request. And REPORTING_DISABLED=true stops Chronograf from sending anonymous usage statistics to InfluxData; after the restart, its journal held zero “reporting usage” lines.

Proof that the login is enforced

Test it without a browser first. An anonymous call to the API should be refused, and the provider login route should redirect to Dex with a PKCE challenge:

curl -s -o /dev/null -w "GET /chronograf/v1/me %{http_code}\n" "https://${SITE_DOMAIN}/chronograf/v1/me"
curl -s -o /dev/null -w "GET /oauth/dex/login %{http_code} -> %{redirect_url}\n" "https://${SITE_DOMAIN}/oauth/dex/login"

The 403 replaces the 200 that the outside probe got at the start of this guide. The redirect carries code_challenge_method=S256, which is Chronograf’s PKCE protection against intercepted authorization codes (state token trimmed here):

GET /chronograf/v1/me 403

GET /oauth/dex/login 307 -> https://tick.example.com/dex/auth?access_type=online&client_id=chronograf&code_challenge=CvNpAtSM59-kxu1m9-3oXixgeZqv_otxP-bEMD1Hbgw&code_challenge_method=S256&redirect_uri=https%3A%2F%2Ftick.example.com%2Foauth%2Fdex%2Fcallback&response_type=code&scope=openid+profile+email&state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

In the browser, https://tick.example.com now shows nothing but a Log in with Dex button. No dashboard and no source list; the only detail an anonymous visitor learns is the Chronograf version under the logo:

Chronograf 1.11.7 login page with the Log in with Dex OAuth button

Dex has a single local connector, so the button goes straight to its own form on /dex/. Type LOGIN_EMAIL into Email Address, the Dex password into Password, and click Login:

Dex OIDC login form reached from Chronograf behind Nginx
  1. 1Email Address
  2. 2Password
  3. 3Login

Dex then asks for consent, listing “View basic profile information” and “View your email address”. Those are the profile and email scopes from GENERIC_SCOPES, and Chronograf needs the email to match GENERIC_DOMAINS. Click Grant Access:

Dex Grant Access page listing the profile and email scopes Chronograf requests

You land on Chronograf’s status page over HTTPS, signed in through Dex. On a box with no alert history yet, the Alert Events panel reads “No Results” and the Alerts panel shows its getting-started hint, rather than an error, which is what the chronograf database grant from earlier buys you. The News Feed panel pulls from an outside InfluxData feed, so its “Failed to load News Feed” message does not involve any of the credentials set in this guide:

Chronograf status page after a successful Dex OIDC login over HTTPS

On the server side, Dex logs each login with the connector, client and email it accepted, which is the line to look for when a user says the login loops:

time=2026-11-12T06:04:59.307Z level=INFO msg="login successful" connector_id=local client_id=chronograf user_id=6c1f2a7e-2b1d-4c43-9a7b-3f1e8d2c0a11 username=mercy preferred_username="" email=[email protected] groups=[] request_id=686067d8-b27b-48bf-8826-69bf0862d3f7

The first user to log in becomes Chronograf’s SuperAdmin, so log in yourself before you share the URL. Then open Admin, go to the All Users tab, and check that the “All new users are SuperAdmins” toggle is grey. On our 1.11.7 install it was already off, although the InfluxData docs describe it as on by default, so look rather than click: switching it on would make everyone in your email domain a SuperAdmin. With it off, later users get the default organization’s default role, so set that role under Admin, All Orgs to the lowest one your team can work with before anyone else signs in.

On ours, the OAuth user from Dex was the only account next to the All new users are SuperAdmins toggle, with provider dex, scheme oauth2 and SuperAdmin set through the first-user rule:

Chronograf All Users admin page showing the OAuth user and the new users SuperAdmin toggle
  1. 1All new users are SuperAdmins
  2. 2OAuth user from Dex

Come back to this page after each new person signs in for the first time, and lower any role that came out higher than the job needs.

GitHub OAuth instead of Dex

If your team already lives in GitHub, skip Dex and register an OAuth app under your organization’s Developer settings. Set the Homepage URL to https://tick.example.com and the callback URL to https://tick.example.com/oauth/github/callback. We did not run this variant in the lab; the variables come from the Chronograf docs. In /etc/default/chronograf, replace the GENERIC_* lines with these:

VariableValueWhy it matters
GH_CLIENT_IDClient ID from the GitHub appIdentifies the app to GitHub
GH_CLIENT_SECRETClient secret from the GitHub appKeep it in this mode 600 file only
GH_ORGSYour organization name, comma-separated for severalWithout it, any GitHub account can log in
TOKEN_SECRETSame random value as beforeSigns Chronograf’s session tokens
PUBLIC_URLhttps://tick.example.comBuilds the callback URL behind the proxy

Do not skip GH_ORGS. Without it, Chronograf accepts every one of GitHub’s users, and the only thing standing between a stranger and your dashboards is the default role. On first login, grant the OAuth app access to that organization, or GitHub hides your membership and you’re refused. A self-hosted Keycloak works through the same generic variables as Dex; our Keycloak with Let’s Encrypt guide sets one up.

Errors we hit and how each was fixed

Every error below came up during the lab run or is the documented failure mode for a step we described. Search for the exact message you are seeing, because two of them point somewhere other than where they seem to.

“unable to parse authentication credentials”

InfluxDB and Kapacitor both use this message for a request with no credentials at all. It is not a parsing bug, and it is not about a wrong password. Find the client that is still anonymous by checking Telegraf’s journal, the Kapacitor log, the Chronograf connection, or your own shell without INFLUX_USERNAME, INFLUX_PASSWORD or KAPACITOR_URL exported.

“requires admin privilege” when Kapacitor starts

Kapacitor’s InfluxDB account has credentials but not admin. SHOW SUBSCRIPTIONS is admin-only in InfluxDB 1.x. Run GRANT ALL PRIVILEGES TO kapacitor as the admin user, then systemctl reset-failed kapacitor and restart it.

“invalid JSON” from the Kapacitor users API

Kapacitor returns this for valid JSON with an unknown permission name. Our request with read_task and write_alert failed; the same request with ["api","config_api"] succeeded. Check the permission list before you suspect your quoting.

“database not found: chronograf” and a 403 on the status page

The alerts panel on Chronograf’s status page reads the chronograf database. A read-only Chronograf account without a grant on it gets a 403 there, and the grant itself fails with ERR: database not found: chronograf until the database exists. Create it as admin, then grant READ, as shown in the connection section.

HTTP-01 challenge fails

Certbot’s HTTP-01 check needs two things: the name resolves to this server’s public IP, and port 80 reaches Nginx from the internet. Check both from outside before retrying, because repeated failures count against Let’s Encrypt rate limits:

  • dig +short tick.example.com returns the server’s public IP and nothing else.
  • sudo ufw status lists Nginx Full, and the cloud firewall allows TCP 80.
  • curl -I http://tick.example.com/ from another network reaches Nginx instead of timing out.

If port 80 cannot be opened at all, switch to the DNS-01 method above instead of retrying, since no amount of retrying fixes a closed port.

DNS-01 challenge fails with a permission or zone error

Nearly always a token scope problem. A Cloudflare token limited to the wrong zone, or with Zone:Read but not DNS:Edit, cannot create the TXT record. Rebuild it with Zone:DNS:Edit on exactly the zone that holds your hostname. On slow providers, raise the plugin’s --dns-<provider>-propagation-seconds value so Let’s Encrypt doesn’t check before the record is visible.

Post-hardening audit checklist

Run through this list after any upgrade or config change, not just once. A package update that rewrites a config file can quietly undo a bind address, and you will not notice until someone else does.

  1. ss -tlnp shows only sshd and Nginx on 80 and 443 on public addresses; 8086, 8088, 8888, 9092 and 5556 are on 127.0.0.1.
  2. An anonymous InfluxDB query returns 401 Unauthorized.
  3. SHOW USERS lists admin rights only for admin and kapacitor.
  4. Telegraf’s journal has no 401 Unauthorized lines since the last restart.
  5. kapacitor list tasks without credentials fails, and the Kapacitor log shows ~subscriber writes with status 204.
  6. /etc/default/telegraf and /etc/default/chronograf are mode 600 and owned by root.
  7. https://tick.example.com/chronograf/v1/me returns 403 without a session.
  8. “All new users are SuperAdmins” is off, and every Chronograf user has the lowest role that does their job.
  9. certbot renew --dry-run succeeds and certbot.timer is active.
  10. sudo ufw status allows only OpenSSH and Nginx Full, and no cloud firewall rule opens the TICK ports.

If any line fails, fix it before anything else on the box. Teams that want a second front end can put Grafana on the same InfluxDB with the read-only account pattern from this guide. If you are weighing a move off the 1.x line, read the InfluxDB 3 migration notes first, because InfluxDB 3 replaces this whole user model with tokens.

Keep reading

Upgrade Ubuntu 24.04 to Ubuntu 26.04 LTS (Step by Step) Ubuntu Upgrade Ubuntu 24.04 to Ubuntu 26.04 LTS (Step by Step) UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP Php PHP2Shell (CVE-2026-109618, CVE-2026-109619): Check and Patch PHP Git CVE-2026-111760: Check and Patch the Recursive Clone RCE Git Git CVE-2026-111760: Check and Patch the Recursive Clone RCE Deploy Collabora Online Office on Ubuntu with Let’s Encrypt SSL Cloud Deploy Collabora Online Office on Ubuntu with Let’s Encrypt SSL Install and Configure Tailscale Client on OPNsense Cloud Install and Configure Tailscale Client on OPNsense

Leave a Comment

Press ESC to close