...
How to deploy portsip pbx on ubuntu vps
Learn how to deploy portsip pbx on ubuntu vps!

This article provides a guide demonstrating how to deploy PortSIP PBX on Ubuntu VPS.

Table of Contents

What is PortSIP PBX?

PortSIP PBX is a software-based unified communications platform providing SIP telephony, multi-tenant PBX functionality, WebRTC, mobile and desktop clients, call queues, conferencing, messaging, and related communications services.

Beginning with PortSIP PBX 22.x, PortSIP introduced its newer PortSIP ONE client platform and an integrated Instant Messaging service supporting one-to-one and group messaging. On Linux, however, the IM component is deployed separately from the main PBX container—even when both services reside on the same VPS.

As of August 2026, PortSIP lists PortSIP PBX 22.6.3 as the current v22 release. The deployment procedure below intentionally uses the portsip/pbx:22 Docker image tag so the installation follows PortSIP’s supported v22.x release channel.

This guide walks through deploying:

  • Ubuntu 24.04 LTS
  • PortSIP PBX 22.x
  • PortSIP Instant Messaging
  • PBX and IM on the same VPS
  • A public DNS hostname
  • TLS/HTTPS
  • Firewall configuration
  • Initial PBX configuration
  • Verification and basic maintenance

Prerequisites

For this guide, assume the following example environment:

Operating System: Ubuntu 24.04 LTS
PBX Hostname:     pbx.example.com
Public IP:        203.0.113.50
PBX Data:         /var/lib/portsip
IM Data:          /var/lib/portsip-im
Chat Files:       /var/lib/portsip-chat

Replace these examples with your actual hostname and IP address.

Minimum VPS resources

PortSIP’s current documentation lists the basic PBX minimum as:

  • 2 CPU cores
  • 4 GB RAM
  • 50 GB disk

PortSIP states that this configuration can theoretically handle up to approximately 1,000 registered users and 300–500 simultaneous calls, although actual capacity will vary dramatically with codecs, transcoding, recording, conferencing, queues, IM usage, and overall traffic.

Because this guide places both PBX and IM on the same VPS, a more practical starting point is:

4 vCPU
8 GB RAM
80-100 GB SSD/NVMe
1 Gbps network connection

For heavier messaging, call recording, conferencing, or larger deployments, consider:

8+ vCPU
16+ GB RAM
150+ GB NVMe

PortSIP recommends moving IM to a dedicated server for large-scale or high-concurrency deployments.

Supported operating systems

PortSIP PBX 22.x currently supports:

Ubuntu 24.04 is PortSIP’s recommended Ubuntu release, so that is what we will use here.

Launch 100% ssd ubuntu vps from $3. 19/mo!


Compare Ubuntu VPS Plans

KVM-SSD-1
KVM-SSD-8
KVM-SSD-16
KVM-SSD-32
CPU
1 Core
2 Cores
4 Cores
8 Cores
Memory
1 GB
8 GB
16 GB
32 GB
Storage
16 GB NVMe
128 GB NVMe
256 GB NVMe
512 GB NVMe
Bandwidth
1 TB
4 TB
8 TB
16 TB
Network
1 Gbps
1 Gbps
1 Gbps
1 Gbps
Delivery Time
⏱️ Instant
⏱️ Instant
⏱️ Instant
⏱️ Instant
Location
US/EU/APAC
US/EU/APAC
US/EU/APAC
US/EU/APAC
Price
$7.58*
$39.50*
$79.40*
$151.22*
KVM-SSD-1
$7.58*
CPU 1 Core
Memory 1 GB
Storage 16 GB NVMe
Bandwidth 1 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-8
$39.50*
CPU 2 Cores
Memory 8 GB
Storage 128 GB NVMe
Bandwidth 4 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-16
$79.40*
CPU 4 Cores
Memory 16 GB
Storage 256 GB NVMe
Bandwidth 8 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC
KVM-SSD-32
$151.22*
CPU 8 Cores
Memory 32 GB
Storage 512 GB NVMe
Bandwidth 16 TB
Network 1 Gbps
Delivery Time ⏱️ Instant
Location US/EU/APAC

How to Deploy PortSIP PBX on Ubuntu VPS

To deploy PortSIP PBX on Ubuntu VPS, follow the steps below:

