I want to open my chromium web browser in fullscreen-mode and open an URL that I get from a different config file. All this should happen automatically after booting. For testing, I tried to execute a terminal command in python first of all with

import os
import webbrowser
os.system(chromium-browser --start-fullscreen www.google.de)

But it throws an invalid syntax error.

Is there a possibility to start the browser with something different than with a systemd service file?

I am running this on an RPI 4 with the newest version of Raspbian.
Thank you for your advice

2 Answers 2


I would use the service as per the other answer as os.system() is no longer the preferred way of calling external programs.

If you do wish to put the command into a python program using os.system() then you could use:

import os
cmd = "/usr/bin/chromium-browser --start-fullscreen www.google.de"

The advantage of Python is that it is much simpler to handle error checks / reporting (code snippet - will not work fully):

    retcode = call(cmd, shell=True)
    if retcode < 0:
        print("Browser was terminated", -retcode, file=sys.stderr)
        print("Browser returned", retcode, file=sys.stderr)
except OSError as e:
    print("Execution of the browser failed:", e, file=sys.stderr)

Note the use of sys.stderr to get the completion status back from the browser.


Create a service file:

sudo nano /etc/systemd/system/startupbrowser.service  

Put all lines below there:


ExecStart=/usr/bin/chromium-browser --start-fullscreen www.google.de


Enable the new service and reboot the raspberry pi:

sudo systemctl enable startupbrowser.service 
sudo systemctl reboot  


  • Better not to fiddle direct with systemd system files in /etc/systemd/system/. It is less error prone using systemctl edit with its options, in particular if you have drop in files.
    – Ingo
    Apr 3, 2020 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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