Silent Kapsul Agent Installation on Linux

Automated installation guide for the Kapsul agent on Linux distributions

The Kapsul agent can be installed automatically on Linux servers, facilitating large-scale deployment via orchestration tools like Ansible, Puppet, or Chef.

Supported Distributions

  • Debian/Ubuntu: DEB package
  • RHEL/CentOS/Rocky/Alma: RPM package
  • Amazon Linux: RPM package

Installation on Debian/Ubuntu

Package Installation

# Download the package
wget https://app.kabeen.io/download/kapsul.deb
 
# Install the package
sudo dpkg --install kapsul.deb
 
# Install missing dependencies if necessary
sudo apt-get install -f

API Key Configuration

# Configure API key via debconf
sudo debconf-set-selections <<< "kapsul kapsul/api-key string YOUR_API_KEY"
 
# Or reconfigure the package
sudo dpkg-reconfigure -f noninteractive kapsul

Start the Service

sudo systemctl enable kapsul
sudo systemctl start kapsul

Installation on RHEL/CentOS

Package Installation

# Download the package
wget https://app.kabeen.io/download/kapsul.rpm
 
# Install the package
sudo rpm -ivh kapsul.rpm

API Key Configuration

Edit the configuration file:

sudo nano /etc/kapsul/application.conf

Add or modify the line:

kbine.apiKey = "YOUR_API_KEY"

Start the Service

sudo systemctl enable kapsul
sudo systemctl start kapsul

Automated Installation Script

Here's a complete script to automate installation:

#!/bin/bash
 
API_KEY="${1:-}"
 
if [ -z "$API_KEY" ]; then
    echo "Usage: $0 <API_KEY>"
    exit 1
fi
 
# Distribution detection
if [ -f /etc/debian_version ]; then
    wget -q https://app.kabeen.io/download/kapsul.deb -O /tmp/kapsul.deb
    dpkg -i /tmp/kapsul.deb || apt-get install -f -y
    echo "kbine.apiKey = \"$API_KEY\"" >> /etc/kapsul/application.conf
elif [ -f /etc/redhat-release ]; then
    wget -q https://app.kabeen.io/download/kapsul.rpm -O /tmp/kapsul.rpm
    rpm -ivh /tmp/kapsul.rpm
    echo "kbine.apiKey = \"$API_KEY\"" >> /etc/kapsul/application.conf
else
    echo "Unsupported distribution"
    exit 1
fi
 
systemctl enable kapsul
systemctl start kapsul
 
echo "Installation complete. Checking service..."
systemctl status kapsul

Verify Installation

# Check service status
sudo systemctl status kapsul
 
# Check logs
sudo journalctl -u kapsul -f
 
# Check connectivity
curl -I https://api.kabeen.io/health

Troubleshooting

Service doesn't start

  1. Check logs: journalctl -u kapsul -n 50
  2. Check configuration: cat /etc/kapsul/application.conf
  3. Check permissions: service must run as root

Connection error

  1. Check connectivity: curl https://api.kabeen.io
  2. Check proxy if applicable
  3. Check firewall: outbound port 443