# Unable to install fleet managed elastic agent

**URL:** <https://discuss.elastic.co/t/unable-to-install-fleet-managed-elastic-agent/274774>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Tags:** docker, fleet\
**Created:** [June 2, 2021, 3:25pm UTC](https://discuss.elastic.co/t/unable-to-install-fleet-managed-elastic-agent/274774 "2021-06-02T15:25:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Louis1](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@Louis1](https://discuss.elastic.co/u/Louis1)\
**Post date:** [June 2, 2021, 3:25pm UTC](https://discuss.elastic.co/t/unable-to-install-fleet-managed-elastic-agent/274774/1 "2021-06-02T15:25:51Z")

</div>

Hi,

I am having trouble installing the fleet managed elastic agent for Linux into one of our Docker containers, which has a Linux-Alpine base image. I have elastic-cloud setup with fleet running. I have managed to install an elastic agent with the DEB steps with one container that is running Redis (Deb base image) and that all connects fine just so you know.

- [Install Elastic Agents | Fleet User Guide [7.13] | Elastic](https://www.elastic.co/guide/en/fleet/current/elastic-agent-installation.html#install-fleet-managed-agent)

For the Linux steps to install the elastic agent:  
Step 1. Works fine:  
`curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-7.13.0-linux-x86_64.tar.gz`  
`tar xzvf elastic-agent-7.13.0-linux-x86_64.tar.gz`

Step 2. I can only manage to cd in to the directory before getting an error message on the final command:  
`cd elastic-agent-7.13.0-linux-x86_64`  
`sudo ./elastic-agent install -f --url=<fleet_server_url> --enrollment-token=<enrollment_token>`

Error message received after running sudo command:  
`bash-5.1# sudo ./elastic-agent install -f --url=<fleet_server_url> --enrollment-token=<enrollment_token>`  
`sudo: unable to execute ./elastic-agent: No such file or directory`

I saw that the sudo command "_requires a system and service manager like systemd_."

- So I added openrc to the image and got the same issue - Though I wasn't sure if I was required to configure openrc because my knowledge is limited with that.

I also double checked elastic-agent was in the directory..:  
`bash-5.1# ls`  
`LICENSE.txt``README.md``elastic-agent``elastic-agent.yml`  
`NOTICE.txt``data``elastic-agent.reference.yml`

Permissions also look fine:  
`bash-5.1# ls -l`  
`-rw-r--r-- 1 root root 13675 May 20 00:54 LICENSE.txt`  
`-rw-r--r-- 1 root root 8576604 May 20 00:54 NOTICE.txt`  
`-rw-r--r-- 1 root root 863 May 20 01:02 README.md`  
`drwxr-xr-x 1 root root 4096 Jun 2 11:55 data`  
`lrwxrwxrwx 1 root root 39 Jun 2 11:55 elastic-agent -> data/elastic-agent-054e22/elastic-agent`  
`-rw-r--r-- 1 root root 9020 May 20 00:55 elastic-agent.reference.yml`  
`-rw------- 1 root root 9017 May 20 00:55 elastic-agent.yml`

I have tried to troubleshoot myself, but I am relatively new to the world of Elastic / Docker so any support you can provide to get this working would be greatly appreciated!

Thanks

---

<div class="post-metadata">

**Author:** ![Thibault\_Richard](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thibault_richard/32/50513_2.png) [@Thibault\_Richard](https://discuss.elastic.co/u/Thibault_Richard)\
**Post date:** [June 2, 2021, 4:21pm UTC](https://discuss.elastic.co/t/unable-to-install-fleet-managed-elastic-agent/274774/4 "2021-06-02T16:21:04Z")

</div>

The binary is not statically linked (has not all the necessary libraries). If you want the Elastic Agent in an Alpine based Docker image, you will have to compile the binary yourself.

I suggest strongly to use the official image `docker.elastic.co/beats/elastic-agent:7.13.1`.

Please use the [Elastic Stack \> Beats](https://discuss.elastic.co/c/elastic-stack/beats/28) space for Elastic Agent related questions. This space is dedicated to discuss about [Elastic Cloud on Kubernetes (ECK)](https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-overview.html).

---

<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:** [November 4, 2022, 8:30am UTC](https://discuss.elastic.co/t/unable-to-install-fleet-managed-elastic-agent/274774/5 "2022-11-04T08:30:58Z")

</div>


