Skip to main content Samba server - docker or native? : r/selfhosted
r/selfhosted icon
Go to selfhosted

Samba server - docker or native?

hey!

I'm setting a new server (with ubuntu server) to reduce some load on my Synology. Does it make sense to put the samba server in a docker container? Or is it better to run it natively on the machine? If docker, does anyone have a decent docker-compose file?

You Can Just Do Things with Unraid. Run what you want, how you want. Mix and match drives, use any hardware—no sysadmin skills needed. Try Unraid free for 60 days!
Clickable image which will reveal the video player: You Can Just Do Things with Unraid. Run what you want, how you want. Mix and match drives, use any hardware—no sysadmin skills needed. Try Unraid free for 60 days!
Sort by:
Best
Open comment sort options

I'm going against the majority here and recommend using it via docker.

This image is awesome: https://hub.docker.com/r/servercontainers/samba

It's super easy to set up, easier than native if you already have a working compose file. It comes with sane defaults so you only have to worry about the shares themselves. It allows for ro mounting directories in the container, giving another layer of safety. And it makes it so that you can manage your samba shares where you manage everything else you serve, right there in that convenient docker compose file.

I think that's the key word here: Convenience. Either docker or native will do just fine, but I find docker more convenient.

A very strong +1 here. In the past I have always configured samba manually and while once you have working config files, it is not hard, it still means more config dropped into a /etc directory you only look at once in a blue moon.

I tried this route this time for a new server (and used the example docker-compose.yml below edited for my files) and it just worked.

Biggest advantage is not just that it is easy, but as all my other services are dockerised this was just slipped into the compose file for my general admin stack, so bringing it up/down and upgrading is trivial.

More replies

Just run it directly on the server.

linuxserver.io chose to not make a docker for samba due to it not really making sense, so I just ended up running it on my server

docker. who wants to struggle with system-wide linux user acl and shadowed passwd and blah blah? (I know that you don't have to in samba v4 but still)

and also, sudoing on editing config file is silly.

for same reason, I happily run cups and a few more traditional daemons on docker.

[deleted]

Comment deleted by user

Profile Badge for the Achievement Top 1% Commenter Top 1% Commenter

after so many failed attempt's on docker I went back on using it natively on my new home server.

Having it on the server is the best way. Two config folders (the /var/lib/samba and /etc/samba) and that’s it.

Docker’s only advantages here is reproducibility (deploying on new system will go with your docker-compose file) and arguably having access to only your share/data folder (though apparmor if set up might do the same).

Try lxd

More replies

Docker.

Why? Because then I can use my orchestrator (nomad) to make sure it's always running, version upgrades are easy, everything can go in version control etc