Installing from the image
The image is a complete VM ready to start: Debian 13, PostgreSQL, Kanadr with its telephony engine, nginx in front of the portal, text-to-speech (Piper, French and English voices), plus keepalived and rsync for active/passive, idle until configured. It is the way to install Kanadr on a hypervisor (Proxmox, VMware, KVM, OpenStack); on a VPS, whose provider does not accept an imported image, see Installing on a VPS. Installing from the Debian package, on an already equipped machine, is available on request.
| File | For |
|---|---|
proxmox.sh | Proxmox: installation in one command (below). |
kanadr-<version>.qcow2 | KVM, Proxmox, OpenStack. |
kanadr-<version>.ova | VMware, VirtualBox (2 vCPUs, 4 GB, VMXNET3 NIC). |
kanadr-<version>.sha256 | Checksums of both: check them before importing. |
The Downloads page gives the files of the latest version, with their size, date and checksums, plus the commands to copy.
12 GB disk, grown on first boot to the size given to the VM. Add a second, empty disk for call recordings: see Recordings volume.
The image contains the guest agents of Proxmox (QEMU) and VMware (open-vm-tools): each one only starts under its own hypervisor, which then shows the VM’s IP address.
Proxmox, in one command
In the Proxmox host shell, as root (the node’s Shell in the web interface, or SSH), with the download token given by the vendor (see Access to the repository):
JETON='paste your token here'
curl -fsSL -u "jeton:$JETON" https://apt.kanadr.com/images/proxmox.sh | bash -s -- --id 120 \
--nom pbx.operator.example --ip 192.0.2.50/24 --passerelle 192.0.2.254 \
--cle "ssh-ed25519 AAAA… admin@operator" --jeton "$JETON"
The token downloads the image, then the script installs it in the VM for updates.
The script downloads the latest image, checks its SHA-256 checksum, creates the VM (guest agent
enabled), imports the disk, adds the recordings disk, sets up cloud-init (debian account, SSH
key, address) and starts the VM. It then waits for the first boot to finish (one to three
minutes) and shows the setup link, under the machine name and under its IP address, as
well as the SSH command:
VM 120 prête : pbx.operator.example (192.0.2.50)
Mise en route de Kanadr / Kanadr setup
Ouvrir / Open : https://pbx.operator.example/mise-en-route#…
…
Ou par l'adresse IP / Or by IP address :
https://192.0.2.50/mise-en-route#…
Se connecter en SSH : ssh debian@192.0.2.50
| Option | For |
|---|---|
--id | A free VMID, 100 or more. |
--nom | Fully qualified machine name: it gives the portal address and the default domain. |
--ip, --passerelle | Fixed address (with its prefix) and gateway; or --dhcp. |
--dns | DNS servers ("192.0.2.1 192.0.2.2"); by default, the host’s. |
--cle | Public SSH key of the administration account, as text; or --fichier-cle (an authorized_keys file). |
--utilisateur | Administration account, with sudo (debian by default). |
--stockage | Disk storage (local-lvm by default). |
--pont | Network bridge (vmbr0 by default). |
--disque | System disk size (32G by default, at least 12 GB). |
--enregistrements | Recordings disk size (50G by default; 0: none, a file on the system disk replaces it). |
--coeurs, --memoire | vCPUs and memory in MB (2 and 4096 by default). |
--version | A specific image version (the latest by default). |
--essai | Shows the qm commands without running anything. |
It stops at once, before creating anything, if the VMID is taken, if the storage or the bridge
does not exist, if space is short or if the image checksum is wrong. A VM created but not yet
started is deleted on error; a started VM is left, and the message says how to look at it or
delete it. To read the script before running it:
curl -fsSLO -u "jeton:$JETON" https://apt.kanadr.com/images/proxmox.sh, then
bash proxmox.sh --id 120 … --jeton "$JETON".
Proxmox, by hand
Download the image: kanadr.sha256 gives the name of the latest version and its checksums.
JETON='paste your token here'
curl -fsSLO -u "jeton:$JETON" https://apt.kanadr.com/images/kanadr.sha256
nom=$(awk '/qcow2$/ {print $2}' kanadr.sha256) # or /ova$/ for VMware
curl -fLO -u "jeton:$JETON" "https://apt.kanadr.com/images/$nom"
sha256sum -c --ignore-missing kanadr.sha256
From a browser, the download asks for a user name, jeton, and a password, the token itself. A
VM created by hand does not know your token: once it has started, install it for updates,
sudo kanadr depot jeton poser (see
Access to the repository).
Then, from the host shell (here VM 120, storage local-lvm):
echo "ssh-ed25519 AAAA… admin@operator" > key.pub
qm create 120 --name pbx.operator.example --cores 2 --memory 4096 \
--net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-single --ostype l26 --agent enabled=1
qm disk import 120 "$nom" local-lvm
qm set 120 --scsi0 local-lvm:vm-120-disk-0,discard=on --boot order=scsi0 \
--scsi1 local-lvm:50 --ide2 local-lvm:cloudinit \
--ciuser debian --sshkeys key.pub --ciupgrade 0 \
--ipconfig0 ip=192.0.2.50/24,gw=192.0.2.254 --nameserver 192.0.2.1
qm disk resize 120 scsi0 32G
qm start 120
--sshkeysexpects a file present on the host:key.pub, your public SSH key. It opens thedebianaccount (--ciuser), an administrator with sudo.--ipconfig0: a fixed address, which you will know without searching;ip=dhcpworks too (the address obtained is shown in the VM’s Summary).--ciupgrade 0: no package upgrade by cloud-init on first boot.scsi1is the recordings disk.- The VM name becomes the machine name and the portal address: give the full name, or use your
own cloud-init configuration (
--cicustom, example further down).
The same settings can be made in the web interface: import the disk as above, then the Hardware tab (Cloud-Init drive, second disk), the Cloud-Init tab (user, SSH key, IP address), and Options › QEMU Guest Agent.
VMware
Import the OVA (Deploy OVF Template). The wizard asks for the VM properties, read on first boot:
- Nom de la machine (machine name): fully qualified name (
pbx.operator.example). It gives the portal address and the default domain. - Clé SSH publique (public SSH key): authorized for the
debianaccount (administrator, sudo). - Adresse IP fixe (
192.0.2.50/24), Passerelle (gateway,192.0.2.254) and Serveurs DNS (192.0.2.1, 192.0.2.2): left empty, the address comes from DHCP. An invalid value is reported on the console and leaves DHCP. - Configuration cloud-init (optional): a
#cloud-configdocument in base64.
VMware then shows the VM’s address (open-vm-tools is in the image).
Other hypervisors
The image has no open account and no password: access is granted on first boot, through cloud-init, as for Debian or Ubuntu images of this kind. Under KVM or OpenStack, use the hypervisor’s cloud-init fields (user, SSH key, name), or a NoCloud source. Example:
#cloud-config
fqdn: pbx.operator.example
prefer_fqdn_over_hostname: true
users:
- name: admin
sudo: "ALL=(ALL) NOPASSWD:ALL"
ssh_authorized_keys:
- ssh-ed25519 AAAA… admin@operator
Without a key (VirtualBox, OVA imported without filling in the key), nobody can log in: import again with the key, or attach a NoCloud CD.
First boot
Once, after cloud-init, the VM:
- generates its own secrets: passwords of the database, the telephony engine and the CDRs, self-signed certificate, first secrets encryption key;
- creates the database, with the machine name as the default domain;
- sets up the telephony engine: local control only (
sudo kanadr consolewithout a password), CDRs to Kanadr, French voice, 100 new sessions per second, SIP over TLS on 5061 with the self-signed certificate; - fills in the Kanadr settings (
/etc/kanadr/kanadr.env), withhttps://<machine name>as the public address; - puts call recordings on their own volume: the second disk if there is one, otherwise a 50 GB file (Recordings volume);
- starts PostgreSQL, the telephony engine (
kanadr-moteur), Kanadr and nginx; - compares its IPv4 address with the one seen from the Internet: if they differ, the console
and SSH login show “NAT détecté : adresse publique …” (NAT detected) and the command to run,
sudo kanadr adresse-publique …, never applied automatically (see Prerequisites). Without Internet access, nothing is shown.
No secret is shared by two VMs made from the same image: SSH keys, machine ID and cloud-init state are erased when the image is built.
Allow one to three minutes. Meanwhile, the console and the SSH login show “Premier démarrage en cours / first boot in progress”; the setup link replaces it as soon as it is ready.
Connecting to the VM
The setup link (single use, 24 h) is shown:
- at the end of the Proxmox script;
- at SSH login:
ssh debian@192.0.2.50(or the account given to cloud-init); - on the hypervisor console, above the login prompt, with a QR code to open it on a phone if the console is large enough (on 80 × 25, the text only). No account has a password: the console is only for reading it.
It is given under the machine name and under each IP address of the VM
(https://192.0.2.50/mise-en-route#…): the latter works even if your computer does not resolve
the name yet. The certificate is self-signed until the wizard’s Certificate step: the browser
warns, accept to continue. Opened by IP address, the portal offers the second factor by code
(authenticator app); passkeys need the machine name and can be added later, from My
account.
From the VM:
sudo kanadr mise-en-route: a new link;sudo kanadr-message-mise-en-route --attendre: during the first boot, waits for the link and shows it.
Next
- Create the operator and its first administrator: open the setup link (see Connecting
to the VM), then follow the wizard (Quick start).
For automation:
sudo kanadr initialiser. - Replace the self-signed certificate of nginx (
/etc/nginx/sites-available/kanadr) and of SIP over TLS: Let’s Encrypt in one click in the wizard (Certificate step), or yours, whichsudo kanadr-certificat-sip chain.pem key.pemgives to SIP. - Fix the public address (
KANADR_URL_PUBLIQUEin/etc/kanadr/kanadr.env, thensudo systemctl restart kanadr) if the portal is not served under the machine name: the links in invitations and for phones use it. Behind 1:1 NAT, also set the announced address:sudo kanadr adresse-publique <public address>, thensudo systemctl restart kanadr-moteur. - Set up email in the portal (Settings, E-mails and alerts tab), before creating users.
- Check the update repository: the image declares it itself
(
/etc/apt/sources.list.d/kanadr.sources, Updates); without it, no new version is reported. If that file is missing (VM created from an older image), declare the repository as described in Updates.
Free software sources
The notices of the free software shipped with the image, their licences and where to get their
sources are on the machine: /usr/share/doc/kanadr/LOGICIELS-LIBRES, or kanadr licences.