NoMachine Support

Your questions answered

Knowledge Base

Searching in: Articles & FAQs
Filter the search results
Applies to:
Last update:
Searching in: Articles & FAQs
ID: AR06N00888
Applies to: NoMachine Server
Added on: 2016-06-09
Last update: 2017-01-13
How to set port for web connections if NoMachine is configured to listen on a non-default port

This article applies to connections by the web via NX protocol

Settings for web connections are stored in: 

a) for v. 6 or later:

the server configuration file (server.cfg)

E.g. on Linux /usr/NX/etc/server.cfg

b) for v. prior to 6:

the cloud configuration file (cloud.cfg)

E.g. on Linux /usr/NX/etc/cloud.cfg


By default web sessions using the NX protocol connect on default port 4000.

If the NoMachine network daemon (nxd) is configured on the server to listen on a different port, it's necessary to modify the web connection settings as it follows:

1) Change the Port value in the configuration file to fit the port on which nxd is listening.

For example, if the Network service is listening on port 4040, set in the configuration file:

Section "Server"

Name "Connection to localhost"
Host localhost
Protocol NX
Port 4040

EndSection

Note:
this applies also if the NoMachine server is configured to connect web sessions on hosts different from localhost. In this case the Section "Server" will look like:

Section "Server"

Name "Testdrive"
Host testdrive.nomachine.com
Protocol NX
Port 4040

EndSection

See: https://www.nomachine.com/AR07K00679
for more instructions about how to configure NoMachine servers to connect web sessions on different hosts

2) Update the client.crt file, on Linux /var/NX/nxhtd/.nx/config/client.crt,  to have:

Host:localhost 4040
-----BEGIN CERTIFICATE-----
(...)
-----END CERTIFICATE-----
Host:127.0.0.1 4040
-----BEGIN CERTIFICATE-----
(...)
-----END CERTIFICATE-----

Note:
If the NoMachine server is configured to connect web sessions on different hosts, its client.crt certificate must be updated to include the nxd certificates from such server hosts.

In this case, specify the port, if different from the default one, for each server certificate.

For example:

Host:localhost 4040
-----BEGIN CERTIFICATE-----
(...)
-----END CERTIFICATE-----
Host:127.0.0.1 4040
-----BEGIN CERTIFICATE-----
(...)
-----END CERTIFICATE-----
Host:testdrive.nomachine.com 4040
-----BEGIN CERTIFICATE-----
(...)
-----END CERTIFICATE-----