Bitrix VM Installation and Configuration
Setting up Bitrix manually on a clean server takes 3–4 hours: installing the stack, configuring PHP with required extensions, configuring MySQL with proper InnoDB parameters, setting up Nginx with mod_security, and adding NodeJS push-server. Bitrix VM is a pre-configured virtual machine image that comes with all of this already installed and configured for Bitrix.
What's Included in Bitrix VM
Bitrix VM is a CentOS-based image containing:
- Nginx + Apache (Apache for PHP via mod_php or as a backend)
- Multiple PHP versions with required extensions (GD, Imagick, Mbstring, Soap, etc.)
- MySQL/MariaDB with optimized InnoDB parameters
- Redis for sessions and caching
- NodeJS push-server
- Configured cron for Bitrix agents
- Web management interface on port 8888
Download: https://www.1c-bitrix.ru/download/vm/bitrix-vm-8.0.tar.gz — approximately 2 GB in size.
Installation on Physical Server (Non-VM)
If you cannot use the VM image, 1C-Bitrix provides an environment setup script:
# For CentOS 7/8
curl -s https://repos.1c-bitrix.ru/yum/bitrix-env.sh | bash
# or
wget -O - https://repos.1c-bitrix.ru/yum/bitrix-env.sh | bash
The script automatically:
- Adds Bitrix repositories
- Installs and configures the entire stack
- Creates a
bitrixuser - Launches the setup menu (bitrix-env menu)
After completion — interactive menu:
/root/menu.sh
# or
bx-sites
Initial Configuration Through Menu
Bitrix VM provides a console menu for environment management:
=== Bitrix VM Management Menu ===
1. Site Management
2. MySQL Configuration
3. PHP Configuration
4. Mail Configuration
5. Security Configuration
6. Backup
7. Push Server
8. Update Environment
Creating a new site:
bx-sites --add
# or through menu: item 1 → Add Site
Enter: domain name, path, PHP version, and Nginx virtual host is created along with the site directory.
MySQL Configuration After Installation
Bitrix VM comes with MySQL settings optimized for a typical site. For large catalogs, additional configuration is needed. Config: /etc/my.cnf:
[mysqld]
innodb_buffer_pool_size = 2G # 70% of available memory
innodb_buffer_pool_instances = 2
innodb_log_file_size = 512M
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 2 # Performance over reliability for 1 sec
query_cache_type = 0 # Disable query cache (deprecated, harmful)
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2
After changes:
systemctl restart mysqld
PHP Configuration
Bitrix VM supports multiple PHP versions simultaneously. Switch version for a site:
# List available versions
bx-php --list
# Switch specific site
bx-php --site example.ru --version 8.1
PHP parameters for Bitrix in /etc/php.d/:
; /etc/php.d/bitrix.ini
memory_limit = 256M
max_execution_time = 180
upload_max_filesize = 100M
post_max_size = 100M
realpath_cache_size = 4096K
realpath_cache_ttl = 600
[opcache]
opcache.memory_consumption = 192
opcache.max_accelerated_files = 32531
opcache.revalidate_freq = 60
Redis Configuration
Redis in Bitrix VM runs on port 6379 and is used for sessions and caching. Config: /etc/redis.conf:
maxmemory 512mb
maxmemory-policy allkeys-lru
save "" # Disable RDB snapshots for cache
appendonly no
Connecting Bitrix to Redis for sessions — in /etc/php.d/session.ini:
session.save_handler = redis
session.save_path = "tcp://127.0.0.1:6379?database=0"
Updating the Environment
# Update all Bitrix VM components
bx-update
# Or through menu
/root/menu.sh → item 8
Bitrix VM updates independently from the Bitrix product. Environment updates do not affect the site code.
Creating a Snapshot Before Configuration
If Bitrix VM is deployed as a virtual machine (VMware, VirtualBox, KVM):
# KVM/libvirt
virsh snapshot-create-as bitrix-vm "before-custom-config" "Snapshot before custom configuration"
This allows you to roll back if something goes wrong after configuration changes.







