16

I want to install firefox on a Ubuntu server that currently has no graphical desktop environment. Is it possible to install some minimal display management tools that will allow me to launch graphical firefox (or any other graphical browser capable of displaying websites in not text-only mode)?

Unfortunatelly, lynx, links and similar text-only browsers are not good enough.

  • 3
    Graphical environment and "desktop" are two different things. Instead of a desktop (like KDE or Gnome, with icons &c - basically a wannabe Windoze), you can install a window manager, which will allow you to run basically any graphical application. I am writing this in Firefox on OpenSuSE, running the FVWM2 window manager. – jamesqf Jun 13 at 5:14
40

You can install any package available in the repositories using APT. APT is responsible for satisfying dependencies.

Counter-intuitively, the Firefox package does not depend on the X server (or Wayland) which is needed to display it. When I tried to run Firefox without X server running, I got:

$ firefox
Error: no DISPLAY environment variable specified

So to install required packages to display Firefox, issue:

sudo apt install firefox xorg

Then you can run:

startx
firefox

to get a very basic Firefox window (even without the ability to resize or close it etc. by the usual means).

You can exit Firefox by pressing Ctrl+Q. Then run exit to quit X server.

  • 29
    To elaborate more: If you are connecting to the station remotely via SSH, you can also just tunnel the X protocol through. Then you do not need to install the Xserver on the remote machine (just install the xauth component) because the X session is tunneled to Xserver on your station. So you can actually run the firefox on the remote machine, but the window is displayed on your local machine. See for example this discussion unix.stackexchange.com/q/12755/37669 . – Fiisch Jun 12 at 17:24
  • 9
    Firefox doesn't require xorg, because you can run firefox in headless (no GUI) mode. – OrangeDog Jun 13 at 11:01
  • 5
    It depends on an X server. By the nature of the X protocol, that server just doesn't have to be running on the local host, so it's not an installation requirement. – chepner Jun 13 at 15:04
3

You may want to try Browsh (https://www.tecmint.com/browsh-text-web-browser-for-linux):

Browsh is an open source, simple and modern text-based browser that renders in TTY terminal environments. It is made up of a minimal Golang CLI front-end and a browser web-extension (headless Firefox) which actually offers most of the functionality to create a purely text-based version of web pages and web apps.

  • This looks like a fun experiment. But I have to add that I've encountered some issues when trying to use it. First of all, the website you linked provides an old version of browsh, I found the latest here: github.com/browsh-org/browsh Second of all, it does not seem to work with the latest firefox version - I had to download from Firefox ftp server: ftp.mozilla.org/pub/firefox/releases It is a fun little experiment that will definitely not replace normal full scaled browser and is too complex for text-browser tasks, but as I said, it looks fun to play around with. – deimos Jun 13 at 16:03
  • Ah, and it also crashes when I try to open askubuntu.com. Crashes and completely messes up my terminal, printing every change of mouse pointer location :D Reddit opens fine, tho. – deimos Jun 13 at 16:09
  • 1
    @deimos you can bring back your terminal to a sane state with the reset command. – Ruslan Jun 14 at 10:39
1

Firefox (or any other desktop application for that matter) doesn't have a dependency to graphical desktop environment, because there's no need to have it installed locally. You can install Firefox on your server and connect to it from a GUI machine using ssh -y, and when you start Firefox from that SSH session, you will get Firefox running on your Ubuntu server, while its window will be displayed on the GUI machine.

Additionally, there are browsers which can render graphics directly, not relying on X/Wayland. For example, OWB and Netsurf have SDL frontends.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.