# Elastic Agent Linux Install Directory

**URL:** <https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595>\
**Category:** Beats\
**Tags:** fleet, elastic-agent\
**Created:** [November 16, 2020, 9:11pm UTC](https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595 "2020-11-16T21:11:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nemhods](https://avatars.discourse-cdn.com/v4/letter/n/48db29/32.png) [@nemhods](https://discuss.elastic.co/u/nemhods)\
**Post date:** [November 16, 2020, 9:11pm UTC](https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595/1 "2020-11-16T21:11:01Z")

</div>

Hi all,

I installed Elastic Agent from /tmp/elastic-agent-7.10.0-linux-x86\_64. I now see a metricbeat running from /tmp/elastic-agent-7.10.0-linux-x86\_64/data/elastic-agent-1428d5.

Is this intended? Why are downloaded beats not running from the normal app directory /opt/Elastic, but rather in the directory of the installation files?

At the least, I think this should be documented, because in my case having a beat running from /tmp may cause side effects once the OS attempts to clean this directory.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 16, 2020, 9:17pm UTC](https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595/2 "2020-11-16T21:17:38Z")

</div>

Can you elaborate on how you installed it?

---

<div class="post-metadata">

**Author:** ![nemhods](https://avatars.discourse-cdn.com/v4/letter/n/48db29/32.png) [@nemhods](https://discuss.elastic.co/u/nemhods)\
**Post date:** [November 17, 2020, 7:52am UTC](https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595/3 "2020-11-17T07:52:57Z")

</div>

Hi warkolm,

I downloaded the tarball, untarred it to /tmp/ and ran  
`/tmp/elastic-agent-7.10.0-linux-x86_64/elastic-agent install -f .......`

I also confirmed that if I run the installation from a different folder, all integrations will be downloaded to and run from that different folder.

It seems like the agent considers its "origin directory" to be the working directory for integrations. I had assumed that all integrations would also live under /opt/Elastic and that I could delete the original folder.  
Especially since the "origin folder" (the one we install from) could live in all sorts of places where we don't want installed binaries to be:

- /tmp
- /mnt/usb...
- network shares

I would suggest that `elastic-agent install` should work like `make install` or `dpkg -i`: it copies all files to a permanent location, and the origin directory should be deletable. Maybe Integrations run by the elastic agent should live somewhere like `/opt/Elastic/Integrations`?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 17, 2020, 7:54am UTC](https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595/4 "2020-11-17T07:54:00Z")

</div>

That's standard Linux behaviour you are seeing.

> [@nemhods](#):
>
> I would suggest that `elastic-agent install` should work like `make install` or `dpkg -i`

If you download and install the DEB/RPM it'll do exactly that.

---

<div class="post-metadata">

**Author:** ![nemhods](https://avatars.discourse-cdn.com/v4/letter/n/48db29/32.png) [@nemhods](https://discuss.elastic.co/u/nemhods)\
**Post date:** [November 17, 2020, 6:10pm UTC](https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595/5 "2020-11-17T18:10:12Z")

</div>

I know, but I'd like to use the auto-upgrade feature which is only available for non-DEB/RPM installs. It's beside the point though, since I'm still convinced the current install method needs tweaking.

Let's say I install from `/tmp/elastic_agent_install`.

- Endpoint will live in `/opt/Elastic/Endpoint`
- Agent will live in `/opt/Elastic/Agent`
- Integrations will live in `/tmp/elastic_agent_install/data/elastic-agent-1428d5/install/metricbeat-7.10.0-linux-x86_64/metricbeat`

In my opinion, there are only disadvantages to placing the integrations in the install directory.

- Once you install the agent from that directory, you cannot remove it anymore because the installation depends on it. Thats a disadvantage if the user happened to place it in a weird location, like ~/Downloads, ~/Desktop or the home dir itself. The documentation also does not mention that the user should place the install files in a permanent location.
- If the install location is in a special directory like /tmp, or a USB drive, the installation might actually **break** when the drive is removed / cleaned up
- There is no well known path to the integrations, it will differ from machine to machine depending on where Elastic Agent was installed from.

I don't see any advantages of keeping _only the integrations_ in the install directory, but moving everything else in it's proper place.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 15, 2020, 8:10pm UTC](https://discuss.elastic.co/t/elastic-agent-linux-install-directory/255595/6 "2020-12-15T20:10:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
