# PMM 2 user creation from CLI not from UI

**URL:** <https://forums.percona.com/t/pmm-2-user-creation-from-cli-not-from-ui/25156>\
**Category:** PMM 2.x\
**Created:** [September 13, 2023, 3:24pm UTC](https://forums.percona.com/t/pmm-2-user-creation-from-cli-not-from-ui/25156 "2023-09-13T15:24:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pravata\_dash](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pravata_dash/32/12098_2.png) [@pravata\_dash](https://forums.percona.com/u/pravata_dash)\
**Post date:** [September 13, 2023, 3:24pm UTC](https://forums.percona.com/t/pmm-2-user-creation-from-cli-not-from-ui/25156/1 "2023-09-13T15:24:26Z")

</div>

## Description:

We have deployed pmm 2.39 on one of our on-premise VMs. As part of reconfiguration, in case of hardware failure or any instance-related issues, we have prepared a script to configure PMM on the VM and perform all necessary setups. However, to create users with different access levels (admin, edit, and view) in PMM, we currently have to manually create them through the PMM UI (default username and password are admin/admin).

Is there a way to automate the user creation process using a script OR the command-line interface (CLI), instead of manually creating users through the PMM UI after logging in with the default admin user?

## Version:

PMM - 2 (2.39.0)  
Attaching the user section that we want to create.

 ![Screenshot 2023-09-13 at 8.53.13 PM](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/9/91e60bedf4ae71735240695e64825d8530d4bab6.png)

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [September 13, 2023, 3:43pm UTC](https://forums.percona.com/t/pmm-2-user-creation-from-cli-not-from-ui/25156/2 "2023-09-13T15:43:08Z")

</div>

Hi @pravata_dash

You may use an API request for creating a user.

> **[Admin HTTP API | Grafana documentation](https://grafana.com/docs/grafana/latest/developers/http_api/admin/#global-users)**
>
> Grafana Admin HTTP API

---

<div class="post-metadata">

**Author:** ![pravata\_dash](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pravata_dash/32/12098_2.png) [@pravata\_dash](https://forums.percona.com/u/pravata_dash)\
**Post date:** [September 14, 2023, 1:52pm UTC](https://forums.percona.com/t/pmm-2-user-creation-from-cli-not-from-ui/25156/3 "2023-09-14T13:52:15Z")

</div>

@Vadim_Yalovets

Sure, thanks will go through this and let you know in case of any concerns.  
So, there is no command at the docker level to create a user like changing the admin password ??

Ex: To change the pmm 2 admin password, we execute the below command directly in the PMM server.

docker exec -t pmm-server bash -c ‘grafana-cli --homepath /usr/share/grafana --configOverrides cfg:default.paths.data=/srv/grafana admin reset-admin-password newpass’

---

<div class="post-metadata">

**Author:** ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)\
**Post date:** [September 15, 2023, 7:23am UTC](https://forums.percona.com/t/pmm-2-user-creation-from-cli-not-from-ui/25156/4 "2023-09-15T07:23:10Z")

</div>

I don’t see any parameters for grafana-cli utility to work with users.

 ![Screenshot 2023-09-15 at 10.20.20](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/7/72bcafd9403acf6702e1f854573104b3d2f1a872.png)

---

<div class="post-metadata">

**Author:** ![pravata\_dash](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pravata_dash/32/12098_2.png) [@pravata\_dash](https://forums.percona.com/u/pravata_dash)\
**Post date:** [September 16, 2023, 7:59am UTC](https://forums.percona.com/t/pmm-2-user-creation-from-cli-not-from-ui/25156/5 "2023-09-16T07:59:44Z")

</div>

Sure, thanks for the update, we will check the API part you have shared.
