3CX Logo

Installing 3CX PBX on Debian 10

3CX Logo

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.

3CX Licence Screen

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:

  1. Ensure that “Full Cone NAT” is correctly configured on your firewall or router.
  2. Disable “SIP ALG” setting if it exists on your firewall or router.
  3. 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)
  4. 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

  1. Allocate a static IP Address for the server
  2. Update repositories and apply any required updates:

    apt update && apt upgrade -y
  3. Install gnupg package (In a server system I recommend gnupg1 for its low overhead)

    apt install gnupg1 -y
  4. 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 -
  5. 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
  6. Update repositories again, ensuring that all packages are correctly referred to the 3CX repository
    • apt update
  7. 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
  8. Clean up and restart the system to ensure that locales are flushed

    apt autoremove
    reboot

 

Step 4 – Installing 3CX

 

  1. Once the system has restarted, you can install 3CX:

    apt install 3cxpbx -y	
  2. 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).
  3. Open your web browser and point it to: http://{Server IP}:5001/?v=2
  4. Select “Create a new install of 3CX Phone System and paste your licence key:
    3CX Web Installer Step 1
  5. Create a Username for your First Admin User:
    Create User Name
  6. Confirm that your Public IP address is correct or enter it manually if necessary:
    Confirm Public IP
  7. Confirm whether you use a static or dynamic IP:
    Confirm Static IP
  8. Choose a subdomain for the FQDN (Note you can only use a custom domain with an upgraded, non-free licence):
    Confirm Subdomain
  9. 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):
    Port Selection
  10. Set tge default network adapter and FQDN if applicable:
    Adapter Configuration
  11. 3CX Should now run through the installation of the system:
    Installation
  12. Choose an extension length for your 3CX Server (How many users you intend to have will determine this):
    Choose Extension Length
  13. Set up an admin email account:
    Admin Email Configuration
  14. Select a Country and Time Zone:
    Select Country and Time Zone
  15. Confirm Operator Extension and Voicemail Number:
    Configure Operator and Voicemail
  16. Limit Outgoing Calls to certain countries, or enable all:
    Select Outgoing Countries
  17. Select System Prompt Language:
  18. Installation should now finish:
    Finalizing Installation
  19. You should now be presented with your dashboard as follows:
    3CX Dashboard

And you are finished, you can now configure SIP Trunks or Gateways as is your use-case and add users.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *