How to publish a Jupyter notebook online — using AWS in 10 minutes!
Whether you’re building your data science portfolio, or whether you need to share resources with colleagues or friends, it’s great to know how to publish a Jupyter notebook online on AWS.
At the end of this article, you will have a Jupyter notebook accessible over the internet with a URL as so:
Step 0: make an AWS account
First things first, you need an AWS account. It’s very easy to set up over here. It’s free to have an account, because you pay for the services that you use.
For new accounts, AWS gives a huge discount the first year, called the Free Tier, with which everything presented in this article is free. If you’re an experienced AWS user (without Free Tier), you will pay a slight amount for the traffic to your notebooks. See disclaimer below this article for details.
By the way, I have no affiliation with AWS: I just like this approach, so I want to share it with you in this article.
Step 1: Save a Jupyter Notebook as .html file
In order to make your notebook accessible online, you need to export it as an HTML file. HTML is the language for static websites and it will be recognized as such by AWS.
In order to make your notebook accessible online, you need to export it as an HTML file.
- On Jupyter Notebooks, when your notebook is ready to publish, go to ‘File’ → ‘Download as’ → ‘HTML (.html)’
- Save the HTML file somewhere you remember under a name that is acceptable for website URLs (avoid spaces and certain characters).
Step 2: Create an S3 bucket
In AWS, we’re going to use the S3 service. S3 is the AWS service that allows for file storage and for building static websites. We use it because it is cheap and very easy to set up.
S3 is the AWS service that allows for file storage and for building static websites.
Everything in S3 works with so-called buckets. A bucket is like a folder in which you can put your files. To work with S3 you have to make a bucket, so let’s do it:
- Go to aws.amazon.com and log in to the AWS Management Console.
- In the ‘Services’ drop-down menu, click on S3
- In the S3 menu click on ‘Create bucket’ and the following menu will appear: