Installation of PortSIP IM Server
Last updated
Last updated
The installation of the IM Server is a separate step, required only when PortSIP PBX is installed on a Linux server.
Before proceeding with this guide, ensure that you have already completed steps 1–4 of the Installation of the PortSIP PBX v22.x.
You have two options for deploying the PortSIP IM Server:
Same server as PortSIP PBX: If you have a smaller number of users, you can install the IM Service on the same server as your PortSIP PBX. This setup is simpler but may not provide optimal performance for larger user bases.
Separate server: For better performance, especially when dealing with a large number of users who require chat and file-sharing capabilities, it is recommended to install the IM Server on a separate, more powerful server.
All commands must be executed in the /opt/portsip
directory.
Follow these steps to install the IM server on the same server as PortSIP PBX.
Log in as the System Administrator to the PortSIP PBX Web portal.
Navigate to Servers > IM Servers.
Select the default server and click the Generate Token button.
Copy the generated token.
Follow these steps to create the IM service Docker instance:
Navigate to the /opt/portsip directory by running the following command:
Use the command below to create the Instant Messaging service Docker instance. Replace the placeholders with your actual values:
-p: Specifies the path for storing the IM service data.
-a: Specifies the IP address of the server.
-i: Specifies the PBX Docker image version.
-t: Specifies the token generated in the previous step.
If everything is set up correctly, the PBX web portal will display the IM server's IP address, as shown in the screenshot below.
The Instant Messaging (IM) server has been successfully installed. We can now proceed with the next steps in the PortSIP PBX installation step 6.
For optimal performance, it’s recommended to install the IM service on a separate server, especially when handling a large number of users for chat and file-sharing activities (including files and pictures). The following hardware specifications are suitable for supporting up to 50,000 users online, with messaging and file sharing:
CPU: 20 cores or higher
Memory: 16 GB
Disk: High I/O performance required (SSD recommended, at least 256 GB)
Network Bandwidth: 1000 Mbps or higher, particularly if handling high volumes of messages and file sharing.
It only supports 64-bit OS.
Ubuntu 22.04, 24.04
Debian 11.x, 12.x
For this setup, we assume:
The PortSIP PBX is installed on a server, which has the static private IP address 192.168.1.20.
The Instant Messaging (IM) service will be installed on a server with a static IP address of 192.168.1.25.
Tasks that MUST be completed before installing cluster servers.
Ensure the server date-time is synced correctly.
If the Linux server is on a LAN, assign a static private IP address, in this case, 192.168.1.25.
Install all available updates and service packs before installing the cluster server.
Do not install PostgreSQL on the server.
Ensure that all power-saving options for your system and network adapters are disabled (by setting the system to High-Performance mode).
Do not install TeamViewer, VPN, or similar software on the host machine.
The server must not be installed as a DNS or DHCP server.
To allow the separate Instant Messaging server (IP: 192.168.1.25) to access the PBX server (IP: 192.168.1.20), it is necessary to create appropriate firewall rules on the PBX server.
Please execute the following commands on the PBX server (IP: 192.168.1.20) to configure these firewall rules.
To verify that the rule has been created correctly, you can use the following command:
The correct output should be like below:
This step is mandatory; the service will not function without it.
To prevent the PBX from restricting the request rate to the IM servers, you must add the IM servers' IP addresses to the PBX whitelist. Follow the steps below to complete this process:
Sign in to the PBX web portal as the System Administrator
Select the menu IP Blacklist > Add.
Enter the IM server IP as shown in the screenshot below and choose a long expiration date.
Log in as the System Administrator to the PortSIP PBX Web portal.
Navigate to Servers > IM Servers.
Select the default server and click the Generate Token button.
Copy the generated token.
All commands must be executed in the /opt/portsip
directory.
Perform the below commands to download the installation scripts and initialize the environment:
Execute the below command to install the Docker-Compose
environment. If you get the prompt likes*** cloud.cfg (Y/I/N/O/D/Z) [default=N] ?
, enter the Y and then press the Enter button.
Use the following command to create the Instant Messaging (IM) service Docker instance on the IM server (IP 192.168.1.25). Replace each parameter with your actual values:
-E: Specifies that the IM server is installed in extended mode (required).
-p: Specifies the path for storing IM service data (required).
-a: Specifies the private IP address of this IM server. If this parameter is omitted, the -A parameter must be specified.
-A: Specifies the public IP address of this IM server. If this parameter is omitted, the -a parameter must be specified.
-i: Specifies the PBX Docker image version (required).
-x: Indicates the main PBX server's IP address (typically the private IP of the main PBX server) (required).
-t: Provides the token generated and copied in the previous step (required).
-f: Specifies the path for storing files sent in chats(optional). This path must differ from the one specified with -p. If this parameter is omitted, chat files will be stored in the path specified by -p.
Perform the below commands to restart the IM service (please ensure the PBX service on another server is started).
If everything is set up correctly, the PBX web portal will display the IM server's IP address, as shown in the screenshot below.
The Instant Messaging (IM) server has been successfully installed. We can now proceed with the next steps in the PortSIP PBX installation step 6.