Deployment methods
One-liner install script (recommended)
The fastest way to deploy an agent is using the install script endpoint. After registering a server in Pullbase, run:- Downloads the agent binary from GitHub releases
- Creates a dedicated
pullbaseservice user with security restrictions - Configures
/etc/pullbase/agent.envwith your server URL and token - Installs a hardened systemd service
- Starts the agent immediately
| Parameter | Description |
|---|---|
version | Specific agent version (e.g., v1.0.0). Defaults to latest. |
ca_cert | Base64-encoded CA certificate for custom TLS. |
Manual systemd setup
If you prefer manual control or need to customize the installation:1
Download the agent binary
2
Create environment file
3
Create systemd unit
/etc/systemd/system/pullbase-agent.service
4
Enable and start
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
SERVER_ID | Yes | - | Must match the server ID registered in Pullbase |
CENTRAL_SERVER_URL | Yes | - | Base URL of the Pullbase API (e.g., https://pullbase.example.com) |
AGENT_TOKEN | Yes | - | Token provided when the server is created. Rotate regularly. |
CACERT_PATH | No | - | Path to CA bundle that trusts the Pullbase certificate |
SKIP_TLS_VERIFY | No | false | Set to true only for development with self-signed certificates |
AGENT_DRY_RUN | No | false | When true, agent reports what would change without applying |
The agent also supports legacy environment variable names with
PULLBASE_ prefix: PULLBASE_SERVER_ID, PULLBASE_SERVER_URL, PULLBASE_AGENT_TOKEN, PULLBASE_CACERT_PATH.Dry-run mode
Run the agent in dry-run mode to preview changes without applying them:- Checks for configuration drift
- Logs what packages, files, and services would change
- Reports status to the server with “Dry-Run:” prefix
- Does not apply any changes
Supported package managers
The agent auto-detects the host’s package manager:| Package Manager | Distribution | Detection |
|---|---|---|
| APK | Alpine Linux | Checks for apk command |
| APT | Debian, Ubuntu | Checks for apt-get command |
| DNF | RHEL 8+, Fedora, Rocky Linux | Checks for dnf command |
| YUM | RHEL 7, CentOS 7 | Checks for yum command (fallback) |
present: Install if not presentlatest: Install or upgrade to latest available versionabsent: Remove if installed
Supported service managers
The agent auto-detects the init system:| Service Manager | Init System | Detection |
|---|---|---|
| systemd | Most modern distributions | Checks for systemctl and /run/systemd/system |
| supervisor | Docker, custom setups | Checks for supervisorctl |
| OpenRC | Alpine Linux, Gentoo | Checks for rc-service |
system.serviceManager in config.yaml:
Reconciliation cycle
1
Fetch configuration
Agent authenticates with its token and calls
GET /api/v1/agent/serverinfo to obtain Git metadata and the target commit hash.2
Obtain Git credentials
If the environment uses a GitHub App, agent invokes
GET /api/v1/agent/git-token to retrieve a short-lived installation token.3
Clone or update repository
Repository is cloned into
/etc/pullbase/repo. The agent checks out the target commit.4
Apply desired state
Packages, services, and files from
config.yaml are reconciled using the detected package and service managers.5
Report status
Agent posts results (status, drift, error message) to
PUT /api/v1/agent/status.Drift detection and auto-reconciliation
The agent performs drift checks every 60 seconds and compares:- Package installation state
- Service running/enabled state
- File content (SHA256 hash) and permissions
Logging
View agent logs using journalctl:- Package installation/removal operations
- Service start/stop/enable/disable operations
- File writes and permission changes
- Drift detection results
- Git clone/pull operations
Troubleshooting
401 Unauthorized
401 Unauthorized
Git clone failures
Git clone failures
- Check network reachability to GitHub (proxy, firewall)
- For private repos, confirm the GitHub App installation and permissions
- Validate
CACERT_PATHso TLS trust is correct
Package manager errors
Package manager errors
- Ensure the package manager is available and in PATH
- Check that package repositories are configured and reachable
- Verify the agent runs as root (required for package management)
Service manager not detected
Service manager not detected
- Override auto-detection by setting
system.serviceManagerinconfig.yaml - Ensure the service manager commands (
systemctl,supervisorctl,rc-service) are in PATH - For systemd, verify
/run/systemd/systemexists
File permission issues
File permission issues
- Specify
modeinconfig.yaml(e.g.,"0644") - Confirm the agent runs as root (required to manage system files)
- Check SELinux/AppArmor policies if files are created but inaccessible
Agent not reporting status
Agent not reporting status
- Check connectivity:
curl -I https://pullbase.example.com/api/v1/healthz - Verify token is active in the Pullbase UI
- Check agent logs for authentication errors