镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Can't start container - Permission denied #52

Closed

Description

@constgen
PermissionError: [Errno 13] Permission denied: '/home/llms/.llms/extensions'

when start compose file

services:
  llms:
    image: ghcr.io/servicestack/llms:latest
    container_name: llms-py
    ports:
      # Only reachable from this machine. Use "8000:8000" to expose it on your LAN.
      - 7841:8000
    volumes:
      # User-modifiable config kept outside the container.
      # llms.json and providers.json are auto-created on first run.
      - ${APP_DATA}/llms:/home/llms/.llms
    extra_hosts:
      # Lets the container reach services on the host (ollama, LM Studio, ...)
      # via http://host.docker.internal:11434 etc.
      - host.docker.internal:host-gateway
    restart: unless-stopped
    healthcheck:
      test:
        - CMD
        - python
        - -c
        - import urllib.request;
          urllib.request.urlopen('http://localhost:8000').read()
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 10s

Looking at config it should start with root user. What permissions may be denied?

Activity

  1. mythz commented on Oct 20, 2026

    @mythz
    Member

    The image runs as the non-root llms user (UID 1000). Since your Compose file doesn’t specify user:, it inherits that setting.

    Your bind mount replaces /home/llms/.llms with ${APP_DATA}/llms on the host, so that host directory must be writable by UID 1000. If it didn’t exist before starting Compose, Docker may have created it as root.

    For a directory dedicated to llms data, run this on the host, with APP_DATA set to the same value used by Compose:

    mkdir -p "${APP_DATA}/llms"
    sudo chown -R 1000:1000 "${APP_DATA}/llms"
    sudo chmod -R u+rwX "${APP_DATA}/llms"
    docker compose up -d

    Alternatively, add user: "UID:GID" to the llms service, replacing UID:GID with the numeric IDs of the host account that owns the directory.

    If it still fails, please share the output of:

    ls -ldn "${APP_DATA}/llms"

    Also let us know whether you’re using rootless Docker or an SELinux-enabled host, since those can require different mount permissions.

  2. constgen commented on Oct 20, 2026

    @constgen
    Author

    This did work.
    Added user: ${PUID}:${GUID}

  3. mythz commented on Oct 20, 2026

    @mythz
    Member

    Thanks for confirming! I’ve prepared an update to the Compose files to support configurable user and group IDs:

    user: "${PUID:-1000}:${PGID:-1000}"

    The docs and installer have also been updated to explain the required bind-mount permissions. These changes don’t require a new Docker image release.

    Your existing fix can stay as-is. We use PGID for the group ID in the updated examples, but your GUID variable works equally well if that’s how you’ve defined it.

  4. constgen commented on Oct 21, 2026

    @constgen
    Author

    You are right. Just didn't notice that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions