Run 3CX Phone System in Docker using official Debian packages.
Disclaimer: 3CX does not officially support Docker. This is a community project. Use at your own risk.
- Debian 12 (Bookworm) base with systemd
- Automatic installation on first boot
- Auto-updates on container restart
- Persistent data via host volumes
- Web configuration tool auto-starts
- Docker 20.10+
- Linux host with cgroups v2
- ~2GB RAM minimum
- ~10GB disk space
git clone https://github.com/YOUR_USERNAME/docker-3cx.git
cd docker-3cx
make runThen open http://localhost:5015 to complete the 3CX setup wizard.
make help # Show all commands
make run # Build and run (first time)
make logs # View logs
make shell # Open container shell
make status # Check status
make stop # Stop container
make start # Start container
make update # Update 3CX packages
make reset # Full reset (deletes data!)If you prefer not to use make:
./run.sh # Build and start container| Port | Protocol | Description |
|---|---|---|
| 5015 | TCP | Web Config / Management |
| 5000-5001 | TCP | HTTPS |
| 5060 | UDP/TCP | SIP |
| 5090 | UDP/TCP | Tunnel |
| 9000-9500 | UDP | RTP Media |
All data stored in ./data/:
data/
├── 3cxpbx/ # Application data
├── config/ # Configuration
├── postgresql/ # Database
├── logs/ # Logs
└── backups/ # Backups
| Variable | Default | Description |
|---|---|---|
TZ |
America/New_York |
Timezone |
For better VoIP performance, edit run.sh and replace port mappings with:
--network host \Updates are checked automatically on container restart. Manual update:
make update
# or
docker exec 3cx-pbx /usr/local/bin/3cx-update.shdocker exec 3cx-pbx /usr/sbin/3CXLaunchWebConfigTool
docker exec 3cx-pbx ss -tlnp | grep 5015docker exec 3cx-pbx cat /var/log/3cx-install.log
docker exec 3cx-pbx journalctl -xemake reset
# or
docker stop 3cx-pbx && docker rm 3cx-pbx
rm -rf ./data/*
./run.sh- Container starts with systemd as PID 1
- On first boot, systemd service installs 3CX from official repos
- Web config tool starts automatically
- User completes setup via web browser
- On subsequent boots, checks for updates
docker-3cx/
├── Dockerfile # Image definition
├── docker-compose.yml # Alternative launcher
├── run.sh # Main launcher (recommended)
├── 3cx-install.sh # Installation script
├── Makefile # Build commands
├── data/ # Persistent data (gitignored)
├── LICENSE
└── README.md
MIT License - See LICENSE
Note: 3CX is a trademark of 3CX Ltd. This project is not affiliated with 3CX.
Issues and PRs welcome. Please test changes before submitting.