# Installing elastic Agent in a path other than /opt/

**URL:** <https://discuss.elastic.co/t/installing-elastic-agent-in-a-path-other-than-opt/375928>\
**Category:** Elastic Agent\
**Created:** [March 14, 2025, 1:41pm UTC](https://discuss.elastic.co/t/installing-elastic-agent-in-a-path-other-than-opt/375928 "2025-03-14T13:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juancamiloll](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/juancamiloll/32/110326_2.png) [@juancamiloll](https://discuss.elastic.co/u/juancamiloll)\
**Post date:** [March 14, 2025, 1:41pm UTC](https://discuss.elastic.co/t/installing-elastic-agent-in-a-path-other-than-opt/375928/1 "2025-03-14T13:41:59Z")

</div>

Hello everyone,

As I am not the person in charge of administering the servers I have to make a request by mail to the administrator to install the agent.

The answer he gave me was that it has no space in /opt/ and I must give him a way to install it in a different path.

Beyond the answer of how to solve the lack of space in /opt/ I need to know if it is possible, if it is recommended and how to do it in case it is possible since it does not depend on me what the administrator defines about the folders or if he wants or not, or if he can increase the space.

I would just like to focus my question on if it is possible and how to do it.

Thanks in advance

Sorry, i used translate page

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 14, 2025, 1:52pm UTC](https://discuss.elastic.co/t/installing-elastic-agent-in-a-path-other-than-opt/375928/2 "2025-03-14T13:52:28Z")

</div>

If you want to use the `.tar.gz` package to install the agents, you can use the `--base-path` option to specify another path for the agent, like `--base-path=/path/for/agent`.

The documentation for the CLI can be found [here](https://www.elastic.co/guide/en/fleet/current/elastic-agent-cmd-options.html#elastic-agent-install-command).

But keep in mind that if you plan to use the Elastic Defend integration, it will not work if it is installed in a different path from the defaults.

Another option is to install using a `deb` or `rpm` package, this way the agent is installend inside `/usr/share/elastic-agent` and will also have files in other paths, like described [here](https://www.elastic.co/guide/en/fleet/current/installation-layout.html).

So, if you want to use the Elastic Defend integration, then you need to install it using a `deb`/`rpm` package or install using the `.tar.gz` inside `/opt`.

If you do not want to use the Elastic Defend integration, then you can usethe `.tar.gz` package and install it in any path you want.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 14, 2025, 1:57pm UTC](https://discuss.elastic.co/t/installing-elastic-agent-in-a-path-other-than-opt/375928/3 "2025-03-14T13:57:43Z")

</div>

Another thing to add is that if you install using `deb` or `rpm`, you cannot upgrade the agent from the Fleet UI, you will need to upgrade it directly on the server by upgrading the package.
