error on linux "Failed to open display"

I am no expert however I have been trying to install LibreOffice on a dedicated server Linux 64 bits CENTOS 7.6 but I am getting the message “Failed to open display” so I can’t use it any help on this would be appreciated.

Are you logging on remotely, over a SSH session perhaps?

Yes but how should I login it is a dedicated server with a hosting company? As I say I am a novice at this so some help would be appreciated

Are you logging on using ssh -X . You need to use an X session to open GUI applications from the server. This assumes that the server’s ssh server is configured to support X and that your client is Unix or that you have an Xserver installed to your client operating system. Does the error message have anything else to say?

I will try this thanks

As @carnish said ssh needs “X11 forwarding” (ssh -X) to work on a remote display through an ssh tunnel.

However this will be possibly really slow. You may want to try, if it’s possible, to start a VNC server on the remote and connect to it from a vncviewer on the local machine (either through ssh [using ssh -L 5901:127.0.0.1:5901 or similar] or directly) as it is usually way faster. If you do this you can start LO after you logged into the server and it will use its “virtual” display.

Hi all we are trying to do is use LibreOffice to convert Word and Excel files to pdfs when they are uploaded. Will this still be slow as we are actual not using it remotely? I am really confused about all this. Apparently this works but not for us.