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

command linefirefox

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.

Best Answer

  • 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.

  • Related Question