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.
[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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment