<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Ops Community ⚙️: CodeHiRise</title>
    <description>The latest articles on The Ops Community ⚙️ by CodeHiRise (@codehirise).</description>
    <link>https://community.ops.io/codehirise</link>
    <image>
      <url>https://community.ops.io/images/4iT5yotQNH2uW70QtJF5bZF7CplkFtYrFVndONo7ugk/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL3Vz/ZXIvcHJvZmlsZV9p/bWFnZS81MTAwL2Y2/NTZlZTBhLTRmZTkt/NGM4Yy05Mjk5LTI5/ODU2MjY5OTcwZS5w/bmc</url>
      <title>The Ops Community ⚙️: CodeHiRise</title>
      <link>https://community.ops.io/codehirise</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.ops.io/feed/codehirise"/>
    <language>en</language>
    <item>
      <title>Setup a GitHub Self-Hosted Runner on an Ubuntu VM: A DevOps Guide</title>
      <dc:creator>CodeHiRise</dc:creator>
      <pubDate>Tue, 18 Feb 2025 06:40:35 +0000</pubDate>
      <link>https://community.ops.io/codehirise/setup-a-github-self-hosted-runner-on-an-ubuntu-vm-a-devops-guide-4fej</link>
      <guid>https://community.ops.io/codehirise/setup-a-github-self-hosted-runner-on-an-ubuntu-vm-a-devops-guide-4fej</guid>
      <description>&lt;p&gt;This article originally published on &lt;a href="https://codehirise.com/post/setup-github-action-private-runner-in-ubuntu-vm" rel="noopener noreferrer"&gt;codehirise&lt;/a&gt;, and &lt;a href="https://dev.to/codehirise/setup-a-github-self-hosted-runner-on-an-ubuntu-vm-a-devops-guide-3aim" rel="noopener noreferrer"&gt;dev.to&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Hi everyone,&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In this article, we will walk you through the steps for setting up GitHub Self-hosted Runners in Ubuntu virtual machine as a service for persistence runner installation.&lt;/p&gt;

&lt;p&gt;The primary reason organizations to adopt GitHub self-hosted runners is to securely access internal, private networks such as databases, services, or virtual machines without exposing them to the public internet. By keeping workflows within their controlled infrastructure, they eliminate risks like accidental data leaks or compliance violations.&lt;/p&gt;

&lt;p&gt;Additionally, self-hosted runners safeguarding sensitive code, credentials, or artifacts since runners are hosted on organization network.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A GitHub account.&lt;/li&gt;
&lt;li&gt;An Ubuntu Virtual machine with root access with internet connectivity.&lt;/li&gt;
&lt;li&gt;Basic familiarity with Linux commands and GitHub Actions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lets get started&lt;/p&gt;

&lt;p&gt;First go to your desired GitHub repository and go to Settings &amp;gt; Actions &amp;gt; Runners &amp;gt; New self-hosted runner.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/ukqQkob_H8RmxIrlWwcyNDW3KRYaTP3oF0OqB4nRugQ/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3Y4anpw/bG1nMjdnam1sZjV0/dDF4LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/ukqQkob_H8RmxIrlWwcyNDW3KRYaTP3oF0OqB4nRugQ/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3Y4anpw/bG1nMjdnam1sZjV0/dDF4LnBuZw" alt="createnew runner github ui" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you click New self hosted runner button you will get below page with all required steps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/_mLF5TgmJ-rLTugx9bLas-_8aCr7kNzzGSTi7LGOmaY/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3Fqdnpt/dmZoczZlbGZ5a251/bHdjLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/_mLF5TgmJ-rLTugx9bLas-_8aCr7kNzzGSTi7LGOmaY/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3Fqdnpt/dmZoczZlbGZ5a251/bHdjLnBuZw" alt="github ui runner setup instructions" width="800" height="767"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It outlines downloading and setting up action runner but in our case we will take some extra steps to make sure our setup is more secure and configure runner as a systemd service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Create a Dedicated System User for GitHub action runner
&lt;/h2&gt;

&lt;p&gt;we will create new system user user in our ubuntu vm.&lt;/p&gt;

&lt;p&gt;Run below commad.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;useradd &lt;span class="nt"&gt;--system&lt;/span&gt; &lt;span class="nt"&gt;--shell&lt;/span&gt; /usr/sbin/nologin gh-action-runner-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--system&lt;/code&gt;: Creates a non-interactive service account.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--shell /usr/sbin/nologin&lt;/code&gt;: Blocks SSH/login access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/0i5JF0Ur2VoNU8n3CDymDvk2JXyKz56XFZkJWVoDZuQ/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3QxZHR5/cXYxbGpmNmZsNHAy/Z3YwLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/0i5JF0Ur2VoNU8n3CDymDvk2JXyKz56XFZkJWVoDZuQ/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3QxZHR5/cXYxbGpmNmZsNHAy/Z3YwLnBuZw" alt="Image description" width="800" height="37"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 2: Download the GitHub Runner&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Run below command to create runners installation directory in /opt directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /opt/gh-runner
&lt;span class="nb"&gt;cd&lt;/span&gt; /opt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Use the /opt directory for installation of add-on application software package and avoid using user's home directory
&lt;/h4&gt;

