Configuring the self-hosted runner application as a service - GitHub Docs

You can configure the self-hosted runner application as a service to automatically start the runner application when the machine starts.