Lost Server Admin Account

We are running Grafana 8.3.6 as a Docker Container (about to update due to latest CVEs) and we have configured OAuth to log in via AWS Cognito. However, while we are have a bunch of Admins, non of us is “Server Admin”. Apparently the initial Admin Account was deleted before anyone else was made Server Admin. Thus, we can not access the Server Admin panel.
When I start a new Container, I can log in as admin/admin and see the Server Admin Panel. I looked at the documentation but with the CLI I only found commands to reset a lost password.
How can we create a new server admin or make on of our currents admins a server admin?

Checkout to see if grafana-cli can help with this. Ran into a similar situation couple of days ago and saved my bacon

Like I said, it only offers to reset a password, but that is not our problem. The documentation doesn’t state that I can create a new admin account.

Ugh didnt even see that sorry .
Next option might be spin up a new install, create admin, restore from previous?

Well, im a bit late and am not even sure if this can help but it might. Unless you changed, grafana database is sqlite. You could (theoretically) extract the database to your computer, add an account for admin and insert the database back into the docker. However this is not something I tried myself.

If you decide on this chance, you might want to install a brand new grafana and inspect the grafana.db first to make sure you get the right permissions for the admin account.

1 Like