Edit

Content Storage

LearnHouse supports two storage backends for uploaded content such as images, videos, and documents.

Storage Options

Filesystem (Default)

By default, uploaded content is stored on the local filesystem using a Docker volume. This is the simplest option and works well for small to medium deployments.

LEARNHOUSE_CONTENT_DELIVERY_TYPE=filesystem

Content is persisted in a named Docker volume (learnhouse_content_<id> in docker-compose.yml, mounted at /app/api/content in the app container), so it survives container restarts and recreation. The learnhouse backup command includes filesystem content in its backups.

S3-Compatible Storage

For production deployments or when you need scalable storage, you can use any S3-compatible storage service:

  • AWS S3
  • CloudFlare R2
  • MinIO (self-hosted)
  • Any other S3-compatible provider
LEARNHOUSE_CONTENT_DELIVERY_TYPE=s3api
LEARNHOUSE_S3_API_BUCKET_NAME=learnhouse-content
LEARNHOUSE_S3_API_ENDPOINT_URL=https://s3.amazonaws.com

For providers that check the region (AWS S3, MinIO), also set it. Without one, uploads use the S3 client's default and course import/export uses auto, which suits Cloudflare R2:

AWS_DEFAULT_REGION=eu-west-1
LEARNHOUSE_S3_API_REGION=eu-west-1

The setup wizard asks for the bucket, endpoint, region and access keys, and writes all of these.

After updating your storage configuration, apply it (this recreates the containers whose configuration changed):

npx learnhouse start

Make sure the bucket exists and the credentials have read/write permissions. The API uses the standard AWS credential chain, so set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in .env, or use an instance role.

Choosing a Storage Backend

ConsiderationFilesystemS3-Compatible
Setup complexitySimple, works out of the boxRequires external service or additional container
ScalabilityLimited by server diskVirtually unlimited
BackupIncluded in learnhouse backupManaged separately by your storage provider
CostIncluded with your serverVaries by provider
RedundancySingle disk, no redundancyBuilt-in redundancy (provider-dependent)

For most self-hosted installations starting out, filesystem storage is a good default. You can migrate to S3-compatible storage later as your needs grow.

Using MinIO for Self-Hosted S3

If you want S3-compatible storage without relying on a cloud provider, you can run MinIO alongside LearnHouse. MinIO provides an S3-compatible API on your own infrastructure.

Configure the endpoint URL to point to your MinIO instance:

LEARNHOUSE_CONTENT_DELIVERY_TYPE=s3api
LEARNHOUSE_S3_API_BUCKET_NAME=learnhouse-content
LEARNHOUSE_S3_API_ENDPOINT_URL=http://minio:9000