# Run APM in local

**URL:** <https://discuss.elastic.co/t/run-apm-in-local/360276>\
**Category:** APM\
**Tags:** server\
**Created:** [May 27, 2024, 10:45am UTC](https://discuss.elastic.co/t/run-apm-in-local/360276 "2024-05-27T10:45:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)\
**Post date:** [May 27, 2024, 10:45am UTC](https://discuss.elastic.co/t/run-apm-in-local/360276/1 "2024-05-27T10:45:12Z")

</div>

Hi there,

i keep getting this message while trying to run apm server on my local. what could possibly the cause?

```auto
May 27 17:39:15 polos systemd[3041]: apm-server.service: Failed to execute command: Permission denied
May 27 17:39:15 polos systemd[3041]: apm-server.service: Failed at step EXEC spawning /apm-server/apm-server/apm-server-7.17.18-linux-x86_64/apm-server: Permission denied
May 27 17:39:15 polos systemd[1]: apm-server.service: Main process exited, code=exited, status=203/EXEC

```

I installed it by using .tar.gz installation and the ownership of the config file (apm-server.yml) is 600. owned by root

and this is how my systemd looks like

```auto
[Unit]
Description=APM Service

[Service]
Type=simple
ExecStart=/apm-server/apm-server/apm-server-7.17.18-linux-x86_64/apm-server
WorkingDirectory=/apm-server/apm-server/apm-server-7.17.18-linux-x86_64
Restart=on-failure
RestartSec=5s

# Specifies the maximum size of virtual memory
LimitAS=infinity

# Specifies the maximum file size
LimitFSIZE=infinity

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0

# SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM

# Send the signal only to the JVM rather than its control group
KillMode=process

# Java process is never killed
SendSIGKILL=no

# When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

```

and this what my files looks like  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/1/0114e91ad0f65cbc81dc66a8d483e0a338997908.png)

even the binary itself was owned by root. and it still gives me the same error message.

it's working if I run it by using ./apm-server -e

so I think the problem is in systems but idk where exactly. can you help me with this?  
Thanks

---

<div class="post-metadata">

**Author:** ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)\
**Post date:** [June 5, 2025, 3:17pm UTC](https://discuss.elastic.co/t/run-apm-in-local/360276/2 "2025-06-05T15:17:31Z")

</div>

finally, i found a solution for this.

my SELinux is active, so I labeled apm's binary to bint\_t

`semanage fcontext -a -t bin_t "/apm/apm-server-8.18.2-linux-x86_64/apm-server"`  
`restorecon -v /apm/apm-server-8.18.2-linux-x86_64/apm-server`

That way, apm service can be running normally. But I still don't understand why this happens. elasticsearch on the same machine with the same label before `unlabeled_t` can run without any disruption. i even make APMs' systemd look exactly the same as Elastic. i just changed the path but it still didn't work
