PikoCI: Self-Hosted CI/CD in One Binary
Self-hosting CI is usually a choice between two kinds of pain. One option is a hosted platform that owns your pipelines, your runners and your bill. The other is a self-hosted system where “getting started” means a database, a web node, a worker, a container runtime and an afternoon of reading Helm values.
PikoCI is an open-source project I contribute to that takes a different route. Its tagline is “The CI/CD that grows with you. One binary, any database, runs anywhere.” It’s written in Go, licensed under Apache 2.0, and at v0.8.0 it’s mature enough that it runs its own CI.
What it is
PikoCI is built around the resource / resource-type pipeline model from Concourse CI. A pipeline is made of resources (a git repo, a cron schedule, an image registry), jobs that get those resources, and tasks that run when a new version of a resource appears. Anyone who has used Concourse will recognize this model. It’s explicit, it’s composable, and the pipeline graph explains itself.
What PikoCI changes is how much it takes to run:
- One binary. No Docker Compose, no Kubernetes, no setup scripts. Download it and run it.
- Any database, or none. SQLite is built in, MySQL and PostgreSQL are supported, and
--db-system memruns the whole system in memory with nothing to clean up. - Portable. Bundle the binary, the pipeline files and the SQLite file, and you can move your whole CI to another machine.
- HCL instead of YAML. Pipelines read like Terraform, with variables, functions,
for_eachandmatrix.
Up and running in one command
Here’s a complete pipeline. A cron resource produces a new version every 10 seconds, and each new version triggers a job:
resource "cron" "my_cron" {
check_interval = "@every 10s"
}
job "gen" {
get "cron" "my_cron" {
trigger = true
}
task "echo" {
run "exec" {
path = "echo"
args = ["IN"]
}
}
}
Start a server with that pipeline already loaded, an in-memory database and a built-in worker:
./pikoci server \
--db-system mem \
--jwt-secret my-secret \
--run-worker \
--pipeline-name my-pipeline \
--pipeline-config pipeline.hcl
Open http://localhost:8080, log in as admin / admin123 (you’ll be asked to change the password), and the pipeline is already running. There’s no separate step in the CLI or UI to register it. The same command works with docker run ghcr.io/pikoci/pikoci:latest server ..., and there are .deb and .rpm packages too.
Run a job locally, without a server
This is the feature I use most. pikoci run starts an in-memory database and a worker in a single process, runs one job, streams its output, and exits with the job’s exit code:
pikoci run -p pipeline.hcl -j test
# test against your working copy instead of pulling the repo
pikoci run -p pipeline.hcl -j test --resource git.my-repo=./my-repo
The --resource override copies a local directory in place of the resource’s pull step. So “does my CI change work?” is answered on your laptop, against uncommitted code, before you push anything. It’s the tightest loop I’ve had with any CI system.
A real pipeline: PikoCI building PikoCI
PikoCI’s own pipeline runs lint, unit tests, integration tests and backend tests on every pull request. The backend job is a good example of services, which are ephemeral databases and tools that run alongside a job and are torn down afterwards:
job "test-backends" {
get "git" "pikoci_pr" {
trigger = true
passed = ["lint", "test-mock", "test-integration"]
}
service "mariadb" {}
service "postgresql" {}
service "vault" {}
task "make" {
run "docker" {
image = "golang:1.25.1"
cmd = "cd ${var.git_name} && make test-backends"
args = ["--network=host"]
}
}
}
passed says this job runs only on versions that have already gone through the three cheaper jobs, which is the Concourse idea of a pipeline as a chain of gates. run "docker" picks the runner. The same task could use run "exec" on the host, or a runner you define yourself.
PikoCI can also render a pipeline’s live state as an image. The status graph at the top of the project README is served by PikoCI itself, and you can export one as DOT or SVG for your own README or dashboard.
The things you need once it matters
Single-binary tools often stop at the demo. PikoCI keeps going into the features that a team or a production deploy actually needs:
- Separate workers. Run the server on one machine and workers on others, connected over gRPC with a worker token. Route jobs to particular workers with
tags, for exampletags = ["gpu"]. - Auth and roles. OAuth/OIDC with GitHub, Google, GitLab, Keycloak, Microsoft, Bitbucket or any OIDC provider, alongside local users. Teams have hierarchical roles: read, write, maintain, admin.
- Approval gates. Require one or more human approvals before a job runs.
- Audit log. An append-only record of every significant action, per team.
- Secrets. Vault and file-based backends, plus a new built-in secret store in 0.8: team- or pipeline-scoped, age-encrypted, and masked in build logs.
- Notifications. Slack, Discord and GitHub Checks out of the box.
- Public pipelines. Pipelines are private by default, but any pipeline can be made public with
pikoci client pipelines update -n <name> --public. A public pipeline can then be viewed without an account: its graph, jobs, builds and build logs (secret values stay masked), but not its raw config or resource credentials. It’s set per pipeline, so the rest of the team’s pipelines stay private. That’s handy for open source.
What’s new in 0.8
The 0.8.0 release added the features that make pipelines feel more like programs:
-
Conditionals.
if/else_if/elseblocks branch on runtime values such as the branch a commit came from, a task output or a manual input. -
Parameterized manual triggers. A job declares typed
inputblocks, and triggering it by hand shows a form:job "deploy" { input "environment" { type = "string" options = ["staging", "production"] default = "staging" } task "deploy" { run "exec" { path = "./deploy.sh" args = ["$INPUT_environment"] } } } -
interruptiblecancels older builds of a job when a new one starts.allow_failureturns a failed build into a warning that doesn’t block downstream jobs.disable_retryprevents retries of a job. -
on_triggerhooks, so GitHub Checks show “queued” the moment a commit arrives. -
Performance and security work. Build lists dropped from about 16 MB to 50 KB per page, pipeline images render in under a second, and worker tokens were narrowed to an explicit allowlist.
Coming from Concourse
If you run Concourse today, most of what you know carries over. The main differences:
- Deployment is one binary instead of a multi-service setup that requires PostgreSQL.
- Runners replace task
image_resource. Define a runner once and reference it from any job. - Secrets use
secret_typeblocks with secret-backed variables.
A Concourse pipeline importer is planned, and the docs have a migration guide.
Who it’s for
- Small teams and solo developers who want real pipelines on their own hardware without running a platform.
- Homelabs and edge machines, where one binary and one SQLite file is about as much as you want to maintain.
- Concourse users who like the model but not the operational footprint.
- Anyone who wants to test CI changes locally before pushing, thanks to
pikoci run.
The “grows with you” part is the point: you can start with --db-system mem on a laptop, move to SQLite on a small server, then to PostgreSQL with separate workers, and the pipelines don’t change along the way.
Try it
curl -L https://github.com/PikoCI/pikoci/releases/latest/download/pikoci-linux-amd64 -o pikoci
chmod +x pikoci
- Code: github.com/PikoCI/pikoci
- Docs: docs.pikoci.com
- Live pipeline: ci.pikoci.com
- Community: Discord
If it looks useful, give it a star, try one of the ready-to-run examples, and open an issue with whatever gets in your way. Contributions are welcome, and for a large feature the project asks that you open an issue first to discuss the approach.