Sign inSign up

certyiknofetch/memora

By certyiknofetch

Updated 7 months ago

Image
0

1.6K

certyiknofetch/memora repository overview


Memora

Your memories, beautifully preserved. Fully private. Fully yours.

Memora is a self-hosted photo and video management application built for privacy-first users who want complete control over their media. Deploy it on your own server, NAS, or Raspberry Pi in under a minute.

Docker Image Version Docker Image Size Docker Pulls Docker Stars


Highlights

  • No cloud dependency -- your photos stay on your hardware
  • Multi-architecture -- runs on amd64 and arm64 (Raspberry Pi, Apple Silicon, AWS Graviton)
  • Single container -- no external databases, caches, or services required
  • Zero config start -- just docker run and go; secrets are auto-generated

Quick Start

One-liner
docker run -d \
  --name memora \
  -p 8000:8000 \
  -v memora_uploads:/app/uploads \
  -v memora_db:/app/db_data \
  -v memora_data:/app/data \
  --restart unless-stopped \
  certyiknofetch/memora:latest

Open http://localhost:8000 -- the first registered user automatically becomes the admin.

Docker Compose
services:
  memora:
    image: certyiknofetch/memora:latest
    container_name: memora
    ports:
      - "8000:8000"
    volumes:
      - ./uploads:/app/uploads
      - ./db_data:/app/db_data
      - ./data:/app/data
    restart: unless-stopped
docker compose up -d

Features

Media Management
FeatureDescription
Photo & Video UploadDrag-and-drop uploads; supports photos up to 50 MB and videos up to 2 GB
Format SupportJPG, PNG, GIF, WebP, HEIC, HEIF, AVIF, BMP, TIFF, MP4, MOV, AVI, MKV, WebM, M4V, 3GP
Auto ThumbnailsAutomatic JPEG thumbnail generation for all uploaded images
AlbumsOrganize media into albums with custom cover photos and drag-to-reorder
FavoritesStar your best shots for quick access
Search & FiltersFilter by name, media type (photo/video), and date range
Built-in EditorCrop, rotate, apply filters, draw, and add text -- right in the browser
Public SharingShare individual photos or entire albums via secure access links
Public GalleryOptional public-facing gallery page for shared content
Security
FeatureDescription
JWT + HttpOnly CookiesTokens stored in secure, HttpOnly cookies -- not accessible to JavaScript
Two-Factor Auth (TOTP)Optional 2FA with any authenticator app (Google Authenticator, Authy, etc.)
TOTP Replay ProtectionEach TOTP code can only be used once within its validity window
Security QuestionsThree encrypted security questions for account recovery
Bcrypt Password HashingIndustry-standard password hashing with automatic salting
Password PolicyEnforced minimum 8 characters with uppercase, lowercase, digit, and special character
Rate LimitingPer-IP and per-account lockout after failed login attempts
CSRF ProtectionCustom header requirement + Origin validation on all state-changing requests
Security HeadersCSP, X-Frame-Options, X-Content-Type-Options, HSTS (when HTTPS enabled), and more
File ValidationMagic-byte verification ensures uploaded files match their claimed type
Token BlacklistingLogout actually invalidates the token server-side
Session InvalidationPassword changes immediately invalidate all existing sessions
Field EncryptionSensitive data (security questions) encrypted at rest with Fernet (AES-128-CBC + HMAC)
Administration
FeatureDescription
Auto AdminFirst registered user becomes admin automatically
User ManagementView, activate, and deactivate user accounts
Registration ControlToggle new user registration on or off
Dashboard StatsTotal users, photos, videos, storage usage at a glance
Structured LoggingJSON-formatted logs with request IDs for easy debugging and monitoring

Supported Architectures

ArchitectureTag
x86-64certyiknofetch/memora:latest
ARM64 / aarch64certyiknofetch/memora:latest

The image is a multi-platform manifest -- Docker automatically pulls the correct architecture for your system.


Tags

TagDescription
latestMost recent stable release
1.0First stable release (v1.0)

