<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Gitlab_runner_LXD</id>
	<title>Gitlab runner LXD - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Gitlab_runner_LXD"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Gitlab_runner_LXD&amp;action=history"/>
	<updated>2026-08-03T13:13:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Gitlab_runner_LXD&amp;diff=5732&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;https://docs.gitlab.com/runner/executors/custom_examples/lxd/  You need to **install the `gitlab-runner` apt package first**.  Installing the package creates the `gitlab-runne...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Gitlab_runner_LXD&amp;diff=5732&amp;oldid=prev"/>
		<updated>2026-08-01T20:10:13Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;https://docs.gitlab.com/runner/executors/custom_examples/lxd/  You need to **install the `gitlab-runner` apt package first**.  Installing the package creates the `gitlab-runne...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;https://docs.gitlab.com/runner/executors/custom_examples/lxd/&lt;br /&gt;
&lt;br /&gt;
You need to **install the `gitlab-runner` apt package first**.&lt;br /&gt;
&lt;br /&gt;
Installing the package creates the `gitlab-runner` system user and the `/etc/gitlab-runner/` directory structure where `config.toml` lives.&lt;br /&gt;
&lt;br /&gt;
Here is the step-by-step order of operations to get everything set up correctly:&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
## Step 1: Install the GitLab Runner Package&lt;br /&gt;
&lt;br /&gt;
Run these commands on your host machine to add GitLab's official repository and install the runner:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
# 1. Download and run the official GitLab repository setup script&lt;br /&gt;
curl -L &amp;quot;https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh&amp;quot; | sudo bash&lt;br /&gt;
&lt;br /&gt;
# 2. Install the gitlab-runner package&lt;br /&gt;
sudo apt-get install gitlab-runner&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
## Step 2: Create the LXD Executor Scripts&lt;br /&gt;
&lt;br /&gt;
Next, create your wrapper scripts for the custom executor (e.g., in `/opt/gitlab-runner/`).&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
# Create directory for custom executor scripts&lt;br /&gt;
sudo mkdir -p /opt/gitlab-runner&lt;br /&gt;
&lt;br /&gt;
# Create the prepare, run, and cleanup scripts&lt;br /&gt;
sudo touch /opt/gitlab-runner/lxd-prepare.sh&lt;br /&gt;
sudo touch /opt/gitlab-runner/lxd-run.sh&lt;br /&gt;
sudo touch /opt/gitlab-runner/lxd-cleanup.sh&lt;br /&gt;
&lt;br /&gt;
# Make them executable&lt;br /&gt;
sudo chmod +x /opt/gitlab-runner/lxd-*.sh&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
*(Paste the script contents into these files and ensure the LXD TLS certificate generation step you performed earlier is configured under the `gitlab-runner` system user's home directory so it can authenticate against LXD).*&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
## Step 3: Register and Configure `config.toml`&lt;br /&gt;
&lt;br /&gt;
Finally, register the runner with your GitLab instance, which will automatically generate or update `/etc/gitlab-runner/config.toml`.&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
# Register the runner (you'll need a registration token from GitLab UI)&lt;br /&gt;
sudo gitlab-runner register \&lt;br /&gt;
  --non-interactive \&lt;br /&gt;
  --url &amp;quot;https://gitlab.com/&amp;quot; \&lt;br /&gt;
  --token &amp;quot;YOUR_RUNNER_AUTHENTICATION_TOKEN&amp;quot; \&lt;br /&gt;
  --executor &amp;quot;custom&amp;quot; \&lt;br /&gt;
  --description &amp;quot;lxd-restricted-runner&amp;quot; \&lt;br /&gt;
  --custom-prepare-exec &amp;quot;/opt/gitlab-runner/lxd-prepare.sh&amp;quot; \&lt;br /&gt;
  --custom-run-exec &amp;quot;/opt/gitlab-runner/lxd-run.sh&amp;quot; \&lt;br /&gt;
  --custom-cleanup-exec &amp;quot;/opt/gitlab-runner/lxd-cleanup.sh&amp;quot;&lt;br /&gt;
&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
Once registered, you can edit `/etc/gitlab-runner/config.toml` directly if you need to fine-tune concurrency limits or execution parameters.&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>