# Automatically install mender client on RPI4

**URL:** <https://hub.mender.io/t/automatically-install-mender-client-on-rpi4/4550>\
**Category:** General Discussions\
**Created:** [January 31, 2022, 9:13am UTC](https://hub.mender.io/t/automatically-install-mender-client-on-rpi4/4550 "2022-01-31T09:13:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicoCaldo](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/nicocaldo/32/1409_2.png) [@NicoCaldo](https://hub.mender.io/u/NicoCaldo)\
**Post date:** [January 31, 2022, 9:13am UTC](https://hub.mender.io/t/automatically-install-mender-client-on-rpi4/4550/1 "2022-01-31T09:13:20Z")

</div>

Hi,  
I was wondering if there was the chance to set up a script to run to automatically install and connect any of my Raspberry Pi 4 devices to my Mender Dashboard.  
At the moment to do that I have to access the dashboard, click on add device, following the procedure copying the code provided, and pasting it on my device.  
I would like to have a script that downloads, install and connect the client to my dashboard and, the only thing I have to do is to accept it from the dashboard.  
My idea was to put on a script the code provided by the Mender dashboard while trying to add a new device but, I guess, the code is unique everytime a new device is added, isn’t it?

---

<div class="post-metadata">

**Author:** ![NicoCaldo](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/nicocaldo/32/1409_2.png) [@NicoCaldo](https://hub.mender.io/u/NicoCaldo)\
**Post date:** [February 3, 2022, 8:03am UTC](https://hub.mender.io/t/automatically-install-mender-client-on-rpi4/4550/2 "2022-02-03T08:03:56Z")

</div>

It sounds pretty strange to me that everyone in the world are adding devices manually everytime…  
UP

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [February 3, 2022, 8:08am UTC](https://hub.mender.io/t/automatically-install-mender-client-on-rpi4/4550/3 "2022-02-03T08:08:27Z")

</div>

Hi Nico,

this should be perfectly possible to automate, sure. Does the unattended installation as documented [here](https://docs.mender.io/client-installation/install-with-debian-package#option-2-unattended-installation) work for you? You can get the needed credential token from your dashboard.

If something is missing, or doesn’t work for you, please tell me a little bit more about your way of provisioning (especially, which OS and how the image is being built) so we can improve.

Thanks!  
Josef

---

<div class="post-metadata">

**Author:** ![NicoCaldo](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/nicocaldo/32/1409_2.png) [@NicoCaldo](https://hub.mender.io/u/NicoCaldo)\
**Post date:** [February 3, 2022, 8:30am UTC](https://hub.mender.io/t/automatically-install-mender-client-on-rpi4/4550/4 "2022-02-03T08:30:46Z")

</div>

thanks! It was exactly what I was looking for
