master
md 132 lines 4.44 KB
Rendered Raw
1 # Uninstall Netdata
2
3 :::tip
4
5 **What You'll Learn**
6
7 How to uninstall Netdata from UNIX and Windows systems using automated scripts or manual methods based on your installation type.
8
9 :::
10
11 ## Uninstall Methods by Platform
12
13 <details>
14 <summary><strong>UNIX</strong></summary><br/>
15
16 :::note
17
18 **Installation Method Note**
19
20 This method assumes you installed Netdata using the `kickstart.sh` or `netdata-installer.sh` script. If you used a different method, it might not work and could complicate the removal process.
21
22 :::
23
24 Similarly, with our documentation on updating Netdata, you need to [determine your installation type](/packaging/installer/UPDATE.md).
25
26 :::important
27
28 **Native Package Users**
29
30 If your installation type indicates a [native package](https://learn.netdata.cloud/docs/netdata-agent/installation/linux/native-linux-distribution-packages), then proceed to uninstall Netdata using your package manager.
31
32 :::
33
34 ### Automated Uninstallation
35
36 The recommended way to uninstall Netdata is to use the same script you used for installation. Add the `--uninstall` flag:
37
38 ```bash
39 wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall
40 ```
41
42 <details>
43 <summary><strong>if you have curl but not wget</strong></summary><br/>
44
45 ```sh
46 curl https://get.netdata.cloud/kickstart.sh > /tmp/netdata-kickstart.sh && sh /tmp/netdata-kickstart.sh --uninstall
47 ```
48
49 <br/>
50 </details>
51
52 **What to Expect**:
53
54 In most cases, these commands will guide you through the uninstallation process and remove configuration and data files automatically.
55
56 **Non-Standard Installations**:
57
58 If you installed Netdata with a custom prefix (different directory location), you may need to specify the original prefix during uninstallation with the `--old-install-prefix` option.
59
60 ### Uninstalling manually
61
62 Most official installations of Netdata include an uninstaller script that can be manually invoked instead of using the kickstart script (internally, the kickstart script also uses this uninstaller script, it just handles the process outlined below for you).
63
64 This uninstaller script is self-contained, other than requiring a `.environment` file that was generated during installation. In most cases, this will be found in `/etc/netdata/.environment`, though if you used a custom installation prefix, it will be located under that directory.
65
66 #### Manual Uninstallation Steps
67
68 1. **Find your `.environment` file**
69
70 2. **If you can't find that file and would like to uninstall Netdata, then create a new file with the following content:**
71
72 ```sh
73 NETDATA_PREFIX="<installation prefix>" # put what you used as a parameter to shell installed `--install-prefix` flag. Otherwise it should be empty
74 NETDATA_ADDED_TO_GROUPS="<additional groups>" # Additional groups for a user running the Netdata process
75 ```
76
77 3. **Run `netdata-uninstaller.sh` as follows**
78
79 <details>
80 <summary><strong>Interactive mode (Default)</strong></summary><br/>
81
82 The default mode in the uninstaller script is **interactive**. This means that the script provides you the option to reply with "yes" (`y`/`Y`) or "no" (`n`/`N`) to control the removal of each Netdata asset in the filesystem.
83
84 ```sh
85 ${NETDATA_PREFIX}/usr/libexec/netdata/netdata-uninstaller.sh --yes --env <environment_file>
86 ```
87
88 <br/>
89 </details>
90
91 <details>
92 <summary><strong>Non-interactive mode</strong></summary><br/>
93
94 If you're sure, and you know what you're doing, you can speed up the removal of the Netdata assets from the filesystem without any questions by using the force option (`-f`/`--force`). This option will remove all the Netdata assets in a **non-interactive** mode.
95
96 ```sh
97 ${NETDATA_PREFIX}/usr/libexec/netdata/netdata-uninstaller.sh --yes --force --env <environment_file>
98 ```
99
100 <br/>
101 </details>
102
103 :::note
104
105 **Missing Uninstaller File**
106
107 Existing installations may still need to download the file if it's not present. To execute the uninstaller in that case, run the following commands:
108
109 ```sh
110 wget https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/netdata-uninstaller.sh
111 chmod +x ./netdata-uninstaller.sh
112 ./netdata-uninstaller.sh --yes --env <environment_file>
113 ```
114
115 :::
116
117 <br/>
118 </details>
119
120 <details>
121 <summary><strong>Windows</strong></summary><br/>
122
123 To uninstall Netdata on Windows, use the standard application uninstaller in your **Settings** app or **Control Panel**.
124
125 You can also use PowerShell:
126
127 ```powershell
128 msiexec /qn /x netdata-x64.msi
129 ```
130
131 <br/>
132 </details>