Skip to content

Instantly share code, notes, and snippets.

@dtsmith2001
Forked from jakechen/aws_jupyter_tunnel.md
Created November 19, 2019 14:30
Show Gist options
  • Save dtsmith2001/bd9fd91cfd38ebb8a86640ec213042c3 to your computer and use it in GitHub Desktop.
Save dtsmith2001/bd9fd91cfd38ebb8a86640ec213042c3 to your computer and use it in GitHub Desktop.

Revisions

  1. @jakechen jakechen revised this gist Sep 26, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -13,8 +13,8 @@ This current version assumes basic familiarity with cloud computing, AWS service
    5. Ensure the instance is assigned to a security group with SSH access.
    6. Launch your instance

    ### Start Jupyter Notebook and open SSH Tunnel
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    ### Open SSH Tunnel and start Jupyter Notebook
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your SSH connection string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    2. Start Jupyter Notebook in the background.
    1. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    2. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.
  2. @jakechen jakechen revised this gist Sep 26, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,8 @@ This current version assumes basic familiarity with cloud computing, AWS service
    ### Start Jupyter Notebook and open SSH Tunnel
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    2. Start Jupyter Notebook in the background.
    1. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    2. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.
    1. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    2. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.

    ### Tunnel into Notebook
    1. Open up any web browser and point it to http://localhost:8888 .
  3. @jakechen jakechen revised this gist Sep 26, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,8 @@ This current version assumes basic familiarity with cloud computing, AWS service
    ### Start Jupyter Notebook and open SSH Tunnel
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    2. Start Jupyter Notebook in the background.
    a. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    b. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.
    1. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    2. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.

    ### Tunnel into Notebook
    1. Open up any web browser and point it to http://localhost:8888 .
  4. @jakechen jakechen revised this gist Sep 26, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,8 @@ This current version assumes basic familiarity with cloud computing, AWS service
    ### Start Jupyter Notebook and open SSH Tunnel
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    2. Start Jupyter Notebook in the background.
    a. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    b. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.
    a. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    b. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.

    ### Tunnel into Notebook
    1. Open up any web browser and point it to http://localhost:8888 .
  5. @jakechen jakechen revised this gist Sep 26, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -13,14 +13,14 @@ This current version assumes basic familiarity with cloud computing, AWS service
    5. Ensure the instance is assigned to a security group with SSH access.
    6. Launch your instance

    ### Start Jupyter Notebook
    1. SSH into your newly launched instance. The command should look like `ssh -i "key.pem" [email protected]`
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.
    3. Exit your SSH session (optional).
    ### Start Jupyter Notebook and open SSH Tunnel
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    2. Start Jupyter Notebook in the background.
    a. We recommend using something like screen, tmux, or nohup to keep your notebook in the background even if you lose connection to your instance. Otherwise you may lose your in-progress models.
    b. Launch Jupyter Notebook using `jupyter notebook --no-browser`. The --no-browser flag prevents the server from launching a browser.

    ### Tunnel into Notebook
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    2. Open up any web browser and point it to http://localhost:8888 .
    1. Open up any web browser and point it to http://localhost:8888 .

    ## Conclusion
    That's it! Remember to spin-down your EC2 instance after you're done with it.
  6. @jakechen jakechen revised this gist Feb 22, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## Introduction
    This quick guide describes how to create a Jupyter Notebook on AWS then how to access it remotely using SSH tunneling. This method is preferred since you do not open any additional ports besides 22, requires little-to-no configuration, and is generally more straight-forward.
    This quick guide describes how to create a Jupyter Notebook in AWS EC2 then how to access it remotely using SSH tunneling. This method is preferred since you do not open any additional ports besides 22, requires little-to-no configuration, and is generally more straight-forward.

    ## Pre-requisites
    This current version assumes basic familiarity with cloud computing, AWS services, and Jupyter Notebook. Mostly because this version won't have images and won't dive too deep into each individual step.
  7. @jakechen jakechen revised this gist Feb 22, 2017. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -14,11 +14,12 @@ This current version assumes basic familiarity with cloud computing, AWS service
    6. Launch your instance

    ### Start Jupyter Notebook
    1. SSH into your newly launched instance. The command should look like `ssh -i key.pem [email protected]`
    1. SSH into your newly launched instance. The command should look like `ssh -i "key.pem" [email protected]`
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.
    3. Exit your SSH session (optional).

    ### Tunnel into Notebook
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i key.pem [email protected] -D -L localhost:8888:localhost:8888` .
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i "key.pem" [email protected] -D -L localhost:8888:localhost:8888` .
    2. Open up any web browser and point it to http://localhost:8888 .

    ## Conclusion
  8. @jakechen jakechen renamed this gist Feb 22, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion aws_jupyter.md → aws_jupyter_tunnel.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ## Introduction
    This quick guide describes the steps to create a Jupyter Notebook on AWS then tunnel into it. This method is preferred since you do not open any additional ports besides 22, requires little-to-no configuration, and is generally more straight-forward.
    This quick guide describes how to create a Jupyter Notebook on AWS then how to access it remotely using SSH tunneling. This method is preferred since you do not open any additional ports besides 22, requires little-to-no configuration, and is generally more straight-forward.

    ## Pre-requisites
    This current version assumes basic familiarity with cloud computing, AWS services, and Jupyter Notebook. Mostly because this version won't have images and won't dive too deep into each individual step.
  9. @jakechen jakechen revised this gist Feb 22, 2017. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions aws_jupyter.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ This quick guide describes the steps to create a Jupyter Notebook on AWS then tu
    This current version assumes basic familiarity with cloud computing, AWS services, and Jupyter Notebook. Mostly because this version won't have images and won't dive too deep into each individual step.

    ## Steps
    ### Spin up EC2 instance with "Deep Learning" AMI
    ### Spin-up EC2 instance with "Deep Learning" AMI
    1. Log into [EC2 console](https://console.aws.amazon.com/ec2) and click "Launch Instance" button.
    2. Inside "AWS Marketplace", select the "Deep Learning AMI" from AWS. I use this AMI because most of the stuff you'll need is installed already.
    3. Select instance type depending on your use case. The "Deep Learning AMI" has support for GPU-backed instance (e.g. g2 and p2) but it's not necessary to use these. Use the cheapest one for your workload (likely memory needed for your dataset).
    @@ -14,10 +14,12 @@ This current version assumes basic familiarity with cloud computing, AWS service
    6. Launch your instance

    ### Start Jupyter Notebook
    1. SSH into your newly launched instance.
    $ asdf
    $ asdf
    1. SSH into your newly launched instance. The command should look like `ssh -i key.pem [email protected]`
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.

    ### Tunnel into Notebook
    1. asdf
    1. Tunnel into your instance by adding `-D -L localhost:8888:localhost:8888` to your original SSH string. This should look like `ssh -i key.pem [email protected] -D -L localhost:8888:localhost:8888` .
    2. Open up any web browser and point it to http://localhost:8888 .

    ## Conclusion
    That's it! Remember to spin-down your EC2 instance after you're done with it.
  10. @jakechen jakechen revised this gist Feb 22, 2017. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions aws_jupyter.md
    Original file line number Diff line number Diff line change
    @@ -15,10 +15,8 @@ This current version assumes basic familiarity with cloud computing, AWS service

    ### Start Jupyter Notebook
    1. SSH into your newly launched instance.
    ```
    $ asdf
    $ asdf
    ```
    $ asdf
    $ asdf
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.

    ### Tunnel into Notebook
  11. @jakechen jakechen revised this gist Feb 22, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion aws_jupyter.md
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,8 @@ This current version assumes basic familiarity with cloud computing, AWS service
    ### Start Jupyter Notebook
    1. SSH into your newly launched instance.
    ```
    asdf
    $ asdf
    $ asdf
    ```
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.

  12. @jakechen jakechen revised this gist Feb 22, 2017. 1 changed file with 8 additions and 7 deletions.
    15 changes: 8 additions & 7 deletions aws_jupyter.md
    Original file line number Diff line number Diff line change
    @@ -5,19 +5,20 @@ This quick guide describes the steps to create a Jupyter Notebook on AWS then tu
    This current version assumes basic familiarity with cloud computing, AWS services, and Jupyter Notebook. Mostly because this version won't have images and won't dive too deep into each individual step.

    ## Steps
    ### Spin up EC2 instance
    ### Spin up EC2 instance with "Deep Learning" AMI
    1. Log into [EC2 console](https://console.aws.amazon.com/ec2) and click "Launch Instance" button.
    2. Inside "AWS Marketplace", select the "Deep Learning AMI" from AWS.
    2. Inside "AWS Marketplace", select the "Deep Learning AMI" from AWS. I use this AMI because most of the stuff you'll need is installed already.
    3. Select instance type depending on your use case. The "Deep Learning AMI" has support for GPU-backed instance (e.g. g2 and p2) but it's not necessary to use these. Use the cheapest one for your workload (likely memory needed for your dataset).
    4. In most cases you can use default settings throughout the rest.
    5. Ensure the instance is assigned to a security group with SSH access.
    6. Launch your instance

    ### Start Jupyter Notebook
    1. SSH into your newly launched instance.
    ```
    asdf
    ```
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.
    ```
    $ screen
    $ jupyter notebook --no-browser
    ```
    3. asdf

    ### Tunnel into Notebook
    1. asdf
  13. @jakechen jakechen revised this gist Feb 22, 2017. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions aws_jupyter.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,8 @@ This current version assumes basic familiarity with cloud computing, AWS service
    ### Start Jupyter Notebook
    1. SSH into your newly launched instance.
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.
    $ screen
    $ jupyter notebook --no-browser
    ```
    $ screen
    $ jupyter notebook --no-browser
    ```
    3. asdf
  14. @jakechen jakechen created this gist Feb 22, 2017.
    21 changes: 21 additions & 0 deletions aws_jupyter.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    ## Introduction
    This quick guide describes the steps to create a Jupyter Notebook on AWS then tunnel into it. This method is preferred since you do not open any additional ports besides 22, requires little-to-no configuration, and is generally more straight-forward.

    ## Pre-requisites
    This current version assumes basic familiarity with cloud computing, AWS services, and Jupyter Notebook. Mostly because this version won't have images and won't dive too deep into each individual step.

    ## Steps
    ### Spin up EC2 instance
    1. Log into [EC2 console](https://console.aws.amazon.com/ec2) and click "Launch Instance" button.
    2. Inside "AWS Marketplace", select the "Deep Learning AMI" from AWS.
    3. Select instance type depending on your use case. The "Deep Learning AMI" has support for GPU-backed instance (e.g. g2 and p2) but it's not necessary to use these. Use the cheapest one for your workload (likely memory needed for your dataset).
    4. In most cases you can use default settings throughout the rest.
    5. Ensure the instance is assigned to a security group with SSH access.
    6. Launch your instance

    ### Start Jupyter Notebook
    1. SSH into your newly launched instance.
    2. Start Jupyter Notebook in the background. Use the --no-browser flag to prevent the server from launching a browser.
    $ screen
    $ jupyter notebook --no-browser
    3. asdf