Start a GUI Application on a Remote Computer using SSH

This article describes how to log into the remote computer (server) using SSH and run a GUI (graphical) application that requires screen. The GUI program will be displayed on the physical monitor, connected to that remote machine.

Run a GUI Program on a Remote Computer's Screen

The Basic Procedure

Log into a remote machine using SSH :

$ ssh

Tell GUI applications to be launched on the local screen (so, any graphical program that you run, will be displayed on the remote computer's screen) :

$ export DISPLAY=:0

Execute GUI Program. For, example lets start Firefox browser that will be launched and displayed on the remote machine's screen in which we logged in :

$ firefox ""

Use nohup to prevent a process from being stopped after closing SSH session :

$ nohup firefox ""

More Examples

Send a pop-up notification (notify-send) that will be shown on the remote computer's screen :

$ ssh 'DISPLAY=:0 nohup notify-send "Hello" "World"'

Start a music player (rhythmbox) on the remote computer :

$ ssh 'DISPLAY=:0 nohup rhythmbox ./Smoke-on-the-Water.mp3'