Sign inSign up

travisback/samba

By travisback

Updated 4 days ago

Multi-architecture Samba server with YAML-based users, SMB shares, and Apple Time Machine support.

Image
Networking
Databases & storage
1

281

travisback/samba repository overview

Samba Docker Image

A multi-architecture Samba server based on Ubuntu 26.04.

Designed as a simple, reusable Samba container with:

  • SMB/CIFS file sharing
  • YAML-based user and share configuration
  • Per-user read/write permissions
  • Apple SMB support
  • Apple Time Machine support
  • Avahi/mDNS support
  • fruit and streams_xattr support
  • Linux amd64 and arm64 images
  • Runtime configuration kept outside the image

Image

docker pull travisback/samba:latest

Supported architectures:

  • linux/amd64
  • linux/arm64

Docker Compose

A 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.

Configuration

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
User Permissions

Each user can be granted access to individual shares:

shares:
  Storage: rw
  Backup: rw
  TimeMachine: rw

Available permissions:

  • rw — read/write
  • r — read-only

Users can be disabled without removing their configuration:

enabled: false

Persistent Data

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.

Apple Time Machine

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.

Ports

The container uses:

PortProtocolPurpose
137UDPNetBIOS Name Service
138UDPNetBIOS Datagram Service
139TCPNetBIOS Session Service
445TCPSMB
5353UDPmDNS / Avahi

Host networking is recommended.

Security

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.

License

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.

Tag summary

Content type

Image

Digest

sha256:32d8f0c46

Size

94.4 MB

Last updated

4 days ago

docker pull travisback/samba