&lt;p&gt;Run below command to change ownership of the directory to our current owner for downloading and extracting files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown &lt;/span&gt;codehirise:codehirise gh-runner/
&lt;span class="nb"&gt;cd &lt;/span&gt;gh-runner
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then run below to extract action runner.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-o&lt;/span&gt; actions-runner-linux-x64-2.322.0.tar.gz &lt;span class="nt"&gt;-L&lt;/span&gt; https://github.com/actions/runner/releases/download/v2.322.0/actions-runner-linux-x64-2.322.0.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;optionally run below command to verify downloaded tar file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"b13b784808359f31bc79b08a191f5f83757852957dd8fe3dbfcc38202ccf5768  actions-runner-linux-x64-2.322.0.tar.gz"&lt;/span&gt; | shasum &lt;span class="nt"&gt;-a&lt;/span&gt; 256 &lt;span class="nt"&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://community.ops.io/images/80izhzXtZiUmnD7MaP1frS0gWUQKa-NlFysxSkhwif8/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzV5dnYy/dDllcDNkMmwxZzlt/amRwLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/80izhzXtZiUmnD7MaP1frS0gWUQKa-NlFysxSkhwif8/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzV5dnYy/dDllcDNkMmwxZzlt/amRwLnBuZw" alt="Image description" width="800" height="22"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next run below command to extact all actions runner tar.gz file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;tar &lt;/span&gt;xzf ./actions-runner-linux-x64-2.322.0.tar.gz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://community.ops.io/images/GaxtXsze7bwPDJCYiDJC_SoKnRulhIFHOVme69BS0I4/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3VuOXp5/NXZiM2ZvZ3F0NWJl/NGR5LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/GaxtXsze7bwPDJCYiDJC_SoKnRulhIFHOVme69BS0I4/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3VuOXp5/NXZiM2ZvZ3F0NWJl/NGR5LnBuZw" alt="Image description" width="800" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3: Configure the Runner&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;After downloading run below command to configure GitHub action runner.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./config.sh &lt;span class="nt"&gt;--url&lt;/span&gt; https://github.com/codehirise/github-actions-private-runner-demo &lt;span class="nt"&gt;--token&lt;/span&gt; YOUR_TOKEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Replace YOUR_TOKEN with the token displayed in GitHub add new self hosted action runner page.
&lt;/h4&gt;

