[Docker] LibreOffice on Synology NAS

[Docker] LibreOffice on Synology NAS

If you want to run LibreOffice directly on your Synology NAS, Docker makes it easy. Here’s my docker-compose.yaml configuration:

services:
  # ── LibreOffice (Web-based GUI via LinuxServer.io) ─────
  libreoffice:
    image: lscr.io/linuxserver/libreoffice:latest
    container_name: libreoffice
    security_opt:
      # - seccomp:unconfined       # Optional: required by some GUI features
      - no-new-privileges:true    # Optional: prevents privilege escalation
    environment:
      - PUID=1026                 # NAS user ID (adjust to match your DSM account)
      - PGID=100                  # NAS group ID (adjust if needed)
      - TZ=America/New_York       # Set timezone
      - CUSTOM_USER=myusername    # Login username
      - PASSWORD=mypassword       # Login password
      # Optional: Korean language UI
      # - LANG=ko_KR.UTF-8
      # - LANGUAGE=ko_KR:ko
      # - LC_ALL=ko_KR.UTF-8
    volumes:
      - /volume1/docker/libreoffice/config:/config         # Config and user settings
      - /home:/mnt/documents:rw                            # Shared documents folder
    ports:
      - "6000:3000"                                        # Web access
      - "6001:3001"                                        # NoVNC/VNC (optional)
    restart: unless-stopped

Key Notes

  • User & Group IDs
    Set PUID and PGID according to your Synology account. You can check these by connecting to your NAS over SSH and running id. This ensures proper file ownership in mounted volumes.
  • Login Security
    The CUSTOM_USER and PASSWORD variables require a login before accessing LibreOffice. This prevents unauthorized use.
  • Language Settings
    If you prefer a Korean UI, set the LANG, LANGUAGE, and LC_ALL variables as above. Otherwise, you can skip these for English.
  • Resolution Settings
    When accessing from a MacBook, the default resolution may be too high, making text appear very small. Adjust DISPLAY_WIDTH and DISPLAY_HEIGHT to something more comfortable (e.g., 1600x900).
  • Document Folder
    The /mnt/documents mapping lets you work directly with files stored on your Synology NAS, so you can easily edit and save documents.

Once the container is running, simply configure a reverse proxy on your NAS pointing to port 6000 or 6001, and you’re good to go.