A lightweight, containerized SMB/CIFS server based on Ubuntu 24.04, designed for testing and development purposes.
You can run this container using either Docker or Podman.
-
Save the following as
compose.ymlor use the one provided in the repository:services: smb: image: ghcr.io/beezy-dev/smb:latest container_name: smb environment: NAME: "data" USER: "smb" PASS: "smb" RW: true UID: 1000 GID: 1000 ports: - "445:445" volumes: - smb:/storage restart: always volumes: smb: driver: local
-
Start the service:
docker compose up -d
You can use podman-compose with the same YAML file above, or run it directly via CLI.
podman-compose up -dpodman run -d \
--name smb \
--restart always \
-p 445:445 \
-e NAME="data" \
-e USER="smb" \
-e PASS="smb" \
-e RW=true \
-e UID=1000 \
-e GID=1000 \
-v smb:/storage \
ghcr.io/beezy-dev/smb:latest| Variable | Default | Description |
|---|---|---|
NAME |
data |
Name of the SMB share. |
USER |
smb |
Username for the SMB user. |
PASS |
smb |
Password for the SMB user. |
UID |
1000 |
User ID for the samba user (matches host permissions). |
GID |
1000 |
Group ID for the samba user. |
RW |
true |
Set to true for read-write access, false for read-only. |
DEBUG_LEVEL |
1 |
Samba debug level (0-10). |
- /storage: The directory where data is stored and shared.
- In the examples above, this is mapped to a named volume
smb.
- In the examples above, this is mapped to a named volume
To create multiple users, map a file to /etc/samba/users.conf with the following format:
username:uid:groupname:gid:password:homedir
Example users.conf:
alice:1001:users:100:password123:/storage/alice
bob:1002:users:100:secret456:/storage/bob
If you build the image locally and uncommented the HEALTHCHECK instruction in the Dockerfile, you must use the --format docker flag with Podman:
podman build -t smb-test --format docker .This is because HEALTHCHECK is a Docker-specific feature not present in the default OCI image format used by Podman.