&lt;p&gt;Here you will be prompled for some input like runner name and lables. You can enter them as you see fit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/oKLIkeybI6hdV_ggc4J5Y4hR9-tjiCIQVJe3hCEvLo8/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3U1d2l1/dmFmeDNqcThhODdj/aDdxLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/oKLIkeybI6hdV_ggc4J5Y4hR9-tjiCIQVJe3hCEvLo8/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3U1d2l1/dmFmeDNqcThhODdj/aDdxLnBuZw" alt="Image description" width="800" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will create some additional files like &lt;code&gt;svc.sh&lt;/code&gt; which we will be using to configure action runner as a systemd service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/XYaYfNPTZRi3Yv8eQvrVuy2wvR8aH4h1cAgJhl9ByBg/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3hwbzAx/emFyNjhpdzl2eGdn/N3d2LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/XYaYfNPTZRi3Yv8eQvrVuy2wvR8aH4h1cAgJhl9ByBg/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL3hwbzAx/emFyNjhpdzl2eGdn/N3d2LnBuZw" alt="Image description" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before that make sure to change the ownership of the directory to our Linux service user which is &lt;code&gt;gh-action-runner-user&lt;/code&gt;. &lt;br&gt;
Run below command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chown &lt;/span&gt;gh-action-runner-user:gh-action-runner-user /opt/gh-runner/ &lt;span class="nt"&gt;-R&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://community.ops.io/images/SAYI1WDUNcrJS2Qj5kqSRCLMDqkCJAC4J1B7m27SB3s/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzF6cXo5/cjRpdXo1dzJuNTR3/Y21yLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/SAYI1WDUNcrJS2Qj5kqSRCLMDqkCJAC4J1B7m27SB3s/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzF6cXo5/cjRpdXo1dzJuNTR3/Y21yLnBuZw" alt="Image description" width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Configure the Runner Systemd Service&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Next run below command to install systemd service for github action runner. This will install action runner as a systemd service and set user as &lt;code&gt;gh-action-runner-user&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./svc.sh &lt;span class="nb"&gt;install &lt;/span&gt;gh-action-runner-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next you can run status command to check status&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./svc.sh status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and run start command to start github action runner&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; ./svc.sh start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://community.ops.io/images/nkHrNmhZUmCog0pO-44y4sE_NRLdnj4f72LsIDD9J0g/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzJ4ZWZi/MnY0cmF2YWs1cng0/cmZ4LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/nkHrNmhZUmCog0pO-44y4sE_NRLdnj4f72LsIDD9J0g/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzJ4ZWZi/MnY0cmF2YWs1cng0/cmZ4LnBuZw" alt="Image description" width="800" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;to check github action run related logs simply run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;journalctl &lt;span class="nt"&gt;-f&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; actions.runner.codehirise-github-actions-private-runner-demo.gh-private-runner-demo.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Note that actions.runner.codehirise-github-actions-private-runner-demo.gh-private-runner-demo.service is the service name which is displayed when running  sudo ./svc.sh status command.
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/xnLz5Xf8Bq3Xs90PrhPGdj55gmdxZBZjwVMzPxN8P0k/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzMzc2tn/OXJxMnJrNG8wMnAy/cHExLnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/xnLz5Xf8Bq3Xs90PrhPGdj55gmdxZBZjwVMzPxN8P0k/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzMzc2tn/OXJxMnJrNG8wMnAy/cHExLnBuZw" alt="Image description" width="800" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will show connected to GitHub which indicate that we have successfully setup our GitHub action runner as a service.&lt;br&gt;
if you now visit runners page you can see our brand new github action self hosted runner is ready and waiting to pickup jobs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/EtZA9DU96HITWTlx8IWTfk3XjudC_CegFujWcwzf7Jc/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL214Nmp6/aHoxcXMzeXA1MjV4/emt1LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/EtZA9DU96HITWTlx8IWTfk3XjudC_CegFujWcwzf7Jc/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL214Nmp6/aHoxcXMzeXA1MjV4/emt1LnBuZw" alt="Image description" width="800" height="316"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Action runner systemd service comes enabled by default so it will automatically start after a system reboot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/KILgFrQrNUJNIJs4iTciLPfmY9_7Kcgu-wy7ScoS7Cw/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2R5aW9i/amxwdmRlMDhsbWlz/N2x0LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/KILgFrQrNUJNIJs4iTciLPfmY9_7Kcgu-wy7ScoS7Cw/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzL2R5aW9i/amxwdmRlMDhsbWlz/N2x0LnBuZw" alt="Image description" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Step 5: Using selfhosted runner in Github action workflow&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To use this runner in workflow , set &lt;code&gt;runs-on&lt;/code&gt; in your github actions workflow file to &lt;code&gt;selfhosted&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example workflow file below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This is a basic workflow to help you get started with Actions&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CI&lt;/span&gt;

&lt;span class="c1"&gt;# Controls when the workflow will run&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;# Triggers the workflow on push or pull request events but only for the "main" branch&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;main"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;main"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;

  &lt;span class="c1"&gt;# Allows you to run this workflow manually from the Actions tab&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="c1"&gt;# A workflow run is made up of one or more jobs that can run sequentially or in parallel&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;# This workflow contains a single job called "build"&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# The type of runner that the job will run on&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;self-hosted&lt;/span&gt;

    &lt;span class="c1"&gt;# Steps represent a sequence of tasks that will be executed as part of the job&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="c1"&gt;# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="c1"&gt;# Runs a single command using the runners shell&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run a one-line script&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;echo Hello, world!&lt;/span&gt;

      &lt;span class="c1"&gt;# Runs a set of commands using the runners shell&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run a multi-line script&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo Add other actions to build,&lt;/span&gt;
          &lt;span class="s"&gt;echo test, and deploy your project.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in action workflow we can see job ran on the runner we setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/BXP302lWWeKyNh_3nXtzvlBzpPR5wASvUjDi4_3HPrc/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzV4dG93/NzNzazByZHRmZXR6/MWd0LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/BXP302lWWeKyNh_3nXtzvlBzpPR5wASvUjDi4_3HPrc/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzV4dG93/NzNzazByZHRmZXR6/MWd0LnBuZw" alt="Image description" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our runner logs we can see job completed successfully &lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.ops.io/images/v3LAOOzhxUL2N0qVqg_VFPyW_gV_Ye0iQtjAao2tI_w/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzU0dWw5/ZG8zMng5aXNycmw5/eTc0LnBuZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.ops.io/images/v3LAOOzhxUL2N0qVqg_VFPyW_gV_Ye0iQtjAao2tI_w/rt:fit/w:800/g:sm/q:0/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkub3BzLmlv/L3JlbW90ZWltYWdl/cy91cGxvYWRzL2Fy/dGljbGVzLzU0dWw5/ZG8zMng5aXNycmw5/eTc0LnBuZw" alt="Image description" width="800" height="123"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Self-hosted GitHub runners on Ubuntu VMs put you in control—locking down sensitive workflows and integrating seamlessly with private infrastructure. With this setup, your pipelines stay fast, secure, and entirely within your environment. Will this be your team’s next step toward DevOps adventure? 🚀&lt;/p&gt;

&lt;h3&gt;
  
  
  Thank you for reading.
&lt;/h3&gt;

</description>
      <category>devops</category>
      <category>linux</category>
      <category>github</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
