Image: samba-logo.png

Samba Docker Container

by on
1 minute read

Installing and configuring Samba using Docker and Portainer Stacks

1. Terminal via cmdline

Open terminal, copy, adapt and send:

docker run -d \
-p 139:139 \
-p 445:445 \
-e TZ=Europe/Lisbon \
-v /docker:/share \
elswork/samba:latest \
-u "1000:1000:USERNAME:USERNAME:PASSWORD" \
-s "SmbShare:/share:rw:USERNAME"



2. Environments File

On the PC create environments text file named e.g. configs.env or download the file from here

USERNAME=JApoOgeY1PF7qqylo4
PASSWORD=uJ6CYqSp266IiijD7K

folder_to_share=/docker/

PUID=1000
PGID=1000

TZ=Europe/Lisbon

Reset_Mode=unless-stopped
tag_samba=latest
watchtower_autoupdate=false


Adapt to your needs.
folder_to_share is the folder you want to share over smb.
USERNAME & PASSWORD are the login details you will be using.
PUID & PGID are you user id and your group id. default generally is 1000.
TZ is your timezone.

If you are not sure what to do about Reset_Mode & tag_samba & watchtower_autoupdate leave them as they are.

3. Deploy using a Git repository

Choose Repository option as building method.

Reposity URL:

https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/src/branch/master


Compose path:

samba/samba.yml



Example:

4. Testing


If you are using Windows 🙄 the folder should now be available opening File Explorer and navigating to: \\samba_IP

On Linux distros should be available navigating to: smb://samba_ip

comments powered by Disqus