Unable to use external NFS volume with Seafile

Hi everyone :slight_smile:

I’ve been struggling for the past 48 hours to get Seafile running with an external NFS volume, and I feel like I’m hitting a wall.

Seafile works perfectly fine when its volume is mounted locally. However, as soon as I point it to an external NFS volume (which I’ve successfully used for other containers without issue), Seafile simply refuses to start.

Here’s what I’ve tried so far:

Tested various docker-compose.yml configurations.
Experimented with different approaches to mounting the NFS resource 
Rechecked permissions and ensured the NFS share works with other containers.

Despite all this, nothing works, and I can’t figure out why Seafile behaves differently.

Why is it impossible to use a straightforward setup with “external” volumes and a standard NFS network share, as we usually do with Docker?

I’m out of ideas, and my head feels like it’s about to explode. Any guidance would be greatly appreciated!

Thanks in advance :slight_smile:

Hi, Seafile can definitely work with NFS. It’s the main way I’ve been using it, with the database on the local server machine and all the data accessed via NFS on a NAS.

The mount in the docker compose file is nothing different from any other volume mount, as long as your server has the proper access to it:

volumes:
      - /nfs/documents/seafile/data:/shared

I’m using autofs in Ubuntu/Debian to automount my NFS shares on demand, and it works wonderfully.

Here’s the full compose.yaml I’ve been using for a couple of years, in case it helps:

(You can ignore the labels and Traefik bits if you don’t use traefik for reverse proxy.)

# seafile
---
services:

  seafiledb:
    image: mariadb:10.11
    container_name: seafile-mysql
    environment:
      - MYSQL_ROOT_PASSWORD=db_dev
      - MYSQL_LOG_CONSOLE=true
      - MARIADB_AUTO_UPGRADE=1
    volumes:
      - /home/username/docker/seafile/db:/var/lib/mysql
    restart: unless-stopped
    networks:
      - seafile-net

  memcached:
    image: memcached:1.6.18
    container_name: seafile-memcached
    entrypoint: memcached -m 256
    restart: unless-stopped
    networks:
      - seafile-net

  seafile:
    image: seafileltd/seafile-mc:latest
    container_name: seafile
    ports:
      - "8080:80"
      # - "443:443"  # If https is enabled, cancel the comment.
    volumes:
      - /nfs/documents/seafile/data:/shared
    environment:
      - DB_HOST=seafiledb
      - DB_ROOT_PASSWD=db_dev
      - TIME_ZONE=America/Halifax
      # - SEAFILE_ADMIN_EMAIL=user@yourdomain.com
      # - SEAFILE_ADMIN_PASSWORD=123
      - SEAFILE_SERVER_LETSENCRYPT=false
      - SEAFILE_SERVER_HOSTNAME=seafile.yourdomain.com
      - FORCE_HTTPS_IN_CONF=true
    depends_on:
      - seafiledb
      - memcached
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.seafile.rule=Host(`seafile.yourdomain.com`)"
      - "traefik.http.routers.seafile.entrypoints=https"
      - "traefik.http.routers.seafile.tls.certresolver=cloudflare"
      - "traefik.http.routers.seafile.service=seafile-svc"
      - "traefik.http.services.seafile-svc.loadbalancer.server.port=80"
    networks:
      - proxy
      - seafile-net

networks:
  proxy:
    external: true
  seafile-net:
    name: seafile-net
1 Like

Thank you very much, I finally succeeded, and it’s now working perfectly with the data folder on my NAS using NFS.

I tested file uploads, and it works. However, one thing isn’t working: uploading a custom logo (and avatars). My custom logo is correctly uploaded to the NFS share in \seafile\seahub-data\custom, but it doesn’t appear on the site. Instead, the word “logo” is displayed as text. This is probably related to NFS, because during my previous tests when I wasn’t using NFS storage, it seemed to work fine.

Glad to hear Seafile is working for you via NFS!

I JUST solved this issue this morning with a helpful tip from a fellow forum dweller. Here is the forum post:

1 Like

A huge thank you to you! You solved both of my problems today! After mounting the resource to the NAS via NFS, I didn’t think a chmod would have any effect—but it did, and that’s exactly what needed to be done. Everything is working perfectly now, thanks to your help! A big, big thank you!

1 Like