Skip to content

Changing the Hostname

By default, WSO2 products identify the hostname of the current machine through the Java API. However, it is recommended to configure the hostname by setting the hostname parameter in the deployment.toml file of each runtime (API-M or Micro Integrator).

Changing the API-M hostname

Follow the steps given below.

  1. Update the deployment.toml file.

    1. Open the <API-M_HOME>/repository/conf/deployment.toml file

    2. Define the hostname attribute under server configurations as shown below.

      hostname = "{hostname}"
      hostname = ""

      Replace {hostname} with the Hostname or IP address of the machine hosting this server. This becomes part of the endpoint reference of the services deployed on this server instance.

    3. Configure the Developer Portal URL, which is used to access the Developer Portal via the Publisher.

      Uncomment the following configuration and define the hostname.

      url = "https://<hostname>:${mgt.transport.https.port}/devportal"
  2. Generate a key store, export the public certificate from the keystore, and import that certificate to the client­-truststore.jks file.

    For more information, see Creating New Keystores.

  3. Restart the server.

  4. Map the hostname alias to its IP address in the /etc/hosts file of your system as shown below.


    You need this when the host is internal or not resolved by a DNS,       localhost
    <ip_address>    <hostname>


After you change the hostname, if you encounter login failures when trying to access the API Publisher and API Developer Portal with the error Registered callback does not match with the provided url, see 'Registered callback does not match with the provided url' error in the Troubleshooting guide.