OpenBSD: Install Firefox Web Browser

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

More links and information

  1. man pkg_add
  2. OpenBSD FTP mirror list

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • Richard Thornton Nov 11, 2011 @ 20:01

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



  • Jim May 21, 2012 @ 14:07

    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”

    • GTFO May 28, 2014 @ 19:33

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


      In X terminal type:

      /usr/local/bin/firefox &

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum