Product / CI & pipelines / Self-hosted agents
Self-hosted agents
Run Semaphore jobs on your own Linux, macOS, Windows or Kubernetes machines, while Semaphore handles scheduling, logs and the UI.
TL;DR
- Install the open-source agent on your machine and it pulls jobs from Semaphore.
- The agent only makes outbound connections, so no inbound ports are opened.
- Autoscaling can scale agents to zero when there is no work.
- Mix managed machines and self-hosted agents in the same pipeline.
Watch: self-hosted agents
What it does
A self-hosted agent is a small open-source program you run on your own machine. It connects to Semaphore, picks up jobs and runs them in your environment, while Semaphore keeps scheduling, logs and the UI.
- Your hardware, your network. Use GPUs, large machines, private networks or special licences that a cloud runner does not have.
- Linux, macOS, Windows and Kubernetes. Run agents on any of them, or on AWS with the agent AWS stack.
- Scale to zero. Autoscaling starts agents when jobs queue and stops them when idle.
- One-way connection. The agent calls Semaphore over HTTPS. You open no inbound ports.
- Encrypted. Traffic between the agent and Semaphore is encrypted.
- Open source. The agent code is public on GitHub.
How it works
Create an agent type in your organization, start the agent with its token, then point a pipeline or a single block at that type.
.semaphore/semaphore.yml
version: v1.0
name: Build on our own machines
agent:
machine:
type: s1-gpu-linux
blocks:
- name: Train and test
task:
jobs:
- name: GPU tests
commands:
- checkout
- make test-gpu
Install steps per platform are in installing self-hosted agents. Configuration options are in the agent config reference.
Managed machines or self-hosted?
| Managed machines | Self-hosted agents | |
|---|---|---|
| Who maintains the machine | Semaphore | You |
| Hardware choice | Listed machine types | Anything that runs the agent |
| Access to private networks | Through secrets and tunnels | Direct |
| Caching and images | Built-in cache, updated OS images | Your own |
| Mix both in one pipeline | Yes, per block | Yes, per block |
FAQ
Linux, macOS and Windows, plus Kubernetes through the agent Helm chart and AWS through the agent AWS stack.
No. The agent opens an outbound HTTPS connection to Semaphore and polls for jobs. Nothing connects in.
Yes. Set the agent per pipeline or per block, so some blocks run on Semaphore machines and others on yours.
Yes. The agent is open source and its code is on GitHub.
Self-hosted agents are the feature. Hybrid is the edition built around it: Semaphore runs the control plane, you run all the jobs on your own agents.
Next steps
Install your first agent → · Hybrid edition → · All CI & pipeline features →
Blog · Deep dive
How to scale CI/CD with self-hosted agents
Autoscaling, agent types and running agents on AWS and Kubernetes.