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
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
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 states:
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:
Override detection by setting
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
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