Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Sharing Videos Online Securely with HLS encoding and CloudFront Security And Distribution


This is the tutorial series for you if you wish to publish video content online with the following requirements:

  • Private access - The videos need to be only accessible by people logging into your website / app (cannot be shared with others).
  • Fast Distribution - Those videos need to be published using a content distribution network (CDN) so that you don't have to worry about bandwidth limitations on your server or where the users are located around the world.
  • Automatic Video Quality Variability - The videos should be streamed to the user in a quality most appropriate to the user's screen resolution and internet connection speed.


The steps to do this are covered in the individual tutorials below. If they aren't a link, they will become one soon.

  1. Create a private S3 bucket
  2. Create an Elastic Transcoder Pipeline.
  3. Create a Cloudfront Key Pair
  4. Create presets for the HLS Videos
  5. Upload the files to S3
  6. Transcode the videos
  7. Create a CloudFront distribution.
  8. Upload Certificate for CloudFront
  9. Generate and use signed cookies in your code.
Last updated: 30th October 2019
First published: 27th October 2019