# Standard Notes Server

> End-to-end encrypted notes application server.

- Category: Productivity & Collaboration
- Difficulty: advanced
- Components: standard-notes, mysql, redis
- Tags: standard-notes, encrypted, notes, privacy
- Source: https://docker.recipes/productivity/standard-notes

## Overview

Standard Notes is an open-source, end-to-end encrypted notes application that prioritizes privacy and data ownership. Originally launched in 2016 by Mo Bitar, Standard Notes has become a leading privacy-focused note-taking platform that ensures even the server operators cannot read user data, as all encryption and decryption happens client-side. The application supports rich text editing, tagging, nested folders, and an extensive ecosystem of themes and extensions while maintaining zero-knowledge architecture. This self-hosted deployment combines the Standard Notes syncing server with MySQL 8 for robust relational data storage and Redis 7 for high-performance caching and session management. MySQL handles the encrypted note data, user accounts, and metadata with ACID compliance, while Redis provides sub-millisecond response times for real-time synchronization across multiple devices and caches frequently accessed encrypted payloads. This architecture is ideal for privacy-conscious organizations, security professionals, and individuals who want complete control over their note data without sacrificing the convenience of cloud synchronization. The stack offers enterprise-grade reliability with the Standard Notes syncing server handling client authentication and data synchronization, MySQL ensuring data integrity and backup capabilities, and Redis optimizing performance for multiple concurrent users accessing their encrypted notes simultaneously.

## Features

- Zero-knowledge architecture where encrypted notes are stored in MySQL but never decrypted server-side
- Real-time synchronization across devices using Redis for session management and caching
- MySQL 8 InnoDB storage engine with ACID compliance for reliable encrypted data persistence
- Redis pub/sub messaging for instant note synchronization between multiple client sessions
- Standard Notes Extensions API support for custom themes, editors, and productivity tools
- MySQL full-text search capabilities on encrypted metadata and tags
- Redis-powered rate limiting and authentication throttling for enhanced security
- Support for Standard Notes subscription features including encrypted file attachments when configured with appropriate licensing

## Use cases

- Privacy-focused teams needing secure collaborative note-taking with complete data ownership
- Healthcare organizations requiring HIPAA-compliant note storage with end-to-end encryption
- Legal firms managing confidential case notes and client information with zero-knowledge architecture
- Security researchers and penetration testers documenting sensitive findings in encrypted notebooks
- Educational institutions providing students with private, encrypted study notes and research storage
- Journalists and activists in restrictive regions needing secure, censorship-resistant note synchronization
- Personal knowledge management for individuals wanting Google Keep or Notion alternatives without data mining

## Prerequisites

- Minimum 2GB RAM (1GB+ for MySQL, 512MB+ for Redis, remainder for Standard Notes syncing server)
- Docker Engine 20.10+ and Docker Compose V2 for proper container orchestration
- Port 3001 available for Standard Notes web interface external access
- Strong database password configured in environment variables for MySQL security
- Understanding of Standard Notes client app configuration to connect to self-hosted server
- SSL/TLS termination setup (reverse proxy) recommended for production deployments with HTTPS

## docker-compose.yml

```yaml
services:
  web:
    image: standardnotes/web:latest
    container_name: standardnotes-web
    restart: unless-stopped
    ports:
      - "3001:3001"
    environment:
      PORT: 3001

  syncing-server:
    image: standardnotes/syncing-server-js:latest
    container_name: standardnotes-sync
    restart: unless-stopped
    environment:
      LOG_LEVEL: info
      NODE_ENV: production
      AUTH_SERVER_URL: http://auth:3000
      REDIS_URL: redis://redis:6379
      DB_HOST: db
      DB_PORT: 3306
      DB_DATABASE: standardnotes
      DB_USERNAME: standardnotes
      DB_PASSWORD: ${DB_PASSWORD}
    depends_on:
      - db
      - redis

  db:
    image: mysql:8
    container_name: standardnotes-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
      MYSQL_DATABASE: standardnotes
      MYSQL_USER: standardnotes
      MYSQL_PASSWORD: ${DB_PASSWORD}
    volumes:
      - standardnotes_db:/var/lib/mysql

  redis:
    image: redis:7-alpine
    container_name: standardnotes-redis

volumes:
  standardnotes_db:
```

## .env

```bash
DB_PASSWORD=changeme
# Use official Standard Notes server setup for production
```

## Usage notes

- Docs: https://docs.standardnotes.com/self-hosting/
- Use with Standard Notes client apps (desktop, mobile, web)
- End-to-end encryption - server never sees unencrypted data
- Simplified setup shown - see official Docker Compose for production
- Files subscription required for attachments and some extensions
- Free tier: unlimited notes, 30-day revision history

## Troubleshooting

- Error 'Connection refused' on port 3001: Ensure syncing-server container has started after database initialization completes
- MySQL 'Access denied for user' errors: Verify DB_PASSWORD environment variable matches MYSQL_PASSWORD and MYSQL_ROOT_PASSWORD values
- Standard Notes client sync failures: Check that AUTH_SERVER_URL points to correct syncing-server container and Redis connection is established
- Redis connection timeouts: Increase Redis memory limits if handling large numbers of concurrent encrypted note synchronizations
- Database migration errors on startup: Allow extra time for MySQL 8 initialization and Standard Notes schema creation on first run
- Performance issues with multiple users: Monitor Redis memory usage and consider increasing MySQL innodb_buffer_pool_size for better encrypted data caching

