How to disable ubuntu desktop

Hi,
How to disable ubuntu18.04 desktop on NX module?

To disable GUI on boot, run:

sudo systemctl set-default multi-user.target

To enable GUI again issue the command:

sudo systemctl set-default graphical.target

Thanks.