On this page
- What is Woodpecker and what does the setup look like?
- How do you create the OAuth application in the forge?
- How do you define the server and agent containers?
- How do you start it and publish it over HTTPS?
- How do you activate a repository and write a pipeline?
- How do you use secrets in pipelines?
- What if webhooks or logins fail?
- How do you upgrade and scale Woodpecker?
- Questions
What is Woodpecker and what does the setup look like?
Woodpecker is a light, container based CI engine that reads pipeline files from your repositories and runs each step in its own container. It has two parts:
- Server: web UI, API, webhooks from the forge and the job queue. HTTP on port 8000 and gRPC for agents on port 9000.
- Agent: connects to the server over gRPC, takes workflows and runs them with the local Docker engine.
The server is small; the agent is where CPU and memory go. For a personal or team forge, both fit on the same VPS as Gitea or Forgejo, and the agent can move to a second server later. You need a working Gitea or Forgejo instance with HTTPS, Docker Engine with the Compose plugin, and a DNS name such as ci.example.net pointing at the server.
How do you create the OAuth application in the forge?
Woodpecker has no user database of its own: people log in with their Gitea or Forgejo account through OAuth2. As the admin user (or an organization owner):
- Open Settings, Applications in your forge account and find Manage OAuth2 Applications.
- Name the application
Woodpeckerand enter the redirect URIhttps://ci.example.net/authorize. - Keep Confidential client enabled and save.
- Copy the client ID and client secret; the secret is shown only once.
Woodpecker uses the token from this login to create webhooks and to set commit statuses, so the account that activates a repository needs admin rights on it.
How do you define the server and agent containers?
Keep secrets in an .env file and reference them from compose.yaml. Generate the shared agent secret with openssl.
mkdir -p ~/woodpecker && cd ~/woodpecker
cat > .env <<EOF
WP_AGENT_SECRET=$(openssl rand -hex 32)
WP_CLIENT=paste-client-id
WP_SECRET=paste-client-secret
EOF
chmod 600 .env
cat > compose.yaml <<'EOF'
services:
woodpecker-server:
image: woodpeckerci/woodpecker-server:v3
restart: unless-stopped
ports:
- "127.0.0.1:8000:8000"
volumes:
- wp_server:/var/lib/woodpecker
environment:
WOODPECKER_HOST: https://ci.example.net
WOODPECKER_ADMIN: deploy
WOODPECKER_OPEN: "false"
WOODPECKER_AGENT_SECRET: ${WP_AGENT_SECRET}
WOODPECKER_GITEA: "true"
WOODPECKER_GITEA_URL: https://git.example.net
WOODPECKER_GITEA_CLIENT: ${WP_CLIENT}
WOODPECKER_GITEA_SECRET: ${WP_SECRET}
woodpecker-agent:
image: woodpeckerci/woodpecker-agent:v3
restart: unless-stopped
depends_on:
- woodpecker-server
volumes:
- wp_agent:/etc/woodpecker
- /var/run/docker.sock:/var/run/docker.sock
environment:
WOODPECKER_SERVER: woodpecker-server:9000
WOODPECKER_AGENT_SECRET: ${WP_AGENT_SECRET}
WOODPECKER_MAX_WORKFLOWS: 2
volumes:
wp_server:
wp_agent:
EOFFor Forgejo, Woodpecker 3 has its own driver: replace the four WOODPECKER_GITEA* lines with WOODPECKER_FORGEJO, WOODPECKER_FORGEJO_URL, WOODPECKER_FORGEJO_CLIENT and WOODPECKER_FORGEJO_SECRET. Older Woodpecker releases talk to Forgejo through the Gitea driver, which also works. WOODPECKER_ADMIN names the forge user who becomes Woodpecker admin, and WOODPECKER_OPEN set to false stops strangers from registering.
How do you start it and publish it over HTTPS?
Bring the stack up, check the logs and put a TLS proxy in front of port 8000.
docker compose up -d
docker compose ps
docker compose logs woodpecker-server | tail -n 20
curl -sI http://127.0.0.1:8000 | head -n 1A Caddy site block like this one handles the certificate (see Caddy HTTPS):
ci.example.net {
reverse_proxy 127.0.0.1:8000
}Port 9000 stays inside the Compose network because the agent runs next to the server, so nothing but SSH, 80 and 443 needs to be open:
# Ubuntu and Debian
sudo ufw allow OpenSSH
sudo ufw allow 80,443/tcp
sudo ufw enable
# Rocky and Alma
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --reloadBinding the published port to 127.0.0.1 matters, since Docker port rules are applied before ufw and would otherwise expose the plain HTTP port.
How do you activate a repository and write a pipeline?
Open https://ci.example.net, log in through the forge, click Add repository and enable the one you want. Woodpecker creates the webhook in the forge for you. Then commit .woodpecker.yaml to the repository root:
when:
- event: push
branch: main
- event: pull_request
steps:
- name: test
image: golang:1.24
commands:
- go vet ./...
- go test ./...
- name: build
image: golang:1.24
commands:
- go build -o app .
when:
- event: pushEach step runs in a new container with the repository checked out in a shared workspace, so the build step sees the same files as the test step. For larger projects, split pipelines into several files under .woodpecker/; each file becomes its own workflow and they can depend on each other.
How do you use secrets in pipelines?
Add secrets in the repository settings in the Woodpecker UI (or at organization level), then map them into a step with from_secret:
steps:
- name: deploy
image: alpine:3.20
environment:
DEPLOY_KEY:
from_secret: deploy_key
commands:
- apk add --no-cache openssh-client rsync
- echo "$DEPLOY_KEY" > /tmp/key && chmod 600 /tmp/key
- rsync -e "ssh -i /tmp/key -o StrictHostKeyChecking=accept-new" -a ./public/ deploy@198.51.100.24:/var/www/site/
when:
- event: push
branch: mainWoodpecker masks secret values in the logs. Limit secrets to the events that need them; by default they are not handed to pull requests from forks, and you can require manual approval for fork pull requests in the repository settings.
What if webhooks or logins fail?
Most first run problems come from addresses that do not match.
- Login loops or redirect errors: the redirect URI in the forge must be exactly
WOODPECKER_HOSTplus/authorize. - Pushes do not start pipelines: open the webhook in the repository settings of the forge and look at recent deliveries. If Woodpecker resolves to a private or local address, Gitea and Forgejo block the call until you add the host to
ALLOWED_HOST_LISTin the[webhook]section ofapp.ini. - Pipelines stay pending: the agent is not connected; check
docker compose logs woodpecker-agentfor a wrong agent secret. - Steps cannot pull images: confirm the server resolves DNS and has outbound access.
How do you upgrade and scale Woodpecker?
Pull new images within the same major version and recreate the containers; the server migrates its database on start.
cd ~/woodpecker
docker run --rm -v woodpecker_wp_server:/data -v "$PWD":/backup alpine tar czf /backup/wp-server-$(date +%F).tgz -C /data .
docker compose pull
docker compose up -dRead the migration notes before moving to a new major version, since pipeline syntax and settings change between them. To add build capacity, run more agents on other servers: point WOODPECKER_SERVER at the public address, expose gRPC through a TLS proxy or allow port 9000 only from the agent IP, and use the same agent secret. For heavier use, switch the server from SQLite to PostgreSQL with WOODPECKER_DATABASE_DRIVER and WOODPECKER_DATABASE_DATASOURCE. The CI runners page helps match plans to build load.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Woodpecker CI with Gitea or Forgejo
Does Woodpecker work with GitHub or GitLab too?
Yes, it has drivers for several forges, but this guide focuses on Gitea and Forgejo, which suit a fully self-hosted setup on a private Git server.
Can Woodpecker run on the same server as Forgejo?
Yes. Both are light. Builds are what need CPU and memory, so size the plan for the heaviest pipeline or move the agent to a second server later.
Does the agent need the host Docker socket?
The agent needs it to start step containers, and it gives the agent control over Docker on the host. Only enable repositories you trust and keep fork pull requests behind approval.
How many pipelines can run at once?
WOODPECKER_MAX_WORKFLOWS sets the limit per agent. Start with the number of vCPUs divided by two for compile heavy work.
Where are build logs stored?
In the server database inside the wp_server volume by default. Back that volume up together with the forge data.