Knowledge Base
Searching in : Article
ID: AR05T01160
Applies to: NoMachine Server
Added on: 2022-05-02
Last Update: 2025-04-15

Reinstalling or migrating to a new machine and keeping the current configuration

This article applies to NoMachine 8 installations and later.

It's possible to make a backup of the current configuration of a server installation by running the following command. This works for all NoMachine server types, included the Free Edition and for Terminal Server Node installations.

On Linux and macOS:
$ /etc/NX/nxserver --configsave

On Windows:
> cd C:\Program files (x86)\NoMachine\bin\
C:\Program Files (x86)\NoMachine\bin> nxserver --configsave

This command creates a zip archive of the current configurations:
- server and node.cfg
- redis DB
- NoMachine keys and certificates

List of copied files:

Linux
/usr/NX/etc/server.cfg
/usr/NX/etc/node.cfg
/usr/NX/etc/nxdb
/usr/NX/etc/uuid
/usr/NX/etc/keys - whole directory
/var/NX/nxhtd/.nx/config/client.crt
/var/NX/nx/.nx/config/client.crt
/var/NX/nx/.ssh/known_hosts

macOS
/Applications/NoMachine.app/Contents/Frameworks/etc/server.cfg
/Applications/NoMachine.app/Contents/Frameworks/etc/node.cfg
/Applications/NoMachine.app/Contents/Frameworks/etc/nxdb
/Applications/NoMachine.app/Contents/Frameworks/etc/uuid
/Applications/NoMachine.app/Contents/Frameworks/etc/keys
/Library/Application Support/NoMachine/var/nx/.nx/config/client.crt
/Library/Application Support/NoMachine/var/nx/.ssh/known_hosts
/Library/Application Support/NoMachine/var/nxhtd/.nx/config/client.crt

Windows (depending on the destination folder)
<NX-destination-folder>\etc\server.cfg
<NX-destination-folder>\etc\node.cfg
<NX-destination-folder>\etc\nxdb
<NX-destination-folder>\etc\uuid
<NX-destination-folder>\etc\keys
C:\Users\nx\.nx\config\client.crt
C:\Users\nx\.ssh\known_hosts
C:\ProgramData\NoMachine\nxhtd\.nx\config\client.crt
 

The configuration archive is saved in the directory where the 'nxserver --configsave' command is executed and it is named in the following format: NoMachine-configuration-bck-<timestamp>.zip, e.g. NoMachine-configuration-bck-2022.05.23-09.56.47.zip

You can change location by providing the  --path <path> option:
nxserver --configsave --path path_to_directory

When to use the configuration backup

1) To preserve custom configurations, when it's necessary to uninstall the current server for whatever reason and install it again.
 
2) To migrate the current server installation to a different machine, even running a different Operating System. (E.g. migrate from Windows to Linux).

3) In the case of multi-node setup, to preserve the current list of nodes and avoid readding and configuring them manually after a reinstall or a host migration.

How to restore the configuration backup

Once NoMachine server is installed, run the following command:

On Linux and macOS:
$ /etc/NX/nxserver --configrestore --path <path>

On Windows:
> cd C:\Program files (x86)\NoMachine\bin\
C:\Program Files (x86)\NoMachine\bin> nxserver --configrestore --path <path>