Question: I am trying to run `gedit` from an SSH terminal on Windows, connected to an Amazon EC2 instance running Ubuntu 12.04 Server and I am getting this error:

```
Cannot open display:

```

How do I fix it?

Answer: 
Since you are using Windows on your side, you will need an SSH-client that runs a local X server on Windows to run graphical applications from the server remotely on your screen. 

From experience, I would recommend the free [MobaXTerm](http://mobaxterm.mobatek.net/) which has this functionality built-in. Please download it and give it a try:

![enter image description here](https://i.stack.imgur.com/r0NuO.png)

If you get any errors, that's because sometimes a minimal server image may not be set up to *allow* X-forwarding into it. In that case, please comment and I'll help you solve it; I've done this with lots of minimal VPSs running Ubuntu/Debian.
[What con-f-use said](https://askubuntu.com/a/175688/527764).

Basically you have a terminal through SSH and Gedit is a GUI program. con-f-use's answer will make it work from a Linux GUI client session. 

The other option would be to use a non GUI editor like nano, Vi or numerous others.