Skip to content

Install cv4pve-botgram, the Telegram bot for Proxmox VE

cv4pve-botgram runs outside the cluster (on a management VM, a small server, a container) and talks only to the Proxmox VE REST API on port 8006. Nothing is installed on the nodes. The machine it runs on must reach the nodes and, on the Internet, Telegram: the bot connects out and waits for your messages, so no port is opened towards your network.

  1. Install cv4pve-botgram

    arch=$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/;s/armv7l/arm/')
    wget https://github.com/Corsinvest/cv4pve-botgram/releases/latest/download/cv4pve-botgram-linux-$arch.zip
    unzip cv4pve-botgram-linux-$arch.zip
    chmod +x cv4pve-botgram

    All files are on the latest release page.

  2. Create a Telegram bot

    Create the bot and get its token, in a minute from the Telegram app: see Telegram bot.

  3. Create an API token

    Create a Proxmox VE user and API token with the privileges for what the bot should do: see Permissions.

  4. Run cv4pve-botgram

    cv4pve-botgram --host=pve01 --api-token='bot@pve!bot=<uuid>' --token='<telegram-bot-token>' --chatsId=<chat-id>

    The bot logs in to the cluster and to Telegram, then prints who it is:

    Start listening
    Telegram
    Bot User: @your_pve_bot
    Bot UserId: @123456789
    Proxmox VE
    pve01:8006
    Press Ctrl+C to stop.

    It stays in the foreground until it is stopped.

  5. Send /help to the bot

    Open the chat with your bot in Telegram and send /help: the bot answers with the list of its commands, described in Commands.

Option What it does
--token Token of the Telegram bot, from BotFather. Required.
--chatsId Telegram chat IDs allowed to use the bot, separated by commas. See Restrict the bot to your chats.

The bot runs until it is stopped: Ctrl+C in a terminal, systemctl stop, or the Windows service manager. To keep it running after you close the terminal, see Run as a service.

Host, API token, username and password, certificates and keeping the options in a file: see Connection.

  • Commands: guests, nodes, and how a conversation with the bot works.
  • API commands: any path of the Proxmox VE API from the chat.
  • Run as a service: keep the bot running after you close the terminal.