GitHub Action Runners (Docker Compose)
Self-hosted GitHub Actions runners running in Docker, based on myoung34/docker-github-actions-runner.
Quick start
1. Create the data folder for your org
Each runner stores its work directory under data/<your-org-name>:
mkdir -p data/myorg
2. Get a GitHub access token
- Go to https://github.com/settings/tokens (on your user account, not the org).
- Click Generate new token (classic).
- Name: something like
github-self-hosted-runners. - Expiration: set to No expiration.
- Check these scopes:
admin:orgadmin:org_hooknotificationsread:public_keyread:repo_hookrepoworkflow
- Generate and copy the token (it looks like
ghp_XXXXXXXXXXXXXXXXXXXXXXXXXX).
3. Configure docker-compose.yml
Edit the service and set your values:
services:
github-runner-myorg:
image: git.neo24.net/public/github-action-runner:latest
#image: myoung34/github-runner:latest
restart: unless-stopped
container_name: github-runner-myorg
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data/myorg:/home/runner/work
environment:
DOCKER_HOST: unix:///var/run/docker.sock
RUNNER_NAME: ghr-myorg
RUNNER_GROUP: self-hosted
RUNNER_SCOPE: org
ORG_NAME: myorg
LABELS: self-hosted,linux,docker,x64
RUNNER_WORKDIR: /home/runner/work
ACCESS_TOKEN: ghp_XXXXXXXXXXXXXXXXXXXXXXXXXX
Replace myorg with your org name and paste your token into ACCESS_TOKEN.
4. Start the runner
docker compose up -d
Check it's connected under GitHub → Org → Settings → Actions → Runners, then 💥 you're done.
5. Put the runner in a group
Once the runner shows up, group it so you can control which repos can use it.
Create the group
- Go to https://github.com/organizations/myorg/settings/actions/runner-groups.
- Create a new group named
self-hosted. - Repository access: select Selected repositories.
- Check Allow public repositories
- Workflow access: select All workflows.
Move the runner into the group
- Go to https://github.com/organizations/myorg/settings/actions/runners.
- Find your new runner and click it.
- In the Runner group section, move it into
self-hosted
Assign repositories to the group
Go back to https://github.com/organizations/myorg/settings/actions/runner-groups,
open the self-hosted group, and use the Selected repositories ⚙️ (cog) button to
add the repositories that are allowed to use this runner.
Replace
myorgin the URLs above with your actual org name.
Useful commands
docker compose logs -f # follow logs
docker compose down # stop and remove
docker compose pull # update the image
Adding more runners
Copy the service block, rename it (e.g. github-runner-otherorg), give it a unique
container_name / RUNNER_NAME, point its volume at a new data/<org> folder, and
create that folder with mkdir -p data/<org>.
Notes
-
The default image is mirrored to
git.neo24.net/public/github-action-runner:latest. To re-mirror the upstream image (seecmd-to-push.txt):docker buildx imagetools create \ --tag git.neo24.net/public/github-action-runner:latest \ myoung34/github-runner:latest -
Keep your
ACCESS_TOKENsecret — don't commit it to a public repo.