OpenBSD: Install Firefox Web Browser

last updated in Categories

How do I install Mozilla Firefox which is a free and open source web browser under OpenBSD operating systems?

You can install Mozilla Firefox using the pkg_add command as follows. Open a command-line terminal. Switch to the root user by typing su – and entering the root password, when prompted. Type the following command:
# export PKG_PATH=`machine -a`/
# pkg_add -v mozilla-firefox

Sample outputs:


mozilla-firefox-3.6.13p3:nspr-4.8.7: ok                                                                                                         
mozilla-firefox-3.6.13p3:libiconv-1.13p2: ok                                                                                                    
mozilla-firefox-3.6.13p3:gettext-0.18.1p0: ok                                                                                                   
mozilla-firefox-3.6.13p3:pcre-8.02p1: ok                                                                                                        
mozilla-firefox-3.6.13p3:libgamin-0.1.10p3: ok                                                                                                  
mozilla-firefox-3.6.13p3:glib2-2.26.1p0: ok                                                                                                     
mozilla-firefox-3.6.13p3:desktop-file-utils-0.17: ok                                                                                            
mozilla-firefox-3.6.13p3:cairo-1.10.2: ok                                                                                                       
mozilla-firefox-3.6.13p3:pango-1.28.3p2: ok                                                                                                     
mozilla-firefox-3.6.13p3:libxml-2.7.8p1: ok                                                                                                     
mozilla-firefox-3.6.13p3:shared-mime-info-0.80: ok                                                                                              
mozilla-firefox-3.6.13p3:atk-1.32.0: ok                                                                                                         
mozilla-firefox-3.6.13p3:jasper-1.900.1p1: ok                                                                                                   
mozilla-firefox-3.6.13p3:gdk-pixbuf-2.22.1: ok                                                                                                  
mozilla-firefox-3.6.13p3:hicolor-icon-theme-0.12: ok                                                                                            
mozilla-firefox-3.6.13p3:gtk+2-2.22.1: ok                                                                                                       
mozilla-firefox-3.6.13p3:sqlite3-3.7.4: ok                                                                                                      
mozilla-firefox-3.6.13p3:nss-3.12.9: ok                                                                                                         
mozilla-firefox-3.6.13p3: ok                                                                                                                    
Look in /usr/local/share/doc/pkg-readmes for extra documentation.

You can start Firefox using the following command or GUI menu options:
$ /usr/local/bin/firefox &

Fig.01: Firefox 3.x running under OpenBSD 4.9/AMD64
Fig.01: Firefox 3.x running under OpenBSD 4.9/AMD64

More links and information

  1. man pkg_add
  2. OpenBSD FTP mirror list


Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

3 comment

  1. Can you run firefox with just the stock xdm environment or do you have to have gnome loaded?



  2. I was able to get Firefox installed on OpenBSD 5.1 using these instructions, so thank you for that. However, I can’t seem to start it. So per another page on this site, I entered $export $DISPLAY=:0 and then tried to launch it again. Now it says 12 times that “No protocol specified” and then on the 13th line it says “Error: cannot open display: :0”

    1. Yes, login to your terminal and start GUI using startx command:


      In X terminal type:

      /usr/local/bin/firefox &

    Still, have a question? Get help on our forum!