Skip to content

Instantly share code, notes, and snippets.

@danielbodnar
Forked from mpdroog/systemd chrome
Created October 22, 2025 03:58
Show Gist options
  • Select an option

  • Save danielbodnar/71d82a944e7a87ea5dba4a14153c7d61 to your computer and use it in GitHub Desktop.

Select an option

Save danielbodnar/71d82a944e7a87ea5dba4a14153c7d61 to your computer and use it in GitHub Desktop.

Revisions

  1. @mpdroog mpdroog created this gist Jul 21, 2019.
    29 changes: 29 additions & 0 deletions systemd chrome
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    [Unit]
    Description=Headless Chrome
    Requires=network.target
    After=multi-user.target

    [Service]
    LimitNOFILE=100
    Restart=on-failure
    Type=simple

    ExecStart=/usr/bin/chromium-browser --temp-profile --headless --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage --remote-debugging-port=9222 --hide-scrollbars
    User=chrome
    Group=chrome

    # Strip off all privileges
    NoNewPrivileges=true
    RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6

    # Rigid filesystem protection
    ProtectSystem=full
    ProtectHome=true
    PrivateDevices=true
    Environment=HOME=/tmp

    # CGroup ruling
    MemoryLimit=128M

    [Install]
    WantedBy=multi-user.target