Tuesday, September 22, 2026

How to Integrate HashiCorp Vault with Jenkins Pipeline on Ubuntu 24.04

How to Integrate HashiCorp Vault with Jenkins Pipeline on Ubuntu 24.04 ?

What is HashiCorp Vault?

HashiCorp Vault is a secrets-management platform used to securely store and control access to sensitive information such as:

  • Passwords
  • API tokens
  • Database credentials
  • Cloud credentials
  • GitHub tokens
  • Nexus/Artifactory credentials
  • Deployment credentials

Instead of storing application secrets directly inside Jenkins, Jenkins can authenticate to Vault and retrieve only the secrets required by a pipeline.

Prerequisites

  • Jenkins up and running 
  • New EC2 instance for Vault with port no 22 and 8200 opened

Install HashiCorp Vault on Ubuntu 24.04

Install required packages:

sudo apt update
sudo apt install wget gpg -y

Add the HashiCorp GPG key:

wget -O - https://apt.releases.hashicorp.com/gpg | \
sudo gpg --dearmor \
-o /usr/share/keyrings/hashicorp-archive-keyring.gpg

Add the HashiCorp repository:

echo "deb [arch=$(dpkg --print-architecture) \ signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \ https://apt.releases.hashicorp.com \ $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release) main" | \ sudo tee /etc/apt/sources.list.d/hashicorp.list
Install Vault

sudo
apt update sudo apt install vault -y

Verify Vault version
vault version

Start Vault for the Lab

vault server -dev -dev-listen-address="0.0.0.0:8200"

You'll see something similar to:
Root Token: hvs.xxxxxxxxxxxxx
Save the Root Token.

Note:
Vault development mode should be used only for learning/testing. Do not use dev mode in production.

No comments:

Post a Comment

How to Integrate HashiCorp Vault with Jenkins Pipeline on Ubuntu 24.04

How to Integrate HashiCorp Vault with Jenkins Pipeline on Ubuntu 24.04 ? What is HashiCorp Vault? HashiCorp Vault is a secrets-management p...