Opening jupyter from terminal

I try to open Jupyter from the command line but when the browser pops up it gives me an error and does not open. What I am able to do is copy and paste a link from the terminal in the terminal and then it opens up perfectly. The browser that I am using is firefox.