DEV Community

2

Start a Jupyter notebook server in an AWS AMI to run python

Note: This notebook is considered a continuation of the previous post. You can see it on dev from here, or on medium from here

Introduction

  • A Jupyter notebook server must be running in order to create and run Jupyter notebooks.
  • The AWS Deep Learning AMI that the virtual machine is built from includes the Jupyter notebook server, in addition to many commonly used packages for machine learning.
  • In this post, you will start a Jupyter notebook server.

Start a Jupyter notebook

Step 1

In your SSH shell, enter the following command to start the Jupyter notebook server in the background:

nohup jupyter notebook &
Enter fullscreen mode Exit fullscreen mode
  • The nohup command, stands for no hangup and allows the Jupyter notebook server to continue running even if your SSH connection is terminated.
  • After a couple seconds a message about writing output for the process to the nohup.out file will be displayed:

Image description

  • Press enter to return to the shell prompt.
  • This will allow you to continue to enter commands at the shell prompt.

Step 2

Press enter to move to a clean command prompt, and tail the notebook's log file to watch for when the notebook is ready to connect to:

tail -f nohup.out
Enter fullscreen mode Exit fullscreen mode

The notebook is ready when you see The Jupyter Notebook is running at:...

Image description

Step 3

Press ctrl+c to stop tailing the log file.

Step 4

Enter the following to get an authenticated URL for accessing the Jupyter notebook server:

jupyter notebook list
Enter fullscreen mode Exit fullscreen mode
  • By default, Jupyter notebooks prevent access to anonymous users. - After all, you can run arbitrary code through the notebook interface.

Image description

  • The token URL parameter is one way to authenticate yourself when accessing the notebook server.
  • The /home/ubuntu at the end of the command indicates the working directory of the server.
  • The Jupyter notebook server is now up and running.



GitHub
LinkedIn
Facebook
Medium

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Best Practices for Running  Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK cover image

Best Practices for Running Container WordPress on AWS (ECS, EFS, RDS, ELB) using CDK

This post discusses the process of migrating a growing WordPress eShop business to AWS using AWS CDK for an easily scalable, high availability architecture. The detailed structure encompasses several pillars: Compute, Storage, Database, Cache, CDN, DNS, Security, and Backup.

Read full post