# Act\_runner as Windows service

**URL:** <https://forum.gitea.com/t/act-runner-as-windows-service/10432>\
**Category:** Actions\
**Created:** [January 15, 2025, 3:25pm UTC](https://forum.gitea.com/t/act-runner-as-windows-service/10432 "2025-01-15T15:25:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![s.mueller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/s.mueller/32/6577_2.png) [@s.mueller](https://forum.gitea.com/u/s.mueller)\
**Post date:** [January 15, 2025, 3:25pm UTC](https://forum.gitea.com/t/act-runner-as-windows-service/10432/1 "2025-01-15T15:25:31Z")

</div>

Hi,

the [Act Runner docs](https://docs.gitea.com/usage/actions/act-runner#start-the-runner-with-launchdaemonmacos) mention that you should be able to run Act Runner as a Windows service. However, when I try to run it as a service (command: C:\gitea\_actions\act\_runner.exe daemon --config C:\gitea\_actions\config.yaml ), I only get the following error message:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/gitea/original/2X/f/f296d9b94e5ec39805789c67504c3c65b92a7906.png)

Roughly translated: "The service “GiteaActionRunner” on “Local Computer” could not be run. Error 1053: The service did not respond to the start or control request in a timely fashion.

Am I doing something wrong when registering the service or is there another, preferred way to running the act\_runner daemon on Windows?

---

<div class="post-metadata">

**Author:** ![leozelion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/leozelion/32/6606_2.png) [@leozelion](https://forum.gitea.com/u/leozelion)\
**Post date:** [January 24, 2025, 10:39am UTC](https://forum.gitea.com/t/act-runner-as-windows-service/10432/2 "2025-01-24T10:39:40Z")

</div>

The first problem may be with `Error: open .runner: The system cannot find the file specified`, when service launch act\_runner.exe from Service Control Manager working directory (%WinDir%\System32), and it really couldn’t get .runner file from there, which **by default** taken from current directory. You may reproduce that behavior when start CMD from `C:\Windows\system32`.

So, there are 2 ways to fix:

1. In the config.yaml (you can generate it by `act_runner.exe generate-config > .\config.yaml`) change `runner : file : <full path to your .runner file>`
2. Or just move `.runner` file to the `C:\Windows\system32`.

But this still doesn’t solve the main problem, that the **act\_runner.exe does not work correctly with Windows services**.

The solution is to use NSSM.exe wrapper. Download it from official site, create new service, e.g. GiteaActionRunnerNSSM, with the same properties as in Services.

It works for me at Windows Server 2019, Gitea v1.23.1 and act\_runner v0.2.11

---

<div class="post-metadata">

**Author:** ![VicCont](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/viccont/32/6612_2.png) [@VicCont](https://forum.gitea.com/u/VicCont)\
**Post date:** [January 27, 2025, 9:03pm UTC](https://forum.gitea.com/t/act-runner-as-windows-service/10432/3 "2025-01-27T21:03:13Z")

</div>

Hi could you please share your input on the nssm screen, i cant make my runner service start

---

<div class="post-metadata">

**Author:** ![s.mueller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/s.mueller/32/6577_2.png) [@s.mueller](https://forum.gitea.com/u/s.mueller)\
**Post date:** [January 29, 2025, 5:32am UTC](https://forum.gitea.com/t/act-runner-as-windows-service/10432/4 "2025-01-29T05:32:29Z")

</div>

@leozelion Thank you very much. I adjusted the config.yaml accordingly. I knew Windows Services were running in C:\Windows, hence the absolute paths in the command, but I had actually forgotten about the config.

With NSSM I was now able to run act\_runner as a Windows service. I will however still create an issue over at [GitHub · Where software is built](https://github.com/go-gitea/gitea/issues) to hopefully get it working natively.

@VicCont My NSSM config looks something like the following. Since NSSM allows to set a Startup Directory, the absolute paths are probably not required but I wanted to be on the safe side. (I used NSSM win64 2.24-101 prerelease btw since the NSSM website says something about the “normal” 2.24 release not working from Win10 Creators Update onwards):

```auto
Service name: GiteaActionRunner

Application
Path: C:\gitea_actions\act_runner.exe
Startup Directory: C:\gitea_actions
Arguments: --config C:\gitea_actions\config.yaml daemon

Details
DisplayName: GiteaActionRunner
Description: Action runner for Gitea
Startup type: Automatic

Log on
This account: *redacted*
Password: *redacted*

```
