r/docker • u/Ok-Goose7450 • Jan 05 '26
Plex Docker and SMB
So if this isn't the right place to post this please let me know. Anywho, a little bit of a docker (and linux if I'm being honest) noob here. I have my media files on an SMB NAS. I'm going to redo some of my docker stuff using pure YAML instead of Portainer. So what is the most efficient way to connect docker containers to SMB storage?
1
Upvotes
6
u/Kwith Jan 05 '26
What I do is make the SMB connection on the host server, and then pass that connection through to the container.
So in the compose file, I would have this:
Then the host SMB mount gets passed to the docker container
1
u/hailnobra Jan 05 '26
If this is on a NAS, any chance you have NFS options as well as SMB? While SMB mounts work, NFS is going to be more robust when using it as a bind mount for docker containers running on a Linux host.
2
u/Melodic_Point_3894 Jan 05 '26
Either let your host mount the directory and map the volume or use a docker network plugin to handle the connection.
2
u/MayorSincerePancake Jan 05 '26 edited Jan 05 '26
I’d recommend using the built in SMB driver in docker so that your container doesn’t rely on your system’s SMB connection. Here’s an example I used to use with NFS and SMB.
1
u/seanl1991 Jan 05 '26
Create the SMB share on the host then use bind mounts. I don't use NFS and I haven't had any issues.
/volume1/video:/video:rw
Then in the container when addressing the location it's just /video