[GH-ISSUE #2821] [BUG]: Unable to Deploy in Portainer with Docker Compose #1802

Closed
opened 2026-02-22 18:26:35 -05:00 by yindo · 1 comment
Owner

Originally created by @spencerthayer on GitHub (Dec 12, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2821

How are you running AnythingLLM?

Docker (remote machine)

What happened?

I am encountering issues when deploying AnythingLLM exclusively via Portainer using the docker-compose.yml configuration. Despite following the instructions provided in the README, I am running into persistent errors:

  1. Mounting Issues: Errors related to .env being mounted as a directory instead of a file. Logs show:
    OCI runtime create failed: runc create failed: error mounting "/appdata/anythingllm/.env" to rootfs at "/app/server/.env": not a directory.
    
  2. Port Configuration with Host Mode: When using network_mode: host, the ports configuration seems to be discarded, as noted in the Portainer logs.

I expected the stack to deploy successfully with all required services running, accessible via http://localhost:3001.

Are there known steps to reproduce?

  1. Configure docker-compose.yml as outlined in the README:
    version: "3.8"
    services:
      anythingllm:
        image: mintplexlabs/anythingllm
        container_name: anythingllm
        network_mode: host
        environment:
          - STORAGE_DIR=/app/server/storage
          - JWT_SECRET="secure-random-string"
          - LLM_PROVIDER=ollama
          - OLLAMA_BASE_PATH=http://127.0.0.1:11434
          - EMBEDDING_ENGINE=ollama
          - EMBEDDING_BASE_PATH=http://127.0.0.1:11434
          - VECTOR_DB=lancedb
        volumes:
          - /appdata/anythingllm/storage:/app/server/storage
          - /appdata/anythingllm/.env:/app/server/.env
        restart: always
    volumes:
      anythingllm_storage:
        driver: local
        driver_opts:
          type: none
          o: bind
          device: /appdata/anythingllm/storage
    
  2. Deploy the stack in Portainer using the above configuration.
  3. Observe the errors in Portainer logs:
    • Mounting /appdata/anythingllm/.env results in the container failing to initialize.
    • Network mode host discards the published ports.

What I’ve Tried

  1. Verified that /appdata/anythingllm/.env exists as a file:
    touch /appdata/anythingllm/.env
    chmod 600 /appdata/anythingllm/.env
    
  2. Ensured /appdata/anythingllm/storage exists and has proper permissions:
    mkdir -p /appdata/anythingllm/storage
    chmod -R 777 /appdata/anythingllm/storage
    
  3. Adjusted environment variables to match the provided examples.
  4. Attempted using http://172.17.0.1:11434 for OLLAMA_BASE_PATH as the container runs on Ubuntu.

Additional Notes

I am specifically looking for a solution that works exclusively within Portainer, without relying on direct terminal commands after deployment. If there are additional steps or corrections required to adapt the setup for Portainer, please let me know. Any help in resolving these issues or updating the README for better clarity in Portainer deployments would be greatly appreciated. Thank you! 😊

Originally created by @spencerthayer on GitHub (Dec 12, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2821 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? I am encountering issues when deploying AnythingLLM exclusively via Portainer using the `docker-compose.yml` configuration. Despite following the instructions provided in the README, I am running into persistent errors: 1. **Mounting Issues**: Errors related to `.env` being mounted as a directory instead of a file. Logs show: ``` OCI runtime create failed: runc create failed: error mounting "/appdata/anythingllm/.env" to rootfs at "/app/server/.env": not a directory. ``` 2. **Port Configuration with Host Mode**: When using `network_mode: host`, the ports configuration seems to be discarded, as noted in the Portainer logs. I expected the stack to deploy successfully with all required services running, accessible via `http://localhost:3001`. ### Are there known steps to reproduce? 1. Configure `docker-compose.yml` as outlined in the README: ```yaml version: "3.8" services: anythingllm: image: mintplexlabs/anythingllm container_name: anythingllm network_mode: host environment: - STORAGE_DIR=/app/server/storage - JWT_SECRET="secure-random-string" - LLM_PROVIDER=ollama - OLLAMA_BASE_PATH=http://127.0.0.1:11434 - EMBEDDING_ENGINE=ollama - EMBEDDING_BASE_PATH=http://127.0.0.1:11434 - VECTOR_DB=lancedb volumes: - /appdata/anythingllm/storage:/app/server/storage - /appdata/anythingllm/.env:/app/server/.env restart: always volumes: anythingllm_storage: driver: local driver_opts: type: none o: bind device: /appdata/anythingllm/storage ``` 2. Deploy the stack in Portainer using the above configuration. 3. Observe the errors in Portainer logs: - Mounting `/appdata/anythingllm/.env` results in the container failing to initialize. - Network mode `host` discards the published ports. --- ### What I’ve Tried 1. Verified that `/appdata/anythingllm/.env` exists as a file: ```bash touch /appdata/anythingllm/.env chmod 600 /appdata/anythingllm/.env ``` 2. Ensured `/appdata/anythingllm/storage` exists and has proper permissions: ```bash mkdir -p /appdata/anythingllm/storage chmod -R 777 /appdata/anythingllm/storage ``` 3. Adjusted environment variables to match the provided examples. 4. Attempted using `http://172.17.0.1:11434` for `OLLAMA_BASE_PATH` as the container runs on Ubuntu. --- ### Additional Notes I am specifically looking for a solution that works exclusively within Portainer, without relying on direct terminal commands after deployment. If there are additional steps or corrections required to adapt the setup for Portainer, please let me know. Any help in resolving these issues or updating the README for better clarity in Portainer deployments would be greatly appreciated. Thank you! 😊
yindo added the possible bug label 2026-02-22 18:26:35 -05:00
yindo closed this issue 2026-02-22 18:26:35 -05:00
Author
Owner

@timothycarambat commented on GitHub (Dec 13, 2024):

https://github.com/Mintplex-Labs/anything-llm/issues/2814#issuecomment-2540265856

This may be semantic and should not matter, but the .env should be in the host storage folder - so

 - /appdata/anythingllm/storage:/app/server/storage
 - /appdata/anythingllm/storage/.env:/app/server/.env

Also ensuring the /appdata/anythingllm/storage/.env file exists (and is probably empty at first). Once it is set it is good forever

@timothycarambat commented on GitHub (Dec 13, 2024): https://github.com/Mintplex-Labs/anything-llm/issues/2814#issuecomment-2540265856 This may be semantic and should not matter, but the `.env` should be in the host `storage` folder - so ``` - /appdata/anythingllm/storage:/app/server/storage - /appdata/anythingllm/storage/.env:/app/server/.env ``` Also ensuring the `/appdata/anythingllm/storage/.env` file exists (and is probably empty at first). Once it is set it is good forever
yindo changed title from [BUG]: Unable to Deploy in Portainer with Docker Compose to [GH-ISSUE #2821] [BUG]: Unable to Deploy in Portainer with Docker Compose 2026-06-05 14:42:46 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1802