Docker engine: https://docs.docker.com/engine/install/
Unprivileged user:
# the username corresponds to the User command in service configuration file
sudo useradd -r -s /usr/sbin/nologin -m -c "Gitea Actions Runner" act_runner
Add act_runner to docker group:
sudo usermod -aG docker act_runner
ref: Start the runner with Systemd
VERSION=0.2.11
# the path corresponds to the ExecStart command
sudo curl -sSLo /usr/local/bin/act_runner \
https://dl.gitea.com/act_runner/${VERSION}/act_runner-${VERSION}-linux-amd64
sudo chmod +x /usr/local/bin/act_runner
-
Obtain a registration token:
token level:
- Instance level: for global
- Organization level: for single user/org, or individual
- Repository level: for single repo
-
Generate config:
sudo mkdir -p /etc/act_runner/ # the path corresponds to the --config flag in the ExecStart command act_runner generate-config | sudo tee /etc/act_runner/config.yaml sudo chown -R act_runner:act_runner /etc/act_runner/
-
Register runner:
# the path corresponds to the WorkingDirectory command sudo mkdir -p /var/lib/act_runner cd /var/lib/act_runner act_runner --config /etc/act_runner/config.yaml register sudo chown -R act_runner:act_runner /var/lib/act_runner
-
Start the runner with Systemd
cat << 'EOF' | sudo tee /etc/systemd/system/act_runner.service [Unit] Description=Gitea Actions runner Documentation=https://gitea.com/gitea/act_runner After=docker.service [Service] ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml ExecReload=/bin/kill -s HUP $MAINPID WorkingDirectory=/var/lib/act_runner TimeoutSec=0 RestartSec=10 Restart=always User=act_runner [Install] WantedBy=multi-user.target EOF sudo systemctl start act_runner # After confirming that it works properly sudo systemctl enable --now act_runner