Koha Testing Docker on Windows WSL: Common Setup Problems and Fixes
说明与用途
在 Windows WSL 上成功配置 Koha Testing Docker,修复了 .env 中的 CRLF 行结尾,重新映射端口为 8081/8082,并逐层诊断容器、Apache 和数据库。
问题
Setting up Koha Testing Docker (KTD) on Windows with WSL and Docker Desktop failed due to Docker binary path misread, port conflicts, and browser ERR_EMPTY_RESPONSE errors.
结果
After correcting .env line endings, remapping ports, and systematically diagnosing each layer, the Koha environment ran correctly on Windows WSL, with both staff and OPAC interfaces accessible.
工作流
- Ensure .env uses Unix line endings and correct DOCKER_BINARY path
- Run
ktd pullto download images - Identify port conflicts with
netstat -ano | findstr :8080andGet-Process - Modify compose/local_ports.yml to map 8081 and 8082
- Run
ktd up -dto start containers - Verify containers with
docker ps - Check Apache service inside container with
docker exec -it kohadev-koha-1 service apache2 status - Inspect Apache virtual hosts with
docker exec -it kohadev-koha-1 apache2ctl -S - Confirm listening ports with
docker exec -it kohadev-koha-1 ss -lntp - Test HTTP responses inside container with
docker exec -it kohadev-koha-1 curl -I http://localhost:8081and...8082 - Verify Koha instance with
docker exec -it kohadev-koha-1 koha-list - Check MariaDB databases and tables inside container
- Test connectivity from Windows PowerShell using
curl.exe -I http://localhost:8081andhttp://localhost:8082 - Confirm hostnames resolve and return 200 OK
证据
The .env file contained Windows-style CRLF line endings, causing KTD to misread DOCKER_BINARY
Port 8080 was already in use by TNSLSNR, so port mapping was changed to 8081 and 8082
- 记录日期: 2026-09-15T13:24:10.200Z