Changing the Ports of WSO2 Servers

so2You will run into many instances where you need to run multiple WSO2 products or multiple instances of the same product in the same environment. In these instances, the operating ports of the servers need to be changed.

This can be done mainly in two ways:

(01) Setting the port in the carbon.xml

Open the


and change the value between the < Offset > tags. It is by default 0, if you change the value to 5, the server will run on port 9448.

Screenshot from 2017-03-09 00-27-21.png

(02) Passing the port offset during startup of the server

Running the following command with start the server on port 9448.

./wso2server.sh -DportOffset=2

In certain rare instances, the port has been hard coded instead of being extracted from the carbon.xml. If you receive a “java.net.BindException”, the best possible way is to run the following command to see if it the port value has been hard coded anywhere and then change them accordingly where needed.

grep -ril “9443”

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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