Skip to content

Instantly share code, notes, and snippets.

@npyoung
Last active October 9, 2019 06:46
Show Gist options
  • Save npyoung/b10dcbd258787ef8cf06ad558450abf8 to your computer and use it in GitHub Desktop.
Save npyoung/b10dcbd258787ef8cf06ad558450abf8 to your computer and use it in GitHub Desktop.
Run jupyter lab as a userspace service
# Place this in ~/.config/systemd/user
[Unit]
Description=Code Server IDE
After=network.target
[Service]
Type=simple
EnvironmentFile=/home/ubuntu/.profile
WorkingDirectory=/home/ubuntu
Restart=on-failure
RestartSec=10
ExecStart=/home/ubuntu/bin/code-server --no-auth --port 8080 /home/ubuntu
[Install]
WantedBy=multi-user.target
# Run these lines in the terminal
sudo loginctl enable-linger "$USER";
for svc in "jupyterlab" "codeserver"; do
systemctl --user enable $svc;
systemctl --user start $svc;
done;
# Place this in ~/.config/systemd/user
[Unit]
Description=Service to run JupyterLab in user space
[Service]
Type=simple
ExecStart=/bin/bash -c "source ~/.profile; eval jupyter-lab"
WorkingDirectory=/home/ubuntu
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment