Multi-architecture Samba server with YAML-based users, SMB shares, and Apple Time Machine support.
281
A multi-architecture Samba server based on Ubuntu 26.04.
Designed as a simple, reusable Samba container with:
fruit and streams_xattr supportamd64 and arm64 imagesdocker pull travisback/samba:latest
Supported architectures:
linux/amd64linux/arm64A basic deployment:
services:
samba:
image: travisback/samba:latest
container_name: samba
hostname: samba
restart: unless-stopped
network_mode: host
volumes:
- ./appdata/samba:/var/lib/samba
- /path/to/storage:/storage
- /path/to/backup:/backup
- ./config/users.yaml:/run/secrets/users.yaml:ro
Host networking is recommended because Samba and Avahi use multiple network ports and protocols.
Users and shares are defined in users.yaml.
Example:
shares:
Storage:
path: /storage
force_user: travisback
Backup:
path: /backup
force_user: travisback
TimeMachine:
path: /backup/TimeMachine
force_user: travisback
time_machine: true
users:
travisback:
enabled: true
password: change-this-password
shares:
Storage: rw
Backup: rw
TimeMachine: rw
guest:
enabled: false
password: guest
shares:
Storage: r
Backup: r
Each user can be granted access to individual shares:
shares:
Storage: rw
Backup: rw
TimeMachine: rw
Available permissions:
rw — read/writer — read-onlyUsers can be disabled without removing their configuration:
enabled: false
The /var/lib/samba volume stores Samba's persistent state, including its databases and account information.
Keep this directory persistent across container recreations.
User configuration is mounted separately at:
/run/secrets/users.yaml
The configuration file is not included in the image.
The image includes Samba's Apple SMB support and is suitable for Time Machine over SMB.
Configure a dedicated share:
shares:
TimeMachine:
path: /backup/TimeMachine
force_user: travisback
time_machine: true
Then connect from macOS using the Samba server's hostname or IP address.
The container uses:
| Port | Protocol | Purpose |
|---|---|---|
| 137 | UDP | NetBIOS Name Service |
| 138 | UDP | NetBIOS Datagram Service |
| 139 | TCP | NetBIOS Session Service |
| 445 | TCP | SMB |
| 5353 | UDP | mDNS / Avahi |
Host networking is recommended.
The image does not contain site-specific users, passwords, storage paths, or share configuration.
Credentials and runtime configuration should be supplied through the mounted users.yaml file.
Do not publish passwords or other secrets in your Dockerfile, source repository, or image.
This project contains configuration and containerization work for Samba.
Samba itself is licensed under the GNU General Public License version 3 (GPLv3).
See the Samba project for licensing and source information.
Content type
Image
Digest
sha256:32d8f0c46…
Size
94.4 MB
Last updated
4 days ago
docker pull travisback/samba