title: Long running Jupyter notebook/lab?
body: <p>I have Jupyter running in a tmux session on an ec2 instance. I have very long-running cells, but when I close my browser or laptop lid, the notebook no longer writes output cells (and may crash the python kernel).</p>
  
  <p>This is how I launch labs on my remote instance:</p>
  
  <pre><code>jupyter lab --ip=0.0.0.0 --port=5002 --no-browser --allow-root
  </code></pre>
  
  <p>I'm looking for a solution to run a notebook indefinitely without losing data and without having to keep my local computer on.</p>
  
  <ul>
  <li>I don't want to use a VNC or X-windows forwarding (too slow)</li>
  <li>I don't want to rewrite my code into python scripts (need work only in jupyter labs) </li>
  </ul>
  
  <p>There has got to be a solution out there!</p>
  
  <p><strong>Update:</strong></p>
  
  <p>The 'nohup' solution below doesn't work:</p>
  
  <p><a href="https://i.stack.imgur.com/PA7oE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PA7oE.png" alt="enter image description here"></a></p>
  
  <p>After running this cell and closing the browser, upon reopening there is no output:</p>
  
  <p><a href="https://i.stack.imgur.com/SJYVL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SJYVL.png" alt="enter image description here"></a></p>