I would like to open a URL from the command line and have this open as a new tab or window in an already running and responding instance of Firefox. I'm using Debian's Sid branch. If I do the following:

In term 1:

$ firefox

In term 2:

$ firefox 'http://www.google.com'

Update: I've also tried -new-tab and -new-window, but I get the same result.

$ firefox -new-tab 'http://www.google.com'

I get the message:

Firefox is already running, but is not responding. To open a new window, 
you must first close the existing Firefox process, or restart your system.

This has been discussed before (e.g. here and here), however, I do not want to kill the existing instance of Firefox (it's doing just fine) and I don't want to use a different profile. This works seamlessly with Google Chrome.

  • 1
    If Firefox is your default browser, you can use xdg-open, which opens any file with its associated application.
    – AFH
    Oct 20 '14 at 19:23

Use the --new-window or --new-tab command line options:

firefox --new-window 'http://www.google.com'
firefox --new-tab 'http://www.google.com'

See https://superuser.com/questions/699127/firefox-command-line-arguments/699128#699128 and Mozilla documentation

NOTE: firefox has switched to dash-dash -- style for the command line options.

  • 3
    Not sure why, but I get the same result with -new-tab/-new-window.
    – oneself
    Oct 20 '14 at 20:21
  • Maybe you have a preference setting that conflates them.
    – Barmar
    Oct 20 '14 at 20:22
  • I tried moving the ~/.mozilla dir out of the way and have Firefox recreate the default config. Same behavior. Are there any other settings that might influence this behavior?
    – oneself
    Oct 20 '14 at 23:32
  • I think I discovered the culprit. I have MOZ_NO_REMOTE=1 set in my init file. Removing this fixed the problem. Thanks for your help.
    – oneself
    Oct 20 '14 at 23:38
  • 1
    careful with the long options: they start with two dashes, such as: --new-tab Mar 1 '15 at 16:30

I have the following line in my init file:

export MOZ_NO_REMOTE=1

This effectively prevents Firefox from doing exactly what I was trying to do. Removing this fixed the problem.

  • 5
    What is the init file you are referring to? Thanks. Oct 5 '15 at 8:57
  • 1
    Note that setting export MOZ_NO_REMOTE=0 instead is a wrong track, since both lines are synonyms. I got messed up with that XD
    – iago-lito
    Sep 20 '18 at 11:38

Create a file LaunchFireFox.sh with the line below:

xargs -a ff_url.txt firefox -new-tab "$line"

In a separate file ff_url.txt:


and any additional web pages.


For those of us using Wayland

This symptom might be due to wayland/xwayland issues (firefox's buglist).

What worked for me:

I'm running Sway, with MOZ_ENABLE_WAYLAND=1 set, and added the below to ~/.config/environment.d/<my-sway-config>.conf:


The above is equivalent to running the below inside a bash shell:


Thereafter, all links clicked in other programs opened up in Firefox without issues. As expected. Thanks to Martin Stransky for getting me on the correct track!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.