Volumes

Container PathPurposeDescription
/app/uploadsMedia storageAll uploaded photos and videos with thumbnails
/app/db_dataDatabaseSQLite database file
/app/dataApp dataAuto-generated secret key and app state

Important: Always mount persistent volumes. Without them, your data is lost when the container is recreated.


Environment Variables

VariableDefaultDescription
SECRET_KEYauto-generatedJWT signing key. Leave empty to auto-generate and persist to /app/data/.secret_key
USE_HTTPSfalseSet to true when running behind an HTTPS reverse proxy (enables secure cookies and HSTS)
DATABASE_URLSQLiteDatabase connection string. Default: sqlite+aiosqlite:////app/db_data/memora.db
UPLOAD_DIR/app/uploadsMedia storage directory inside the container
MAX_PHOTO_SIZE_MB50Maximum upload size for photos (in MB)
MAX_VIDEO_SIZE_MB2048Maximum upload size for videos (in MB, default 2 GB)
ALLOWED_IMAGE_EXTENSIONSjpg,jpeg,png,gif,webp,heic,heif,bmp,tiff,tif,avifComma-separated list of allowed image formats
ALLOWED_VIDEO_EXTENSIONSmp4,mov,avi,mkv,webm,m4v,3gpComma-separated list of allowed video formats
ACCESS_TOKEN_EXPIRE_MINUTES1440Login session duration in minutes (default 24 hours)
MAX_LOGIN_ATTEMPTS5Failed login attempts before account/IP lockout
LOGIN_LOCKOUT_MINUTES15Lockout duration after max failed attempts
APP_NAMEMemoraApplication display name
DEBUGfalseDebug mode. Keep false in production
LOG_LEVELINFOLog verbosity: DEBUG, INFO, WARNING, ERROR

Running Behind a Reverse Proxy

When placing Memora behind Nginx, Caddy, Nginx Proxy Manager, or Traefik, set USE_HTTPS=true so cookies use the Secure flag and HSTS headers are sent.

Nginx Proxy Manager
  1. Set Forward Hostname to memora (container name) and Forward Port to 8000
  2. Enable Force SSL and HTTP/2
  3. Under Advanced, add: client_max_body_size 2048M;
Caddy
photos.example.com {
    reverse_proxy memora:8000
    request_body {
        max_size 2GB
    }
}
Nginx
server {
    listen 443 ssl http2;
    server_name photos.example.com;
    client_max_body_size 2048M;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Backup & Restore

Backup
docker compose stop memora
tar -czvf memora-backup-$(date +%Y%m%d).tar.gz uploads/ db_data/ data/
docker compose start memora
Restore
docker compose stop memora
tar -xzvf memora-backup-20260217.tar.gz
docker compose start memora

API Documentation

Once running, interactive API docs are available at:

EndpointDescription
/docsSwagger UI -- interactive API explorer
/redocReDoc -- alternative API documentation
/healthHealth check endpoint (returns {"status": "healthy"})

Tech Stack

ComponentTechnology
BackendPython 3.11, FastAPI, Uvicorn
DatabaseSQLite (async via aiosqlite), SQLAlchemy 2.0
AuthJWT (python-jose), bcrypt, TOTP (pyotp)
EncryptionFernet / AES (cryptography)
Image ProcessingPillow
FrontendVanilla JavaScript, HTML5, CSS3
ContainerDocker, multi-arch (amd64 + arm64)

Quick Reference

ActionCommand
Startdocker compose up -d
Stopdocker compose down
View logsdocker logs -f memora
Updatedocker compose pull && docker compose up -d
Restartdocker compose restart
Shelldocker exec -it memora /bin/sh
Health checkcurl http://localhost:8000/health

Source Code

The source code is available on GitHub. Contributions, issues, and feature requests are welcome.


License

MIT License -- free for personal and commercial use.

Tag summary

Content type

Image

Digest

sha256:34b4438b4

Size

83.2 MB

Last updated

7 months ago

docker pull certyiknofetch/memora