Is it possible to install Firefox on Ubuntu with no desktop enviroment?

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.


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.


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.


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.