Firewalls and Ports
If a firewall or router exists between your cache clients, cache servers, management interfaces, or NCache Cloud Portal, you must allow the required TCP ports to ensure uninterrupted communication. NCache uses designated ports for client connectivity, Web Management, NCache Cloud Portal access, cache management, inter-node cluster communication, Bridge operations, and monitoring. Blocking required ports can result in connectivity, management, clustering, or monitoring failures. Only the ports required for your deployment need to be opened, based on the NCache features and communication paths in use.
Important
For firewall configurations, allow TCP ports 9800–9999 as a range. This range covers the NCache Service, management and monitoring, Bridge, CacheHost, cache cluster, RESP Server, and NCache Cloud Portal communication ports.
NCache Server uses the following TCP ports for communication.
NCache Ports Necessary for Client-to-Server Communication
Client/Server Port: 9800 (Default TCP port for cache client and server communication).
Management and Monitoring Ports: 9801–9815 (Default port range used for NCache management and monitoring communication).
Web Management Port HTTP: 9801 (Default HTTP port for accessing NCache Management Center).
Web Management Port HTTPS: 9802 (Default HTTPS port for accessing NCache Management Center).
Cache Management Port (RPC): 9803 (Default TCP port used for cache management RPC communication).
Metrics Server / Service Health Check Port: 9804 (Default TCP port used by the Metrics Server and Service Health Check).
Execution Service Port: 9805 (Default TCP port used by the Execution Service).
CacheHost Ports: 9831–9880 (Default TCP port range used by CacheHost processes).
Cache Cluster Ports: 9881–9980 (Default TCP port range used for communication among cache cluster nodes).
RESP Server Ports: 9981–9989 (Default TCP port range used by the RESP Server).
NCache Cloud Portal Ports: 9998–9999 (Default port range used by the NCache Cloud Portal).
HTTPS: 9998 (Default HTTPS port for accessing the NCache Cloud Portal).
HTTP: 9999 (Default HTTP port for accessing the NCache Cloud Portal).
Note
When NCache Management Center is accessed through an HTTPS load balancer, the load balancer forwards requests to the Web Management HTTP port 9801. The load balancer must support sticky sessions. When the NCache Cloud Portal is accessed through an HTTPS load balancer, the load balancer forwards requests to the Cloud Portal HTTP port 9999. The load balancer must support sticky sessions.
NCache Bridge Management Ports
If you want to use a bridge, open the following ports:
Bridge Ports: 9816–9830 (Default port range used for NCache Bridge communication).
Bridge Client Port: 9816 (Default TCP port used by Bridge clients).
Bridge Management Port (RPC): 9817 (Default TCP port used for Bridge management communication).
Bridge Cluster Ports: 9818–9830 (Default TCP port range used for communication among Bridge nodes).
NCache Monitoring Ports
Grafana Server Port: 3000 (Default port at which the Grafana server runs).
Metrics Server / Service Health Check Port: 9804 (Default TCP port used by the Metrics Server and Service Health Check).
Note
During the installation process, NCache lets you automatically enable access to these ports, using the Enable firewall ports using NCache option.
Modifying the NCache Port Range
If there is a port conflict and the above default ports are being used by other applications, then you must configure all the cache servers to use different ports.
Important
If all ports in the configured CacheHost management port range are occupied, cache creation fails and NCache displays an error indicating that a custom management port is required. The NCache Service remains responsive. In this case, manually add the cache configuration to config.ncconf and assign a management port to the same cache in CacheHostPorts.xml located at %NCHOME%\bin\service. The cache must be present in both files.
Step 1: Modify the service configuration file for Ports
You can also change ports by modifying the service configuration file of all servers. This file is found in the NCache installation as follows:
- Windows: Alachisoft.NCache.Service.dll.config located in
%NCHOME%\bin\service. - Linux: Alachisoft.NCache.Daemon.dll.config located in
/opt/ncache/bin/service.
Change the Port for Client/Server communication and Management Port for NCache management in the file below.
<appSettings>
...
<add key="NCacheServer.Port" value="9800"/>
...
<add key="NCacheServer.ManagementPort" value="9803"/>
...
</appSettings>
Step 2: Restart NCache Service
For the configuration changes made to take effect, restart NCache Service. Make sure you have enough privileges to restart the service. For Windows, if the user is not a member of the Administrators group, make sure to run Windows PowerShell as administrator, or you might get an error message that "Cannot open ncachesvc service on computer."
Execute the following command in PowerShell to restart NCache Service:
Restart-Service -Name NCacheSvc
For Linux, use the native system command to restart the NCache Daemon service. Run the following command:
sudo systemctl restart ncached.service