Skip to content

Instantly share code, notes, and snippets.

@jakebrinkmann
Last active February 11, 2025 20:12
Show Gist options
  • Save jakebrinkmann/ae14c47ee7fd77ec03f5f78879dedda9 to your computer and use it in GitHub Desktop.
Save jakebrinkmann/ae14c47ee7fd77ec03f5f78879dedda9 to your computer and use it in GitHub Desktop.
Setup Azure DevOps agent (self-hosted) on Linux Server

setup-azure-devops-agent-self-hosted-on-linux-server

#!/usr/bin/env bash
INSTALL_PATH=~/.devops-agent
mkdir -p $INSTALL_PATH
URL='https://vstsagentpackage.azureedge.net/agent/4.251.0/vsts-agent-linux-x64-4.251.0.tar.gz'
curl -O $URL
FILENAME=$(readlink -f $(basename $URL))
tar zxvf $FILENAME -C $INSTALL_PATH
# NOTE: Need to make a Personal Access Token (PAT) with Agent Pool (read, manage) permissions
cd $INSTALL_PATH
./config.sh \
--unattended \
--agent inhouse-linux-$USER-agent \
--pool "In-House Deployments" \
--url https://dev.azure.com/$AZ_ORGANIZATION_NAME \
--auth PAT \
--token $AZ_DEVOPS_PAT
# Start the agent (interactive)
./run.sh
# Start the agent (as a service)
# needs devops-agent user
sudo ./svc.sh install devops-agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment