Deploy Agent is a lightweight service that runs on your VPS.
It connects to the orchestration platform (ORCH_URL) and automates the deployment of containerized applications on your infrastructure.
- 🔑 Agent registration → securely registers with the orchestrator (
/register) - 📡 Job polling → fetches pending deployment jobs (
/poll_jobs) authenticated via token - ⚙️ Automated deployments → executes deployment scripts (
deploy_app_with_certs.sh,deploy-spa-app.sh) for both standard and SPA apps - 🔐 Secure environment management → retrieves environment variables from the orchestrator and writes
.envfiles with strict permissions - 📝 Job reporting → sends job execution status and logs back to the orchestrator (
/report) - ⚡ Systemd integration → runs as a background service and restarts automatically on failures
-
Orchestrator sends jobs to registered agents.
-
Deploy Agent running on the VPS polls for jobs.
-
On receiving a job:
- Downloads required environment variables from the orchestrator
- Creates a
.envfile under/opt/apps/<app>/ - Executes the appropriate deployment script inside the VPS
- Reports results and logs back to the orchestrator
-
The service runs continuously under
systemd, ensuring reliability and self-healing.
On your VPS, run the following one-liner:
curl -fsSL https://github.com/Idem-AI/deploy-agent/releases/download/v1.1.0/vps-agent.sh | sudo bash -s -- https://orchestrator.idem.africa👉 Replace https://orchestratoridem.africam with your orchestrator URL.
To skip bootstrap preparation:
curl -fsSL https://github.com/Idem-AI/deploy-agent/releases/download/v1.1.0/install-agent.sh | sudo bash -s -- https://orchestrator.idem.africa --no-bootstrapCheck if the agent service is running:
systemctl status deploy-agent.serviceFollow logs in real time:
journalctl -u deploy-agent.service -fTo upgrade to the latest release:
curl -fsSL https://github.com/Idem-AI/deploy-agent/releases/latest/download/vps-agent.sh | sudo bash -s -- https://orchestrator.idem.africaThe installer will:
- Download the newest agent and bootstrap scripts from the GitHub Release
- Update the Python virtual environment
- Restart the systemd service
- ✅ All artifacts (vps-agent.sh
,agent.py,bootstrap.sh`) are distributed via GitHub Releases, ensuring immutability and trust. - ✅ Tokens are stored locally at
/etc/deploy-agent/token.jsonwith600permissions. - ✅ The agent runs as
rootto manage deployments but is sandboxed through strict directory usage (/opt/deploy-agent,/opt/apps). - ✅ Environment variables are written securely into
.envfiles with600permissions to prevent leaks. - 🔒 Optionally, release files can be distributed with SHA256 checksums or GPG signatures for extra verification.
By default, the agent expects the following scripts to be present:
deploy_app_with_certs.sh→ deploys containerized applications with SSL certificatesdeploy-spa-app.sh→ deploys SPA (Single Page Application) apps
These scripts should be stored in /opt/ and will be executed automatically by the agent.
The agent behavior can be customized via environment variables (configured in the systemd unit):
| Variable | Default | Description |
|---|---|---|
ORCH_URL |
http://localhost:8000 |
Orchestrator URL |
DEPLOY_CERT_SCRIPT |
/opt/deploy_app_with_certs.sh |
Script for standard containerized app deployment |
DEPLOY_SPA_SCRIPT |
/opt/deploy-spa-app.sh |
Script for SPA deployments |
POLL_INTERVAL |
10 seconds |
Interval between job polls |
TOKEN_FILE |
/etc/deploy-agent/token.json |
Location of the agent’s authentication token |
JOB_TIMEOUT |
3600 seconds (1 hour) |
Maximum execution time per job |
MAX_OUTPUT_LENGTH |
20000 characters |
Maximum output length stored and reported |
- User pushes code → orchestrator generates a deployment job
- Deploy Agent polls
/poll_jobsand receives the job - Agent fetches environment variables (e.g. DB credentials, API keys)
- Agent writes
.envunder/opt/apps/myapp/ - Agent executes
deploy_app_with_certs.sh myapp-repo.git - Logs and status are reported back to the orchestrator
You can run the agent manually for one-shot deployment:
python3 agent.py --once --repo https://github.com/example/myapp.git --domain myapp.comThis will:
- Create the
/opt/apps/myapp/.envfile - Run the deployment script in the app directory
Planned enhancements for upcoming versions of Deploy Agent:
- 🔄 Auto-update mechanism → agent can self-update by pulling the latest GitHub Release
- 🛡️ GPG-signed releases → provide cryptographic verification of downloaded artifacts
- 📦 Containerized agent → distribute agent as a Docker container for even easier installation
- 🔔 Monitoring & metrics → expose Prometheus/OpenTelemetry metrics for observability
- 🖥️ Multi-user support → allow non-root execution with elevated privileges only when required
- 🕹️ CLI tools → provide a
deploy-agentCLI to manually trigger jobs and check status - 🌍 Multi-orchestrator support → connect a single agent to multiple orchestrators
- 🚨 Enhanced failure handling → smarter retry strategies, job prioritization, and alerting
MIT License. See LICENSE for details.