Docker Environment for 1C-Bitrix: PHP 8.1, Xdebug, MySQL, Redis

Docker Environment for 1C-Bitrix: PHP 8.1, Xdebug, MySQL, Redis ## Problem: FTP and Production — a Dangerous Combination Developing Bitrix directly on a production server via FTP is like performing surgery on a moving vehicle. A single typo in a file takes the site down. Over the years, we've

Our competencies:

Frequently Asked Questions

Docker Environment for 1C-Bitrix: PHP 8.1, Xdebug, MySQL, Redis

Problem: FTP and Production — a Dangerous Combination

Developing Bitrix directly on a production server via FTP is like performing surgery on a moving vehicle. A single typo in a file takes the site down. Over the years, we've seen dozens of projects where such cost-cutting led to a full day of downtime. A local environment with proper configuration is the only way to develop offline, use a debugger, and test database schema changes without fear. We offer turnkey Docker environment setup: PHP 8.1, MySQL 8, Redis, Xdebug, Mailpit, and production data import. This solves the environment consistency problem and reduces new developer onboarding from two days to two hours — direct budget savings. We'll evaluate your project in one day.

Why a Local Environment Is Critical

Without a local environment, you cannot debug AJAX requests, test integrations with 1C and payment gateways, or test changes in information blocks. Any code error immediately becomes visible to users. Docker solves this: it isolates the environment and gives full control over PHP versions, extensions, and services. You get the exact same configuration as production, without the risk.

Docker vs Other Tools: Which to Choose?

Criterion Docker Vagrant OpenServer MAMP
Portability One file + VirtualBox Windows only macOS/Windows
Consistency 100% 90% (host dependent) 80% 70%
PHP 8.1+ Yes Yes Yes (since version) Yes
Xdebug Built-in Configurable Built-in Built-in
Start-up speed Seconds Minutes Seconds Seconds
Resources Lightweight Heavy Medium Medium

Docker wins on all key parameters: portability, consistency, and speed. For teams of 2–10 developers, it's the standard.

How to Configure Xdebug for Bitrix

Xdebug is a must-have for debugging. In the php container, enable:

[xdebug] xdebug.mode = debug xdebug.start_with_request = yes xdebug.client_host = host.docker.internal xdebug.client_port = 9003 xdebug.idekey = PHPSTORM [opcache] opcache.enable = 0 ; Disable OPcache for development 

In PHPStorm: Settings → PHP → Servers → add a server named bitrix-local, host localhost, configure path mappings: /path/to/project/www/var/www/html. Then you can set breakpoints and inspect the stack.

Why Docker Is the Best Choice for Bitrix Environment

Docker addresses the main pain point: consistency. One docker-compose.yml gives every developer an identical environment. No more "it works on my machine" situations. We reduced new developer onboarding from two days to two hours thanks to Docker. And with image caching, it's even faster. Docker provides isolation and reproducibility of the environment (Wikipedia)

Turnkey Setup Process

  1. Analysis — determine PHP and MySQL versions, needed extensions (gd, imagick, soap, etc.)
  2. Docker Build — write Dockerfile and docker-compose.yml
  3. Configuration — Xdebug, php.ini, nginx, database
  4. Data Import — copy DB via mysqldump, files via rsync, configure dbconn.php to use environment variables
  5. Documentation — README with commands for start, deployment, common issues
  6. Team Training — show how to use Xdebug, Mailpit, Git

What's Included in the Work

  • Docker environment (PHP 8.1, MySQL 8, Redis, Mailpit)
  • Xdebug configuration with path mappings
  • Import of a database copy and files from production
  • Configuration of dbconn.php and .env
  • Documentation (README, commands for start, cache clearing)
  • One hour of post-delivery support

Timeline and Cost

Basic environment setup takes 1 to 3 days. Cost is calculated individually — it depends on complexity (custom modules, non-standard extensions). We guarantee quality: over 10 years of experience with Bitrix, certified specialists, 50+ successful projects. Request a consultation — we'll find the optimal solution for your budget.

Typical Mistakes When Setting Up Yourself

  • Forgetting to disable OPcache — code doesn't update, hours lost.
  • Confusing paths in Xdebug — debugger fails.
  • Not syncing upload/ and DB — local environment doesn't match production.
  • Committing dbconn.php with passwords — risk of leakage.

Conclusion

A configured Docker environment for Bitrix is speed, consistency, and safety. The stack used: Docker Compose, PHP 8.1, MySQL 8, Redis, Mailpit, Xdebug. More about Docker — Wikipedia. Official Bitrix documentation — dev.1c-bitrix.ru.

Comparing PHP Versions for Bitrix

PHP Version Bitrix Support Xdebug Redis
7.4 Discontinued 3.1.6 Yes
8.0 Limited 3.2.1 Yes
8.1 Full 3.3.0 Yes
8.2 Full (recommended) 3.3.0 Yes

We recommend PHP 8.1 or 8.2 for maximum performance and compatibility.