See Also: How to Harden Security of VPS Server

  1. Create the DNS Record

    Before installing the PBX, create a hostname such as:

    pbx.example.com
    

    Create an A record:

    pbx.example.com.    A    203.0.113.50
    

    Verify it:

    dig +short pbx.example.com
    

    You should receive:

    203.0.113.50
    

    You can also test with:

    getent hosts pbx.example.com
    

    DNS should be working before configuring a trusted TLS certificate.

  2. Connect to the VPS

    Connect over SSH:

    ssh root@203.0.113.50
    

    Or, if your VPS provider created a sudo user:

    ssh ubuntu@203.0.113.50
    

    Then obtain a root shell if desired:

    sudo -i
    

    PortSIP’s current installation procedure supports installation using sudo.

  3. Set the Server Hostname

    Configure the server hostname:

    hostnamectl set-hostname pbx.example.com
    

    Verify:

    hostnamectl
    

    And:

    hostname -f
    

    The latter should ideally return:

    pbx.example.com
    
  4. Update Ubuntu

    Update the OS before installing PortSIP:

    apt update
    apt full-upgrade -y
    

    Install some basic utilities:

    apt install -y \
        curl \
        wget \
        ca-certificates \
        gnupg \
        unzip \
        dnsutils \
        chrony
    

    If Ubuntu installed a new kernel, reboot:

    reboot
    

    Reconnect afterward.

    PortSIP specifically recommends installing all available OS updates before deploying the PBX.

  5. Verify Time Synchronization

    Correct system time is particularly important for SIP authentication, TLS, certificates, logs, and messaging.

    Enable Chrony:

    systemctl enable --now chrony
    

    Check:

    chronyc tracking
    

    Also check:

    timedatectl
    

    You want to see something resembling:

    System clock synchronized: yes
    NTP service: active
    

    PortSIP explicitly requires the server date and time to be correctly synchronized.

  6. Verify the VPS Has a Static Public IP

    Run:

    ip addr
    

    And determine the public IP if necessary:

    curl -4 https://icanhazip.com
    

    For example:

    203.0.113.50
    

    The PBX should not be placed behind a frequently changing public IP address.

    If your VPS has:

    Private IP: 10.20.0.15
    Public IP: 203.0.113.50
    

    retain both values. They will be entered in the PortSIP setup wizard.

    For a VPS where the public IP is directly assigned to the network interface, you will normally use that IP as the primary server address.

    PortSIP’s current setup instructions require static addressing and distinguish between private and public addresses for cloud environments.

  7. Check for Conflicting Services

    PortSIP advises against installing PostgreSQL separately on the PBX host and recommends avoiding VPN clients, DNS/DHCP-server roles, and unnecessary software on the system.

    Check for PostgreSQL:

    systemctl status postgresql
    

    If the service does not exist, that is fine.

    Check important listening ports:

    ss -lntup
    

    Pay particular attention to:

    See Also: How to Deploy Invidious on Ubuntu VPS

    5060
    5061
    5063
    5065
    5066
    5067
    8882
    8883
    8887
    8888
    10443
    

    You do not want an existing SIP server such as Asterisk, FreeSWITCH, Kamailio, OpenSIPS, or another PBX already binding PortSIP’s ports.

  8. Understand the PortSIP Firewall Requirements

    PortSIP’s current v22 installation documentation identifies these primary ports:

    UDP

    5060
    5066
    25000-34999
    45000-65000
    

    TCP

    5061
    5063
    5065
    5067
    8882
    8883
    8887
    8888
    10443
    

    PortSIP’s security documentation describes the major services as follows:

    Port Protocol Purpose
    22 TCP SSH
    5060 UDP PBX SIP
    5061 TCP SIP TLS
    5063 TCP SIP TCP
    5065 TCP WSS/SIP-related service
    5066 UDP SBC SIP
    5067 TCP SBC
    8882 TCP Provisioning/SBC
    8883 TCP SBC portal/service
    8887 TCP PBX HTTPS portal/API
    8888 TCP Phone provisioning
    10443 TCP WebRTC
    45000-64999 UDP PBX RTP/media
    25000-34999 UDP SBC RTP/media

    If you are not installing the PortSIP SBC, you do not necessarily need to expose every SBC-specific port publicly. Nevertheless, following PortSIP’s documented baseline during initial deployment can simplify troubleshooting.

    A production firewall should eventually expose only the services actually required.

  9. Be Aware That PortSIP Changes Ubuntu Firewall Behavior

    One unusual but important PortSIP behavior is worth mentioning.

    PortSIP’s documentation states that on supported Linux systems it configures firewalld, while on Ubuntu/Debian the normal UFW configuration is disabled after installation.

    Therefore, do not assume that:

    ufw status
    

    represents the final firewall state after PortSIP is installed.

    You should also configure the firewall/security group supplied by your VPS provider.

    For example, if your provider has a network firewall, allow the PortSIP ports there as well.

    PortSIP explicitly warns that cloud-provider security groups/firewalls must permit the same traffic or registrations and calls may fail.

  10. Download the Official PortSIP 22.x Installation Scripts

    Create the PortSIP directory:

    sudo mkdir -p /opt/portsip
    

    Download PortSIP’s current v22 initialization script:

    cd /opt/portsip
    
    sudo curl \
    https://raw.githubusercontent.com/portsip/portsip-pbx-sh/master/v22.x/init.sh \
    -o init.sh
    

    Run it:

    sudo /bin/sh init.sh
    

    This is PortSIP’s official v22.x initialization procedure.

    Afterward:

    ls -la /opt/portsip
    

    You should see PortSIP management scripts including files such as:

    pbx_ctl.sh
    im_ctl.sh
    install_docker.sh
    
  11. Install PortSIP’s Docker Environment

    Remain in:

    cd /opt/portsip
    

    Run:

    sudo /bin/sh install_docker.sh
    

    PortSIP deploys PBX 22.x using containers rather than a traditional Ubuntu .deb package.

    During installation you may receive a prompt similar to:

    See Also: How to Install LibreNMS on Rocky Linux VPS

    cloud.cfg (Y/I/N/O/D/Z) [default=N] ?
    

    PortSIP’s documentation instructs you to enter:

    Y
    

    and press Enter.

    After installation, verify Docker:

    docker --version
    

    And:

    docker compose version
    

    Also:

    systemctl status docker --no-pager
    
  12. Create the PortSIP PBX Data Directory

    Create the persistent PBX directory:

    mkdir -p /var/lib/portsip
    

    You may also create a dedicated recording location:

    mkdir -p /var/lib/portsip-recordings
    

    Persistent data is important because the Docker container itself should be considered disposable. The PortSIP control scripts can recreate containers while retaining data stored in the mapped directory.

  13. Install PortSIP PBX 22.x

    Determine your public IP:

    PUBLIC_IP=$(curl -4 -s https://icanhazip.com)
    echo "$PUBLIC_IP"
    

    For example:

    203.0.113.50
    

    Run the PBX:

    cd /opt/portsip
    
    sudo /bin/sh pbx_ctl.sh run \
        -p /var/lib/portsip \
        -a "$PUBLIC_IP" \
        -i portsip/pbx:22
    

    This is the current PortSIP v22.x deployment pattern.

    The parameters mean:

    -p    Persistent PBX data path
    -a    PBX/server IP address
    -i    Docker image
    

    The image:

    portsip/pbx:22
    

    keeps the deployment on PortSIP’s v22.x branch.

  14. Optional: Store Call Recordings Separately

    If you expect significant call recording usage, keeping recordings in a separate directory or mounted disk is useful.

    For example:

    mkdir -p /var/lib/portsip-recordings
    

    You would initially create the PBX with:

    sudo /bin/sh pbx_ctl.sh run \
        -p /var/lib/portsip \
        -a "$PUBLIC_IP" \
        -i portsip/pbx:22 \
        -f /var/lib/portsip-recordings
    

    PortSIP officially supports the optional -f parameter for separating recordings from the main PBX data directory.

    For a fresh deployment, decide this before production usage rather than changing storage arrangements later.

  15. Check PBX Status

    Run:

    cd /opt/portsip
    sudo /bin/sh pbx_ctl.sh status
    

    Then inspect Docker:

    docker ps
    

    You should see PortSIP containers running.

    If troubleshooting:

    docker ps -a
    

    And:

    ss -lntup
    
  16. Open the PortSIP Web Portal

    Browse to:

    https://203.0.113.50:8887
    

    or eventually:

    https://pbx.example.com:8887
    

    PortSIP’s v22 portal uses TCP port 8887 for HTTPS.

    Because TLS has not yet been fully configured, the browser may initially display a certificate warning.

    For a new installation, the documented default administrator credentials are:

    Username: admin
    Password: admin
    

    Immediately change the administrator password after signing in.

    Use a long unique password and store it securely.

  17. Complete the Initial Setup Wizard

    PortSIP automatically launches its configuration wizard after the first login.

    There are several particularly important settings.

    See Also: How to Host a Telegram Bot on Ubuntu VPS

    Network Environment

    If the VPS has both private and public addresses, enter both.

    For example:

    Private IPv4:
    10.20.0.15
    
    Public IPv4:
    203.0.113.50
    

    If your VPS only has a directly routed public address, PortSIP instructs you to use that address where a private address would otherwise be required.

    Do not use:

    127.0.0.1
    

    as the PBX private IP.

    PortSIP notes that these addresses are ultimately used by SIP endpoints for registration and signaling.

  18. Configure the PBX Web Domain

    Set:

    pbx.example.com
    

    as the PBX Web Domain.

    Confirm again:

    dig +short pbx.example.com
    

    It should return your VPS public IP.

    A proper DNS hostname is strongly preferable to operating the PBX directly by IP because it allows proper HTTPS, TLS SIP, WebRTC, and client validation.

  19. Configure TLS

    PortSIP supports trusted certificates for the PBX web portal, API, SIP TLS, and WebRTC.

    The wizard expects two primary pieces:

    Certificate
    Private Key
    

    PortSIP’s documentation refers to these as:

    portsip.pem
    portsip.key
    

    If using a commercial or ACME-issued certificate, make sure the PEM contains the appropriate certificate chain.

    Conceptually:

    portsip.pem
        Server certificate
        Intermediate certificate(s)
    
    portsip.key
        Private key
    

    Paste the certificate and key into the corresponding PortSIP fields.

    A trusted certificate is strongly recommended for production deployments because the default PortSIP certificate is self-signed.

  20. Configure SIP Transports

    PortSIP’s standard PBX transport ports are:

    UDP: 5060
    TLS: 5061
    TCP: 5063
    

    You may configure all three or only the transports your environment requires.

    For a security-conscious deployment, prioritize:

    TLS 5061
    

    when your phones and SIP provider support it.

    PortSIP also recommends changing commonly scanned default SIP ports when practical, although changing ports should be regarded as scan-noise reduction rather than a real authentication control.

    If you change a transport to, for example:

    TLS 5071
    

    you must also allow:

    5071/TCP
    

    through the host firewall and VPS-provider firewall.

  21. Finish the PBX Wizard

    Complete the setup wizard and allow PortSIP to apply the configuration.

    If you installed a trusted TLS certificate, restart the PBX:

    cd /opt/portsip
    sudo /bin/sh pbx_ctl.sh restart
    

    PortSIP specifically requires a PBX restart after changing to a trusted certificate.

    Test:

    https://pbx.example.com:8887
    

    You should now receive a valid TLS connection.

  22. Prepare the Instant Messaging Service

    This is the important additional step for PortSIP PBX 22.x.

    Installing the PBX container does not automatically install the Linux IM service.

    See Also: Integrate Jitsi Meet with Moodle for Elearning Video Conferencing

    PortSIP’s v22 IM service provides functionality including:

    • Direct user-to-user messaging
    • Group messaging
    • File sharing
    • PortSIP ONE collaboration features

    We are going to run the IM service on the same Ubuntu VPS as the PBX.

    For large deployments, separating the service onto another VPS is preferable, but it is unnecessary for a small-to-medium installation.

  23. Generate the IM Server Token

    Sign into:

    https://pbx.example.com:8887
    

    as the PortSIP system administrator.

    Navigate to:

    Servers
      → IM Servers
    

    Select the default IM server.

    Click:

    Generate Token
    

    Copy the generated token.

    PortSIP requires this token when the IM Docker service registers itself with the main PBX.

    It will resemble a long random string.

    For example:

    MJC4NZBLYTGTZTJJNS0ZMWZHLWIXZDCTZJLLMDEWZJHKZTAY
    

    Do not use that example token.

    Use the actual value generated by your PBX.

  24. Determine the PBX and IM Addresses

    Because PBX and IM reside on the same VPS, they will normally use the same underlying server addresses.

    Example:

    PUBLIC_IP=203.0.113.50
    PRIVATE_IP=203.0.113.50
    

    For a cloud VPS with a private network:

    PRIVATE_IP=10.20.0.15
    PUBLIC_IP=203.0.113.50
    

    Use the private address for communication between PortSIP components when one is available.

    For example:

    ip -4 addr
    

    Then:

    curl -4 https://icanhazip.com
    
  25. Create Dedicated IM Storage

    Although PortSIP’s examples often show /var/lib/portsip on a standalone IM server, PBX and IM are sharing this machine.

    Using separate host directories makes backups and administration much clearer.

    Create:

    mkdir -p /var/lib/portsip-im
    mkdir -p /var/lib/portsip-chat
    

    The second directory can store files transferred through chat.

    Check:

    ls -ld /var/lib/portsip*
    
  26. Launch the PortSIP IM Service

    PortSIP’s v22 IM deployment uses:

    im_ctl.sh run -E
    

    The documented parameters include:

    -E    Extended IM mode
    -p    IM persistent-data directory
    -a    IM private/server IP
    -A    IM public IP
    -i    PortSIP image
    -x    Main PBX IP
    -t    IM authentication token
    -f    Optional chat-file directory
    

    For a VPS with a private and public address, use:

    cd /opt/portsip
    
    sudo /bin/sh im_ctl.sh run -E \
        -p /var/lib/portsip-im \
        -f /var/lib/portsip-chat \
        -a PRIVATE_IP \
        -A PUBLIC_IP \
        -i portsip/pbx:22 \
        -x PRIVATE_IP \
        -t YOUR_IM_TOKEN
    

    For example:

    sudo /bin/sh im_ctl.sh run -E \
        -p /var/lib/portsip-im \
        -f /var/lib/portsip-chat \
        -a 10.20.0.15 \
        -A 203.0.113.50 \
        -i portsip/pbx:22 \
        -x 10.20.0.15 \
        -t YOUR_IM_TOKEN
    

    Replace:

    See Also: How to Generate a Full VPS Backup Using rclone (Simple 3-Minute Guide)

    YOUR_IM_TOKEN
    

    with the token generated in:

    Servers → IM Servers
    

    VPS with only one routed public address

    If the VPS does not expose a separate private network address, use the server address consistently:

    sudo /bin/sh im_ctl.sh run -E \
        -p /var/lib/portsip-im \
        -f /var/lib/portsip-chat \
        -a 203.0.113.50 \
        -A 203.0.113.50 \
        -i portsip/pbx:22 \
        -x 203.0.113.50 \
        -t YOUR_IM_TOKEN
    

    PortSIP requires at least one IM interface address through -a or -A; -x identifies the main PBX.

  27. Check IM Status

    Run:

    cd /opt/portsip
    sudo /bin/sh im_ctl.sh status
    

    PortSIP exposes separate management commands for the PBX and IM containers.

    Also check:

    docker ps
    

    You should now see both PBX-related and IM-related containers.

  28. Restart IM After the PBX Is Running

    Once PBX initialization is complete:

    cd /opt/portsip
    sudo /bin/sh pbx_ctl.sh restart
    

    Wait for the PBX to return.

    Then:

    sudo /bin/sh im_ctl.sh restart
    

    PortSIP’s cluster documentation specifically calls for the PBX to be running before the IM service is restarted.

    Check both:

    sudo /bin/sh pbx_ctl.sh status
    sudo /bin/sh im_ctl.sh status
    
  29. Verify the IM Server in the Web Portal

    Return to:

    Servers
      → IM Servers
    

    The IM server should now show an active/connected state.

    If it does not, check:

    docker ps -a
    

    Then inspect the relevant container logs:

    docker logs CONTAINER_NAME
    

    You can obtain the exact name with:

    docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
    
  30. Ensure TCP 8887 Is Publicly Accessible

    PortSIP specifically notes that cloud-hosted IM deployments require:

    TCP 8887
    

    to be reachable because clients use this service in connection with messaging.

    Test externally if possible:

    nc -vz pbx.example.com 8887
    

    Expected:

    Connection to pbx.example.com 8887 port [tcp/*] succeeded!
    

    Because PBX and IM share the VPS, you do not attempt to bind two separate public web portals to port 8887 manually. PortSIP’s container/control scripts manage the internal service topology.

  31. Test the PortSIP ONE Client

    PortSIP ONE is designed specifically for PBX 22.x. PortSIP states that it is not compatible with the older v16 PBX generation.

    Create two test extensions, for example:

    1001
    1002
    

    Sign into PortSIP ONE as both users.

    Verify:

    1. Extension 1001 registers.
    2. Extension 1002 registers.
    3. 1001 can call 1002.
    4. 1002 can answer.
    5. Audio works in both directions.
    6. 1001 can send a message to 1002.
    7. 1002 receives it immediately.
    8. 1002 can reply.
    9. File transfer works.
    10. Group chat can be created if required.

    Testing messaging separately from SIP calling is important because the PBX and IM components are separate services.

  32. Test RTP Audio

    A successful SIP registration does not prove the firewall is correctly configured for audio.

    See Also: How to Deploy Kamailio on Ubuntu VPS

    Place a call between two external endpoints.

    Verify:

    Caller hears callee
    Callee hears caller
    

    One-way audio usually indicates problems involving:

    • Public/private IP configuration
    • Cloud firewall
    • RTP firewall ports
    • NAT
    • Incorrect advertised IP
    • SIP ALG
    • Endpoint firewall

    The PBX RTP range is:

    UDP 45000-64999
    

    Make sure that range reaches the VPS.

  33. Disable SIP ALG Upstream

    If the network device, VPS provider, firewall, or router implements SIP ALG, disable it whenever possible.

    SIP ALG frequently modifies SIP headers and SDP and can cause:

    • Registration failures
    • One-way audio
    • Calls dropping after 30 seconds
    • Incorrect contact addresses
    • TLS problems
    • NAT inconsistencies

    A public VPS with a directly routed IPv4 address generally offers the cleanest PortSIP deployment.

  34. Configure a SIP Trunk

    Once the base PBX is healthy, configure your SIP provider.

    Typically navigate through the PortSIP administration interface to the trunk section and provide:

    SIP server
    Proxy
    Username
    Authentication ID
    Password
    Transport
    DID numbers
    

    If your provider supports SIP TLS, use it where practical.

    After creating the trunk, configure:

    Inbound rules
    Outbound rules
    Caller ID
    Emergency routing
    

    Do not expose your SIP-provider credentials in shell history, tickets, or screenshots.

  35. Create Extensions

    Create extensions for your users.

    For example:

    1001 - Alice
    1002 - Bob
    1003 - Reception
    

    Use strong randomly generated authentication passwords.

    Avoid simple SIP passwords such as:

    123456
    password
    extension1001
    companyname
    

    SIP systems are continuously scanned by automated fraud infrastructure.

  36. Harden SSH

    Once initial deployment is complete, use SSH keys rather than passwords.

    For example, edit:

    nano /etc/ssh/sshd_config
    

    Consider:

    PermitRootLogin prohibit-password
    PasswordAuthentication no
    PubkeyAuthentication yes
    

    Validate:

    sshd -t
    

    Then:

    systemctl restart ssh
    

    Do not disable password authentication until you have verified that key authentication works in a second SSH session.

    PortSIP also recommends moving SSH away from port 22 to reduce automated scanning, although SSH keys and firewall restrictions provide far more meaningful protection.

  37. Restrict PBX Administration Access

    Port:

    8887/TCP
    

    must often remain Internet-accessible for applications and services, so conventional IP restriction may not always be practical.

    However, administrative protection should include:

    • Strong administrator password
    • Limited administrator accounts
    • Trusted TLS certificate
    • No shared credentials
    • Regular updates
    • PortSIP IP blacklist/security controls
    • Strong SIP extension credentials
    • SIP TLS and SRTP where supported
    • Monitoring failed authentication attempts

    Changing default SIP transport ports can also reduce scanner noise. PortSIP recommends this as an optional security measure.

  38. Check the PortSIP Firewall After Installation

    Because PortSIP configures firewalld, inspect it:

    See Also: How to Download and Migrate a Weebly Site to Rad Web Hosting

    systemctl status firewalld
    

    Then:

    firewall-cmd --list-all
    

    And:

    firewall-cmd --list-all-zones
    

    Check listening ports:

    ss -lntup
    

    Never blindly add duplicate rules without first inspecting what the installer created.

  39. Configure the VPS Provider Firewall

    If your hosting provider offers an external firewall, security group, or network ACL, configure that separately.

    A reasonable initial ruleset includes:

    TCP

    22                 SSH - ideally administrator IP only
    5061               SIP TLS
    5063               SIP TCP if used
    5065
    5067               SBC only if needed
    8882
    8883               SBC only if needed
    8887               PBX HTTPS / IM
    8888               Provisioning
    10443              WebRTC
    

    UDP

    5060               SIP UDP if used
    5066               SBC only if used
    45000-64999        PBX RTP
    25000-34999        SBC RTP only if using SBC
    

    PortSIP’s official cloud guidance identifies essentially these ranges.

    For a PBX without SBC, omit unused SBC-specific ports once you have confirmed your exact architecture.

  40. Basic PBX Management Commands

    All PortSIP control commands should be run from:

    cd /opt/portsip
    

    PBX status

    sudo /bin/sh pbx_ctl.sh status
    

    Start PBX

    sudo /bin/sh pbx_ctl.sh start
    

    Stop PBX

    sudo /bin/sh pbx_ctl.sh stop
    

    Restart PBX

    sudo /bin/sh pbx_ctl.sh restart
    

    Remove PBX container

    sudo /bin/sh pbx_ctl.sh rm
    

    PortSIP notes that removing the container does not remove the PBX persistent data.

  41. Basic IM Management Commands

    IM status

    cd /opt/portsip
    sudo /bin/sh im_ctl.sh status
    

    Start IM

    sudo /bin/sh im_ctl.sh start
    

    Stop IM

    sudo /bin/sh im_ctl.sh stop
    

    Restart IM

    sudo /bin/sh im_ctl.sh restart
    

    Remove the IM container

    sudo /bin/sh im_ctl.sh rm
    

    The persistent IM data directory remains separate from the container.

  42. Check All PortSIP Containers

    Use:

    docker ps
    

    For a cleaner display:

    docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}'
    

    Show stopped containers:

    docker ps -a
    

    Check Docker disk consumption:

    docker system df
    

    Do not casually run:

    docker system prune -a
    

    on a production PBX. Removing images, volumes, or networks without understanding PortSIP’s Docker topology can result in service disruption.

  43. Monitor Storage

    PBX systems can consume storage quickly due to:

    • Call recordings
    • Voicemail
    • Logs
    • Chat messages
    • Chat file attachments
    • Database growth
    • Docker images
    • Backups

    Check:

    See Also: How to Install WHMCS Domain Reseller API Registrar Module

    df -h
    

    And:

    du -sh /var/lib/portsip
    du -sh /var/lib/portsip-im
    du -sh /var/lib/portsip-chat
    

    If recordings are separated:

    du -sh /var/lib/portsip-recordings
    

    Consider monitoring disk usage and alerting before utilization exceeds 80%.

  44. Back Up PortSIP

    At minimum, protect:

    /var/lib/portsip
    /var/lib/portsip-im
    /var/lib/portsip-chat
    

    and, if applicable:

    /var/lib/portsip-recordings
    

    Use PortSIP’s built-in backup functionality where appropriate and maintain an off-server backup.

    Do not treat a VPS snapshot as the only backup.

    A useful architecture is:

    PortSIP VPS
         │
         ├── PBX data
         ├── IM data
         ├── Chat files
         └── Recordings
               │
               ▼
    Encrypted remote backup storage
    

    Test restoration procedures periodically.

  45. Do Not Install Data Flow on This Same VPS

    PortSIP 22.3 and later includes the optional Data Flow service for:

    • Call analytics
    • Real-time metrics
    • Dashboards
    • Wallboards

    However, PortSIP states that Data Flow uses ClickHouse and must be installed on a dedicated high-performance server rather than on the PBX server.

    Therefore, this guide intentionally installs:

    PBX + IM
    

    on one VPS but does not install Data Flow there.

    A larger architecture would instead look like:

                        ┌──────────────────────┐
                        │ PortSIP PBX + IM     │
                        │ Ubuntu 24.04 VPS     │
                        └──────────┬───────────┘
                                   │
                                   │
                        ┌──────────▼───────────┐
                        │ Data Flow Server     │
                        │ ClickHouse           │
                        │ Separate VPS         │
                        └──────────────────────┘
    
  46. Updating PortSIP 22.x

    Do not blindly run generic Docker image-update commands against the deployment.

    PortSIP provides version-specific upgrade procedures and requires its installation scripts to be updated before performing a v22.x upgrade.

    PortSIP explicitly distinguishes:

    Fresh installation
    v22.x → newer v22.x
    v16 → v22
    HA upgrade
    

    Always consult the current v22.x upgrade instructions before upgrading a production PBX.

    If IM is installed on the same PBX server, ensure both PBX and IM are upgraded according to PortSIP’s corresponding procedure.

  47. Recommended Production Topology

    For a small or moderate deployment, this guide’s topology is perfectly reasonable:

    Internet
       │
       ▼
    203.0.113.50
    pbx.example.com
       │
       ├── PortSIP PBX 22.x
       │
       ├── PortSIP Media Services
       │
       ├── PortSIP IM
       │
       └── Docker
              │
              ▼
        Ubuntu 24.04 VPS
    

    Your persistent storage could be organized as:

    /var/lib/
    ├── portsip/
    ├── portsip-im/
    ├── portsip-chat/
    └── portsip-recordings/
    

    For a significantly larger deployment, move IM, media, queues, meetings, or analytics services onto appropriately sized dedicated systems according to PortSIP’s cluster architecture.

  48. Final Verification Checklist

    Before declaring the installation production-ready, verify each item.

    • [ ] Ubuntu 24.04 LTS is fully updated.
    • [ ] Server time is synchronized.
    • [ ] VPS has a static public IPv4 address.
    • [ ] pbx.example.com resolves to the public IP.
    • [ ] PortSIP installation scripts came from the official v22.x branch.
    • [ ] Docker is running.
    • [ ] PortSIP PBX uses portsip/pbx:22.
    • [ ] PBX persistent data is stored outside the container.
    • [ ] PBX portal loads on TCP 8887.
    • [ ] Default admin/admin credentials have been changed.
    • [ ] Correct private/public IP addresses are configured.
    • [ ] Trusted TLS certificate is installed.
    • [ ] SIP transports are configured.
    • [ ] Provider/cloud firewall permits required ports.
    • [ ] UDP RTP range 45000–64999 is reachable.
    • [ ] Two extensions can register.
    • [ ] Two-way audio works.
    • [ ] SIP trunk can place outbound calls.
    • [ ] Inbound DID routing works.
    • [ ] IM token has been generated.
    • [ ] IM service is running on the same VPS.
    • [ ] im_ctl.sh status reports healthy operation.
    • [ ] PortSIP ONE users can send messages.
    • [ ] Group messaging works.
    • [ ] Chat file transfers work.
    • [ ] PBX data is backed up off-server.
    • [ ] IM data and chat files are backed up.
    • [ ] Disk-space monitoring is configured.
    • [ ] SSH is protected with keys and restricted access.
    • [ ] SIP ALG is disabled upstream.
    • [ ] Data Flow has not been installed on the PBX VPS.
  49. Quick Command Summary

    For a basic public-IP deployment, the essential installation flow is:

    See Also: 💻 How to Access SSH in cPanel (5 Minute Step-by-Step Guide)

    sudo -i
    
    apt update
    apt full-upgrade -y
    
    apt install -y curl wget ca-certificates gnupg unzip dnsutils chrony
    
    systemctl enable --now chrony
    
    mkdir -p /opt/portsip
    
    cd /opt/portsip
    
    curl \
    https://raw.githubusercontent.com/portsip/portsip-pbx-sh/master/v22.x/init.sh \
    -o init.sh
    
    /bin/sh init.sh
    
    cd /opt/portsip
    /bin/sh install_docker.sh
    

    Install PBX:

    mkdir -p /var/lib/portsip
    
    PUBLIC_IP=$(curl -4 -s https://icanhazip.com)
    
    cd /opt/portsip
    
    /bin/sh pbx_ctl.sh run \
        -p /var/lib/portsip \
        -a "$PUBLIC_IP" \
        -i portsip/pbx:22
    

    Check:

    /bin/sh pbx_ctl.sh status
    

    Complete the PBX setup at:

    https://PUBLIC_IP:8887
    

    Then generate an IM token from:

    Servers → IM Servers → Generate Token
    

    Create IM storage:

    mkdir -p /var/lib/portsip-im
    mkdir -p /var/lib/portsip-chat
    

    Launch IM:

    cd /opt/portsip
    
    /bin/sh im_ctl.sh run -E \
        -p /var/lib/portsip-im \
        -f /var/lib/portsip-chat \
        -a "$PUBLIC_IP" \
        -A "$PUBLIC_IP" \
        -i portsip/pbx:22 \
        -x "$PUBLIC_IP" \
        -t YOUR_IM_TOKEN
    

    Then:

    /bin/sh pbx_ctl.sh restart
    /bin/sh im_ctl.sh restart
    

    Verify:

    /bin/sh pbx_ctl.sh status
    /bin/sh im_ctl.sh status
    docker ps
    

    At that point, the Ubuntu VPS is running both PortSIP PBX 22.x and the PortSIP IM service, providing the foundation for SIP calling, PortSIP ONE, one-to-one messaging, group chat, file sharing, WebRTC, extensions, trunks, call queues, and the rest of the PortSIP unified communications platform.

Launch 100% ssd ubuntu vps from $3. 19/mo!

See Also: Launch a FreeBSD 15 VPS Server

Conclusion

You now know how to deploy PortSIP PBX on Ubuntu VPS.

Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.

Leave a Reply

lg