Skip to content

Instantly share code, notes, and snippets.

@florianb
Last active May 6, 2024 11:37
Show Gist options
  • Select an option

  • Save florianb/d86e1ab4f5ca7a1f828a3bb3913d15de to your computer and use it in GitHub Desktop.

Select an option

Save florianb/d86e1ab4f5ca7a1f828a3bb3913d15de to your computer and use it in GitHub Desktop.
Livebook.dev Systemd Service
[Unit]
Description=Livebook Server
After=docker.service
Requires=docker.service
[Service]
User=livebook
Group=livebook
Restart=always
ExecStartPre=-/usr/bin/docker stop livebook
ExecStartPre=-/usr/bin/docker rm livebook
ExecStartPre=/usr/bin/docker pull ghcr.io/livebook-dev/livebook
ExecStart=/usr/bin/docker run --name livebook -u 1001:1001 -e "LIVEBOOK_PASSWORD=" -p 8080:8080 -p 8081:8081 -v /home/livebook:/data ghcr.io/livebook-dev/livebook
ExecStop=/usr/bin/docker stop livebook
[Install]
WantedBy=multi-user.target
@florianb
Copy link
Copy Markdown
Author

florianb commented May 6, 2024

This Unit file requires the user "livebook" (UID/GID: 1001) being able to run docker which might be a security issue: https://docs.docker.com/engine/install/linux-postinstall/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment