A single-container Samba server with a small web UI for shares, users and per-share permissions.
Built on aevrin/easy (Ubuntu + Apache + PHP); SWAG sits in front for HTTPS and auth.
./data/config.json is the source of truth. samba-helper turns it into Unix accounts, Samba passwords and /etc/samba/smb.conf./app) calls samba-helper through one sudoers rule; the helper validates everything (usernames, share names, paths, settings) and refuses system paths like /etc, /app or /../data/samba/ so it survives container rebuilds. Unix accounts are recreated from the config on every boot.run.sh; if either dies the container exits and restart: always restarts both.smbcontrol reload-config). Clients already connected may need to reconnect.Each share has a per-user access level: No access, Read only, or Read and write. A share with nobody on it is switched off (Samba would otherwise let any logged-in user in).
Force user (optional, per share) makes every file land on disk owned by one account, whoever connects. Leave it empty and files belong to whoever wrote them. Every user's primary group is the share group (GID 1000 by default), and files are created 0664 / folders 0775.
User IDs only ever go up, so a new user never inherits files a deleted user left behind. You can set a UID by hand when adding a user, for example to match a file owner on the host.
On first start with an empty ./data, the old variables are imported once:
| Variable | Becomes |
|---|---|
USERNAME / PASSWORD | first user, and the force user on imported shares |
USER1..999 / PASS1..999 | more users |
E1..999 / C1..999 | shares (path / name), every imported user read-write |
That reproduces the old behaviour exactly; tighten it from the UI afterwards. After the import those variables are ignored. To re-import, stop the container and delete ./data.
WORKGROUP, ENCRYPTION, SIGNING and MIN_PROTOCOL are different: when set, they override the config on every boot and the UI shows those fields as locked.
docker-compose.yml. Mount ./data to /app/data and each folder you want to share.445. Put the container on SWAG's network and copy samba.subdomain.conf.sample into SWAG's proxy-confs, adding your auth include.chown -R 1001:1000 /Storage && chmod -R g+rwX /Storage.The UI needs sudo to work, so don't set security_opt: no-new-privileges on this container.
smb://host/share).View smb.conf in the UI shows exactly what Samba is running.Content type
Image
Digest
sha256:e162153ca…
Size
285.7 MB
Last updated
3 days ago
docker pull aevrin/samba