First off, my personal virtualization solution is Proxmox VE and I prefer the elegance of LCX Containers to full-blown Virtual Machines. It is for this reason that I prefer deploying most of my infrastructure as LCX containers within Proxmox. As Proxmox is based on Debian, the least-cost solution is to run as many of my containers on Debian 10 as possible to reduce overhead.
3CX is a fantastic PBX system and while I am aware of multiple open-source and free alternatives, the maturity and support within 3CX remains unmatched.
Unfortunately, 3CX wants you to use their hosting (AWS or Azure) and heavily favors this deployment. While still offering self-hosted deployment, there are no clear instructions for installing 3CX on your own Linux Install and they ship an .ISO file which includes a Debian installation.
In this tutorial, I will walk you through the installation steps to get 3CX running on your own vanilla Debian 10 installation, be-it a VM, Container or even Bare-Metal. It is tested to run as an LCX container within Proxmox and I have multiple deployments currently running.
This tutorial assumes that you are root user, however feel free to add sudo before each command if you are not.
It is important to note that 3CX does not currently support later versions of Debian, only Debian 10.
Step 1 – Get a Key
Go to the 3CX website and register an account, you will need a license key. Check out their pricing plans, however there is a free license which you can use for testing.
Once Registered, copy your license key as you will need it to finalize the installation of your 3CX Server.
Step 2 – Firewall Configuration
If your intended server is behind a firewall or a router, you will need to configure the firewall to allow the following ports:
- Ensure that “Full Cone NAT” is correctly configured on your firewall or router.
- Disable “SIP ALG” setting if it exists on your firewall or router.
- Open up the following Inbound Ports:
- TCP 5001 or 443 (HTTPS port for the webserver, note that during installation you can change these ports, so make sure that you also open any ports you manually configure during the installation)
- UDP & TCP 5060 (3CX Phone System SIP)
- TCP 5061 (3CX Phone System SecureSIP)
- UDP & TCP 5090 (3CX Tunnel Protocal Service Listener)
- UDP 9000 – 10999 (3CX Call Ports, each active call uses two ports so the number of extensions and active calls will inform exactly how many you need)
- TCP 443 (3CX Webmeeting and Android Push)
- Open up the following Outbound Ports:
- TCP 443 (Google Android Push)
- TCP 443 (Apple iOS Push)
- TCP 2195 – 2197 (Apple iOS Push)
- TCP 2528 (3CX SMTP Server – Optional)
3CX has a firewall checker in the web interface which you can use to diagnose port issues once the installation is complete.
Step 3 – Prepare your Debian Installation for 3CX
Before installing 3CX, there are some housekeeping tasks to complete. As it is always best practice to start on an updated system, lets get that done as well
- Allocate a static IP Address for the server
-
Update repositories and apply any required updates:
apt update && apt upgrade -y
-
Install gnupg package (In a server system I recommend gnupg1 for its low overhead)
apt install gnupg1 -y
-
Download and install the public key for the 3CX repo (If you are not root, remember to amend the command after the pipe “|” to read sudo apt-key add -)
wget -O- http://downloads-global.3cx.com/downloads/3cxpbx/public.key | apt-key add -
-
Add the 3CX repository for debian (Note that if you are using Debian 9, you should replace “buster” with “jessie” and if you are using Debian 11, you should replace buster with “bullseye”)
echo "deb http://downloads-global.3cx.com/downloads/debian buster main" | tee /etc/apt/sources.list.d/3cxpbx.list
- Update repositories again, ensuring that all packages are correctly referred to the 3CX repository
-
apt update
-
-
Purge locales, depending on how your system has been configured, it is possible that it is not set to en_US.UTF-8, if this is not done, the 3CX installer will fail on the last step, so lets fix that now
apt-get purge locales
apt install locales
dpkg-reconfigure locales
- Choose en_US.UTF-8 as your locale
-
Clean up and restart the system to ensure that locales are flushed
apt autoremove
reboot
Step 4 – Installing 3CX
-
Once the system has restarted, you can install 3CX:
apt install 3cxpbx -y
- Once installation has completed, choose to configure with the web interface (Option 2, note the IP address of your installation as per the web installer).
- Open your web browser and point it to: http://{Server IP}:5001/?v=2
- Select “Create a new install of 3CX Phone System and paste your licence key:
- Create a Username for your First Admin User:
- Confirm that your Public IP address is correct or enter it manually if necessary:
- Confirm whether you use a static or dynamic IP:
- Choose a subdomain for the FQDN (Note you can only use a custom domain with an upgraded, non-free licence):
- Determine Port Selection for your installation (I changed the HTTPS and HTTP ports to 443 and 80 respectively to simplify loging in, however you are free to leave this unchanged):
- Set tge default network adapter and FQDN if applicable:
- 3CX Should now run through the installation of the system:
- Choose an extension length for your 3CX Server (How many users you intend to have will determine this):
- Set up an admin email account:
- Select a Country and Time Zone:
- Confirm Operator Extension and Voicemail Number:
- Limit Outgoing Calls to certain countries, or enable all:
- Select System Prompt Language:
- Installation should now finish:
- You should now be presented with your dashboard as follows:
And you are finished, you can now configure SIP Trunks or Gateways as is your use-case and add users.
Leave a Reply