Installing Bitrix24 on Proxmox VE on Hetzner Server from Scratch

Andy Wits Blog

Installing Bitrix24 on Proxmox VE on Hetzner Server from Scratch

Here are the steps to configure the manager of virtual machines Proxmox VE and install inside VM and CT Bitrix24, a box version.

Installing and Configuring Proxmox VE on Debian 12

  1. Install Debian 12 (Bookworm) base (from rescue mode) using the Hetzner community guide.
  2. Install the virtual machine manager following the same guide.
  3. Install additional packages from the Proxmox official manual:
    apt install open-iscsi chrony
    
  4. Remove the Debian kernel:
    apt remove linux-image-amd64 'linux-image-6.1*'
    
  5. Remove os-prober:
    apt remove os-prober
    
  6. Configure SSH: set up public key authentication for root ("PermitRootLogin prohibit-password" in /etc/ssh/sshd_config), change the SSH port, and disable unneeded features:
    AllowAgentForwarding no
    AllowTcpForwarding no
    X11Forwarding no
    
  7. Install and configure fail2ban for sshd and Proxmox (instructions).
  8. Configure SSL for the Proxmox web interface (guide).
  9. Enable 2FA.
  10. Purchase an extra IP address for the domain (e.g., bitrix.example.com) and request a dedicated MAC address from Hetzner.
  11. Configure Proxmox VE networking (Bridged Setup):
auto enp4s0
iface enp4s0 inet manual

auto vmbr0
iface vmbr0 inet static
    address A.B.C.D/26
    gateway A.B.C.E
    bridge-ports enp4s0
    bridge-stp off
    bridge-fd 0
    up route add -net A.B.C.F netmask 255.255.255.192 gw A.B.C.E dev vmbr0

Setting Up Bitrix24 VM in KVM (Proxmox VE)

  1. Download VMBitrix 9.0.0 for VMware:
    wget https://repo.bitrix.info/vm/VMBitrix9.0-0-CentOSStream9-VMWare.zip
    
  2. Create and configure a new VM via the Proxmox UI. Enable bridge mode and assign IP/MAC.
  3. Extract and import the disk to qcow2 format:
    qm importdisk 100 VMBitrix9.0-0-CentOSStream9-VMWare-disk1.vmdk local -format qcow2
    
  4. Set up the Bitrix environment using the official documentation.
  5. To restore from backup:
    cd /home/bitrix/www/
    wget https://www.1c-bitrix.ru/download/files/scripts/restore.php
    chown bitrix: restore.php
    
  6. Resize the VM disk and move the swap partition:
    swapoff -a
    parted /dev/sda
    xfs_growfs /
    mkswap /dev/sda2
    blkid -s UUID -o value /dev/sda2
    mcedit /etc/fstab
    swapon -a
    
  7. Fix GRUB errors caused by the resume=UUID=... parameter:
    grubby --info=ALL
    grubby --remove-args="resume=UUID=..." --args="resume=UUID=..." --update-kernel /boot/vmlinuz-...
    
  8. (Optional) Configure kernel auto-updates carefully.

Setting Up Bitrix24 in an LXC Container

  1. CentOS does not provide official LXC containers; use pveam to find available templates:
    pveam update
    pveam available | grep -i centos
    pveam download local centos-9-stream-default_20221109_amd64.tar.xz
    
  2. Deploy the container and manage it with pct:
    pct unmount 101
    
  3. Optionally install SSH:
    dnf install openssh-server
    
  4. Change the SSH port in /etc/ssh/sshd_config and restart SSH:
    systemctl status sshd
    
  5. Install useful packages:
    dnf install nano mc wget screen
    
  6. Install the Bitrix environment via the setup script.
  7. If installation fails due to missing Perl packages, re-run the script:
    ./bitrix-env-9.sh
    
  8. Download and use the backup restoration script:
    su bitrix -l
    cd /home/bitrix/www/
    wget https://www.1c-bitrix.ru/download/files/scripts/restore.php
    
  9. Transfer backups from the old server via Midnight Commander:
    mc . sh://[email protected]/home/bitrix/www/bitrix/backup
    
  10. Check and apply Bitrix updates, verify server timezone:
    timedatectl set-timezone Asia/Tokyo
    
  11. Configure email notifications in /home/bitrix/.msmtprc.

Useful Links

Published on Oct 14 2024 at 9:30 am
Time to read 3 minute(s)
Categories
  • System Administration

Contact me on