Installing elastic Agent in a path other than /opt/

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

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.

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.

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.

1 Like

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.