# How to install/run when system is wiped after each reboot?

**URL:** <https://community.netdata.cloud/t/how-to-install-run-when-system-is-wiped-after-each-reboot/3747>\
**Category:** Help\
**Created:** [January 15, 2023, 9:18am UTC](https://community.netdata.cloud/t/how-to-install-run-when-system-is-wiped-after-each-reboot/3747 "2023-01-15T09:18:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AGI-chandler](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/agi-chandler/32/2541_2.png) [@AGI-chandler](https://community.netdata.cloud/u/AGI-chandler)\
**Post date:** [January 15, 2023, 9:18am UTC](https://community.netdata.cloud/t/how-to-install-run-when-system-is-wiped-after-each-reboot/3747/1 "2023-01-15T09:18:22Z")

</div>

Is there a way to properly install netdata on a compute instance which gets wiped and reloaded from an image each time it reboots?

I got close to a solution. I got netdata installed in the base image, which gets started through systemd. I thought I could add these lines to `/usr/lib/systemd/system/netdata.service`, I put them after `ExecStartPre=/bin/chown -R netdata /run/netdata` and before `PermissionsStartOnly=true`:

```auto
ExecStartPost=/bin/sh -c 'wget -O /tmp/netdata-kickstart.sh https://my-netdata.io/kickstart.sh'
ExecStartPost=/bin/sh /tmp/netdata-kickstart.sh --claim-token secret --claim-url https://app.netdata.cloud

```

This works, except the node gets registered as a new node, while the previous instance of the node is dead and I have to delete it from the dashboard. I didn’t think this would happen since the secret claim-token remains static…

---

<div class="post-metadata">

**Author:** ![Austin\_Hemmelgarn](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/austin_hemmelgarn/32/4495_2.png) [@Austin\_Hemmelgarn](https://community.netdata.cloud/u/Austin_Hemmelgarn)\
**Post date:** [January 15, 2023, 1:17pm UTC](https://community.netdata.cloud/t/how-to-install-run-when-system-is-wiped-after-each-reboot/3747/2 "2023-01-15T13:17:48Z")

</div>

The behavior you’re seeing is because you’re getting a new install (and therefore a new node ID) each time you create the node. Avoiding that requires persisting `/var/lib/netdata/registry` and `/var/lib/netdata/cloud.d` across the restart. _However_, some features of the Cloud may not work as expected if you take this approach, because you’ll lose access to historical data for the node whenever it restarts.

Given this, a better approach is probably to set up a persistent node with Netdata, claim that to the Cloud, and then have your epehemeral node stream all of it’s metrics to that node. Making that work will still require persisting `/var/lib/netdata/registry` so that the node ID does not change, but it will let you continue to access historical metrics from that ephemeral node on the Cloud.

---

<div class="post-metadata">

**Author:** ![AGI-chandler](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.netdata.cloud/agi-chandler/32/2541_2.png) [@AGI-chandler](https://community.netdata.cloud/u/AGI-chandler)\
**Post date:** [August 6, 2023, 3:16pm UTC](https://community.netdata.cloud/t/how-to-install-run-when-system-is-wiped-after-each-reboot/3747/3 "2023-08-06T15:16:01Z")

</div>

Looking into revisiting this now since the built in monitoring we have on Bright Cluster Manager has been unreliable. I’m not sure how to persist data like `/var/lib/netdata/registry` from compute nodes but there must be a way so I’ll check into the manual. Our head node would be the persistent node and has been running Netdata normally for us. You’re saying I can setup netdata on the compute/ephemeral nodes like I had before, and then there is some option to stream data that I enable, and persist `/var/lib/netdata/registry` and that should do it? Thanks!
