The most light-weight setup, to have a long-running GUI application on Linux server, is to simply use a vncserver, then run the application after connected to the vncserver. This way you don't have to install many of the X11-related packages, and memory footprint is considerablly smaller.
Step 1: Install vncserver and a window manager of your choosing (I use icewm).
apt install xterm xfonts-base xfonts-scalable tightvncserver icewm sakura
Where sakura is a light-weight terminal emulator that I prefer.
Step 2: Create init files for vncserver session.
You could also create a vnc password by running
Step 3: Run vncserver
vncserver :1 -depth 24 -geometry 1280x800 -localhost -interface lo -nolisten tcp
Vncserver will listen on localhost:5901, and you're pretty much done at the server side. You could also make it a systemd service instead:
sudo tee /etc/systemd/system/vncserver@.service <<EOF
To connect to the vncserver, you'll need to forward the vnc connection to localhost:5091 on the server side via a ssh tunnel:
ssh -L 5901:localhost:5901 -C -N server_ip
On Mac OS, I recommend Secure Pipes which is a great tool for managing multiple tunnels and keeping connections alive.
Now use any vnc client and connect to
localhost:5901, you'll be connected to the vncserver. On Mac OS, simply launch Screen Sharing from spotlight, it's a fairly good vnc client.