How do I open Chromium in incognito mode by default?

I assume you mean the Chromium Web Browser.

You have to change one line in the chromium-browser.desktop file. The best is to do that locally:

  1. Copy the file from /usr/share/applications to /home/yourname/.local/share/applications
  2. Open the file with gedit (open gedit and drag the local desktop file on to the gedit window)
  3. Find the first line in the file that begins with Exec=
  4. Replace the line by Exec=chromium-browser --incognito

a few remarks:

  • The folder /home/yourname/.local/share/applications is a hidden folder by default. To make it visibe: go to your home folder, type ctrl + h, the .local folder will appear.

  • You can copy the chromium-browser.desktop file to your local folder with the command: cp /usr/share/applications/chromium-browser.desktop ~/.local/share/applications/chromium-browser.desktop

  • You might have to log out and back in before the changes to take effect.


There are two steps,

  1. Run sudo update-alternatives --config x-www-browser and select /usr/bin/chromium-browser. This will make Chromium your system's default browser.
  2. Run sudo -e /etc/chromium-browser/default (edit as root), and change the line that reads CHROMIUM_FLAGS="" to CHROMIUM_FLAGS="--incognito".

That's it. Changes are instantaneous.

Also, if you ever want to open chrome without incognito mode, just hold Ctrl + n in incognito mode.

See also,

  • Where can I configure Chromium's default command line arguments?

This is how I do it using alacarte (main menu). Install alacarte (aka main menu) from the Ubuntu Software Center if you don't already have it. Launch it.

On the left hand side, under Menus, make sure Applications is expanded. Look for Internet. Single click it. Now look for Chrome under Items. Single click it. Look for Properties on the right hand side. Single click it. A little window appears. (I've dragged it to the right for clarity.) Look for Command. For me, I see /opt/google/chrome/google-chrome %U.

using alacarte

Carefully change that to: /opt/google/chrome/google-chrome --incognito %U

Click Close on the little window and then click Close on the Main Menu window. You need to log out and log in to make the change register.

You're done.

(I just did it so I know it works.)

Tags:

Chromium