This repository provides a simple and production-ready setup for Woodpecker CI as a CI/CD pipeline server. It is designed for staging or production environments to simplify your deployment workflow.
Manually running git push, git pull, docker down, build, and up routines can be tedious. That's why I prepared this CI/CD setup to make my life easier.
I specifically chose an open-source CI/CD solution that's easy to set up (sorry Jenkins), and I found that Woodpecker meets my needs perfectly.
- A domain
- A VPS or local machine running Linux (tested on Ubuntu & Arch Linux)
- Docker and Docker Compose installed
- A Docker network named application_network
-
Clone this repository:
git clone https://github.com/wolewd/woodpecker.git cd woodpecker -
Create your
.envfile:touch .env
-
Configure your
.envfile Refer to the.env.examplefile for guidance. Here's a sample configuration:# Port for the Woodpecker server WOODPECKER_SERVER_ADDR=:8001 # Port for the agent to connect to the server WOODPECKER_GRPC_ADDR=:8002 # Web UI address (replace with your domain) WOODPECKER_HOST=https://ci.your-domain.com # Shared secret between server and agent WOODPECKER_SECRET=supersecret # Git provider WOODPECKER_GITHUB=true # Your GitHub OAuth credentials WOODPECKER_GITHUB_CLIENT=your_github_client_id WOODPECKER_GITHUB_SECRET=your_github_client_secret # Set your github account to be admin WOODPECKER_ADMIN=your_github_username WOODPECKER_DEFAULT_TRUSTED=true # Agent connection target (Docker container format) WOODPECKER_SERVER=woodpecker-server:8002 # Must match WOODPECKER_SECRET WOODPECKER_AGENT_SECRET=supersecret # Set to true to allow initial registration (disable after first login) WOODPECKER_OPEN=true # directory where you clone all of your repository to run in your vps [pwd] DIR_PATH=/home/user
-
Run the container:
docker compose up -d
-
Access your site:
https://ci-your-domain.com
-
Log in using your GitHub account, then shut down the containers:
docker compose down
-
Update your
.envfile to disable open registration:WOODPECKER_OPEN=false
This prevents other users from registering new accounts.
You can create new client inside your github account following this step:
-
Go to
Settings->Developer Settings->OAuth Apps->New OAuth Apps -
Set
Application nameto anything you like -
Set the
Homepage URLto the domain you used in your.envfile. (e.g. https://ci-your-domain.com) -
Optionally, set the
Application descriptionto anything you like. -
Set the
Authorization callback URLto your domain followed by/authorize. (e.g. https://ci-your-domain.com/authorize) -
Click
Register application -
Inside your new OAuth app, click
Generate a new client secretand save it somewhere safe.
-
Make sure your domain or subdomain has proper DNS records set up.
-
This setup is intended for staging or production environments, and is not optimized for local development.
-
This repository does not yet include a guide for setting up CI/CD pipelines — I plan to add that soon.
-
You should create your own
.woodpecker.yamlsince I don't include the tutorial here. I just include.woodpecker.yaml.examplefor your references.