Installing 3CX Pbx on Debian 10

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.

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:

  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
    • apt update
  3. Upgrade your system
    • apt upgrade
  4. Install gnupg package
    • apt install gnupg
  5. 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 -)
  6. Add the 3CX repository for debian (Note that if you are using Debian 9, you should replace “buster” with “jessie”
  7. Update repositories again, ensuring that all packages are correctly referred to the 3CX repository
    • apt update
  8. 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
  9. Clean up and restart the system to ensure that locales are flushed
    • apt autoremove
    • shutdown -r now

Step 4 – Installing 3CX

  1. Once the system has restarted, you can install 3CX
    • apt update
    • apt install 3cxpbx
  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. Follow the on-screen prompts, noting that if you change any of the default ports, you should make sure that they are configured in your firewall as per step 2.

And you are finished, you can now configure devices and get your system up and running.

4 thoughts on “Installing 3CX Pbx on Debian 10

  1. Hi 🙂
    Thanks for the article.

    After [ wget -O- | apt-key add – ]
    I get a [ gpg: can’t open ‘–’: No such file or directory ]

    And after [ echo “deb buster main” | tee /etc/apt/sources.list.d/3cxpbx.list ]
    When Trying to update I get [ E: Type ‘“deb’ is not known on line 1 in source list /etc/apt/sources.list.d/3cxpbx.list ]



  2. The use of the “” brackets are for the echo command, that should have worked in that context, however when manually editing the sources.list file, they should be excluded.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website with
Get started
%d bloggers like this: