How to enable Webgl in Firefox on Ubuntu

By | January 4, 2023


WebGL (Web Graphics Library) is a JavaScript API for rendering interactive 3D graphics and 2D graphics[2] within any compatible web browser without the use of plug-ins.

It is analogous to a 3D graphics api like OpenGL but runs inside a web browser and programmed in javascript instead of C or C++.

The important thing to know that is use the gpu for hardware acceleration of 3D graphics. So it allows the browser to utilise the power of dedicated graphics card like rtx3060. If a dedicated graphics card is not present, it should use the integrated gpu from the cpu.

Software based renderer

Note: You should not need to do any of the below if you are using the latest version of Ubuntu and Firefox.

The 'webgl.osmesalib' parameter has been deprecated and removed from latest versions of Firefox

Check the following url:

***** OLD *****

Webgl might not work directly on your system if there is no supporting hardware or graphics card available. Even then webgl can be made available inside firefox through the software based OpenGL renderer like MESA.

To enable it following steps below. Install the Mesa off-screen rendering extension

$ sudo apt-get install libosmesa6

Next find out the location of the library installed by the package.

Use the dpkg-query command for this.

$ dpkg-query -L libosmesa6

On my system it was located at the following location for example


The actual location on your system can be different.

Now open firefox and do the following

1. Go to about:config
2. Search for webgl.osmesalib
3. Type in the path of the mesa library in the value of this preference.
4. Restart firefox

Test it

Now open the following url

It would say "Your browser supports WebGL" and play a spinning cube animation.

Cssdeck also has a webgl item here

For technical information about webgl support in firefox check

It should say Yay and display additional information about the webgl support.

If they all work fine, then webgl is enabled properly.


The above method is now deprecated and should not be needed on any modern system with a capable igpu or graphics card.

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].


How to enable Webgl in Firefox on Ubuntu
  1. ed

    installed as proposed (thinkpad t430s, firefox 88.0, linux mint cinnamon 20.1, webGL not working). search for goes on forever without result. what is found is this:

    in about:config webgl.osmesalib cannot be found. the site loads forever and stays empty. sorry, but this method does not work here to help me getting webGL work on my notebook.

Leave a Reply

Your email address will not be published. Required fields are marked *