Jenkins LXC on proxmox
In this blog post, we will go through the steps to install Jenkins in Proxmox using the TurnKey image. This method is quite simple and efficient for setting up Jenkins in a containerized environment.
Download Jenkins TurnKey Image
First, we need to download the Jenkins TurnKey image for Proxmox. Open your terminal and run the following command:
1
❯ pveam download $storage debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz
This command will download the image from the TurnKey Linux repository. You will see output indicating the progress of the download, and once it’s finished, you will have the image ready for use.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
❯ pveam download nasp debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz
downloading http://mirror.turnkeylinux.org/turnkeylinux/images/proxmox/debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz to /mnt/pve/nasp/template/cache/debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz
--2024-10-04 18:50:44-- http://mirror.turnkeylinux.org/turnkeylinux/images/proxmox/debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz
Resolving mirror.turnkeylinux.org (mirror.turnkeylinux.org)... 137.226.34.46, 131.188.12.211, 2801:82:80ff:8000::e
Connecting to mirror.turnkeylinux.org (mirror.turnkeylinux.org)|137.226.34.46|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 775492051 (740M) [application/octet-stream]
Saving to: '/mnt/pve/nasp/template/cache/debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz.tmp_dwnl.3535802'
0K ........ ........ ........ ........ 4% 2.21M 5m20s
98304K ........ ........ ........ ........ 17% 3.15M 3m45s
131072K ........ ........ ........ ........ 21% 3.85M 3m20s
262144K ........ ........ ........ ........ 38% 3.02M 2m32s
360448K ........ ........ ........ ........ 51% 3.53M 1m54s
\491520K ........ ........ ........ ........ 69% 3.90M 72s
524288K ........ ........ ........ ........ 73% 3.72M 61s
555360K ........ ........ ........ ........ 90% 3.43M 22s
720896K ........ ........ ........ ........ 99% 4.07M 1s
753664K ... 100% 4.79M=3m58s
2024-10-04 18:54:42 (3.11 MB/s) - '/mnt/pve/nasp/template/cache/debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz.tmp_dwnl.3535802' saved [775492051/775492051]
calculating checksum...OK, checksum verified
download of 'http://mirror.turnkeylinux.org/turnkeylinux/images/proxmox/debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz' to 'template/cache/debian-12-turnkey-jenkins_18.0-1_amd64.tar.gz' finished
Create a Container (CT)
Now that we have the image, we can create a container using it. Here’s how you can do it:
- Open Proxmox Web Interface: Go to your Proxmox web interface.
- Create CT: Click on “Create CT” and follow the prompts to set up your container.
- Select Template: When prompted, select the downloaded Jenkins TurnKey image as your template.
Starting the Jenkins VM
Once the container is created, boot it up. When you try to access the Jenkins UI for the first time, you will see a message like this:
Welcome to TurnKey! You need to initialize this system first before you can use it. To do that you’ll need to log into the root account via SSH. The turnkey-init initialization program should start automatically After initialization try reloading this page. This message should disappear and you’ll be able to access all services on this system normally.
Login into the container by using the ssh service and reset the credentials
Perform Security Updates
For security reasons, it is recommended to perform updates after installation. Run the following command in your terminal:
Once the security patches are installed and configured reboot the container
Access Jenkins Web UI
After rebooting, access the Jenkins web UI again by navigating to “https://<your-container-ip>”. You should see the Jenkins control panel.
Manage Jenkins Plugins
Once logged in, go to Manage Jenkins > Manage Plugins > Updates and install all latest updates for plugins.
Install Dark Theme (Optional)
If you prefer a dark theme, you can install it from the plugin manager as well.
Final Steps
After updating all plugins and installing any desired themes, restart your Jenkins container one last time.
And that’s it! You have successfully installed Jenkins on Proxmox using a TurnKey image. Enjoy automating your builds and deployments with Jenkins!
For more robust information on using Jenkins, you can refer to the official Jenkins documentation available at Jenkins Documentation