Skip to content

Install the Server Agent on a running server

Last updated on

This documentation describes how to install the STACKIT Server Agent manually on an already existing and running server with scripts.

If you prefer to install the STACKIT Server Agent with the STACKIT Portal, refer to this documentation: Install the STACKIT Server Agent with Portal.

If you prefer to install the STACKIT Server Agent with the STACKIT IaaS API, STACKIT CLI or STACKIT Terraform, refer to this documentation: Install the STACKIT Server Agent with API.

Installing the STACKIT Server Agent on an running server (Linux)

Section titled “Installing the STACKIT Server Agent on an running server (Linux)”
  1. Logon to your server remotely. Use a method that includes a clipboard functionality, e. g. Remote Desktop Connection.

  2. Open a shell.

  3. Optional: Verify the signature
    You can verify the GPG signature of the STACKIT Server Agent package with the following scripts:

    • Linux, RPM-based (Fedora, RedHat)
      Source file: RPM (Fedora/RedHat based)
    #!/bin/bash
    #Download GPG public key
    curl https://stackit-server-agent.object.storage.[region].onstackit.cloud/stackit-server-agent.gpg -o /tmp/stackit-server-agent.gpg
    ### Install dependencies
    yum install gnupg -y
    ### Import GPG Public key
    gpg --import /tmp/stackit-server-agent.gpg
    ### Download STACKIT Server Agent
    curl http://169.254.169.254/stackit/v1/server-agent/amd64/rpm -o /tmp/stackit-server-agent.rpm
    ### Download the package signature file
    curl https://stackit-server-agent.object.storage.[region].onstackit.cloud/stackit-server-agent.rpm.sig -o /tmp/stackit-server-agent.rpm.sig
    if gpg --verify /tmp/stackit-server-agent.rpm.sig /tmp/stackit-server-agent.rpm
    then
    echo "The STACKIT Server Agent is verified successfully"
    else
    echo "The STACKIT Server Agent is not verified successfully"
    rm -rf /tmp/stackit-server-agent.gpg /tmp/stackit-server-agent.rpm.sig /tmp/stackit-server-agent.rpm
    exit 1
    fi
    rm -rf /tmp/stackit-server-agent.gpg /tmp/stackit-server-agent.rpm.sig
    • Linux, DEB-based (Debian, Ubuntu)
      Source file: DEB (Debian based)
    #!/bin/bash
    #Download GPG public key
    curl https://stackit-server-agent.object.storage.[region].onstackit.cloud/stackit-server-agent.gpg -o /tmp/stackit-server-agent.gpg
    ### Install dependencies
    apt-get update && apt-get install gnupg -y
    ### Import GPG Public key
    gpg --import /tmp/stackit-server-agent.gpg
    ### Download STACKIT Server Agent
    curl http://169.254.169.254/stackit/v1/server-agent/amd64/deb -o /tmp/stackit-server-agent.deb
    ### Download the package signature file
    curl https://stackit-server-agent.object.storage.[region].onstackit.cloud/stackit-server-agent.deb.sig -o /tmp/stackit-server-agent.deb.sig
    if gpg --verify /tmp/stackit-server-agent.deb.sig /tmp/stackit-server-agent.deb
    then
    echo "The STACKIT Server Agent is verified successfully"
    else
    echo "The STACKIT Server Agent is not verified successfully"
    rm -rf /tmp/stackit-server-agent.deb /tmp/stackit-server-agent.deb.sig /tmp/stackit-server-agent.gpg
    exit 1
    fi
    rm -rf /tmp/stackit-server-agent.gpg /tmp/stackit-server-agent.deb.sig

    Once the package is successfully verified you can install it by running:
    Source file: RPM (Fedora/RedHat based)

    Terminal window
    yum localinstall /tmp/stackit-server-agent.rpm -y

    or
    Source file: DEB (Debian based)

    Terminal window
    dpkg -i /tmp/stackit-server-agent.deb
  4. Download and install the STACKIT Server Agent (without GPG verification)
    Copy and paste the script into the shell and run it:

    • Linux, RPM-based (Fedora, RedHat)
      Source file: RPM (Fedora/RedHat based)
    #!/bin/bash
    ### Download STACKIT Server Agent
    curl http://169.254.169.254/stackit/v1/server-agent/amd64/rpm -o /tmp/stackit-server-agent.rpm
    ### Install the Agent
    yum localinstall /tmp/stackit-server-agent.rpm -y
    ### Cleaning up
    rm -rf /tmp/stackit-server-agent.rpm
    • Linux, DEB-based (Debian, Ubuntu)
      Source file: DEB (Debian based)
    #!/bin/bash
    ### Download STACKIT Server Agent
    curl http://169.254.169.254/stackit/v1/server-agent/amd64/deb -o /tmp/stackit-server-agent.deb
    ### Install the Agent
    dpkg -i /tmp/stackit-server-agent.deb
    ### Cleaning up
    rm -rf /tmp/stackit-server-agent.deb
  5. If the installation was successful, check if the service is running:

    systemctl status stackit-server-agent.service

    Linux terminal output showing the status of the 'stackit-server-agent.service' as 'active (running)' with systemctl.

The STACKIT Server Agent is now fully configured and can accept commands remotely and run them locally on your system.

Installing the STACKIT Server Agent on a running server (Windows)

Section titled “Installing the STACKIT Server Agent on a running server (Windows)”
  1. Logon to your server remotely. Use a method that includes a clipboard functionality, e. g. Remote Desktop Connection.

  2. Start PowerShell ISE with elevated permissions.

  3. Copy and paste the script into the shell and run the script.
    Source file: MSI

    Terminal window
    ## Download STACKIT Server Agent
    New-Item -ItemType Directory -Path "C:\ProgramData\STACKIT\ServerAgent" -Force
    Invoke-WebRequest -Uri "http://169.254.169.254/stackit/v1/server-agent/amd64/msi" -OutFile "C:\ProgramData\STACKIT\ServerAgent\STACKITServerAgent.msi"
    ### Install the Agent
    Start-Process -FilePath "C:\Windows\System32\msiexec.exe" -ArgumentList "/i C:\ProgramData\STACKIT\ServerAgent\STACKITServerAgent.msi /quiet /l*v C:\Windows\Temp\STACKITServerAgent_install.log" -NoNewWindow -Wait
  4. After successful installation, check if the service is running. Open the PowerShell and run the following command:

    Get-Service STACKITServerAgent

    Alternatively check the status in the Service tab of the task manager:

    Windows Services list highlighting the 'STACKITServerAgent' service with a status of 'Running'.

The STACKIT Server Agent is now fully configured and can be used to run commands.