Hosting Obsidian on media publicly

There are multiple options when we want to host media and larger files and serve them on the web.

Here's my setup for making any asset available through S3 (storage) and Cloudfront (CDN) on AWS, to take advantage of my existing account and the numerous tools and guides that already exist.

Public bucket? No thanks!

Many similar tutorials suggest allowing public read access to S3 buckets. This may not be a great idea. In this walkthrough we're going to use Cloudfront together with S3, to manage the content delivery. This means that the S3 bucket itself doesn't need to be public. Content is published only through Cloudfront.

Rough steps

  1. Setup S3 bucket for use with Cloudfront
  2. Setup custom AWS CloudFront CNAME
  3. Setup an IAM user to manage an S3 bucket
  4. Upload the media to your S3 bucket

Notes