<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Administration on Grafana Labs</title><link>https://grafana.com/docs/grafana/v4.3/administration/</link><description>Recent content in Administration on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v4.3/administration/index.xml" rel="self" type="application/rss+xml"/><item><title>Grafana CLI</title><link>https://grafana.com/docs/grafana/v4.3/administration/cli/</link><pubDate>Fri, 07 Mar 2025 11:34:44 +0100</pubDate><guid>https://grafana.com/docs/grafana/v4.3/administration/cli/</guid><content><![CDATA[&lt;h1 id=&#34;grafana-cli&#34;&gt;Grafana CLI&lt;/h1&gt;
&lt;p&gt;Grafana cli is a small executable that is bundled with grafana server and is suppose to be executed on the same machine as grafana runs.&lt;/p&gt;
&lt;h2 id=&#34;plugins&#34;&gt;Plugins&lt;/h2&gt;
&lt;p&gt;The CLI helps you install, upgrade and manage your plugins on the same machine it CLI is running.
You can find more information about how to install and manage your plugins at the
&lt;a href=&#34;../../plugins/installation/&#34;&gt;plugin page&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;admin&#34;&gt;Admin&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;This feature is only available in grafana 4.1 and above.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To show all admin commands:
&lt;code&gt;grafana-cli admin&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;reset-admin-password&#34;&gt;Reset admin password&lt;/h3&gt;
&lt;p&gt;You can reset the password for the admin user using the CLI. The use case for this command is when you have lost the admin password.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;grafana-cli admin reset-admin-password ...&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If running the command returns this error:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;then there are two flags that can be used to set homepath and the config file path.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;grafana-cli admin reset-admin-password --homepath &amp;quot;/usr/share/grafana&amp;quot; newpass&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you have not lost the admin password then it is better to set in the Grafana UI. If you need to set the password in a script then the &lt;a href=&#34;http://docs.grafana.org/http_api/user/#change-password&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana API&lt;/a&gt; can be used. Here is an example with curl using basic auth:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;curl -X PUT -H &amp;#34;Content-Type: application/json&amp;#34; -d &amp;#39;{
  &amp;#34;oldPassword&amp;#34;: &amp;#34;admin&amp;#34;,
  &amp;#34;newPassword&amp;#34;: &amp;#34;newpass&amp;#34;,
  &amp;#34;confirmNew&amp;#34;: &amp;#34;newpass&amp;#34;
}&amp;#39; http://admin:admin@&amp;lt;your_grafana_host&amp;gt;:3000/api/user/password&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="grafana-cli">Grafana CLI&lt;/h1>
&lt;p>Grafana cli is a small executable that is bundled with grafana server and is suppose to be executed on the same machine as grafana runs.&lt;/p></description></item></channel></rss>