{"id":18841978,"url":"https://github.com/ahmetozer/docker-samba","last_synced_at":"2025-09-07T02:08:10.387Z","repository":{"id":136065541,"uuid":"237850219","full_name":"ahmetozer/docker-samba","owner":"ahmetozer","description":"It's a container image. It has a auto configrator tool to easy and fast install. You can manage your network shares with single commands.","archived":false,"fork":false,"pushed_at":"2021-05-16T18:32:59.000Z","size":20,"stargazers_count":3,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-18T12:23:42.427Z","etag":null,"topics":["arm","arm64","armv6","armv7","container","docker","docker-container","file","file-share","folder","folder-share","raspberrypi","reload-samba","samba","samba-container","server","share","sharename","x64","x86"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/ahmetozer/samba","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmetozer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-02T23:03:49.000Z","updated_at":"2023-03-08T08:18:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"d18b3abc-7a59-4e5e-96e6-fe427f575c02","html_url":"https://github.com/ahmetozer/docker-samba","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ahmetozer/docker-samba","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetozer%2Fdocker-samba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetozer%2Fdocker-samba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetozer%2Fdocker-samba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetozer%2Fdocker-samba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmetozer","download_url":"https://codeload.github.com/ahmetozer/docker-samba/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmetozer%2Fdocker-samba/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273986629,"owners_count":25202708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","arm64","armv6","armv7","container","docker","docker-container","file","file-share","folder","folder-share","raspberrypi","reload-samba","samba","samba-container","server","share","sharename","x64","x86"],"created_at":"2024-11-08T02:53:15.610Z","updated_at":"2025-09-07T02:08:10.359Z","avatar_url":"https://github.com/ahmetozer.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Samba for Docker Containers\n\nEasy to use samba file share server for docker containers.\n\n## Getting Container Image\n\nFor the installation you can use docker pull command to get samba container\n\n```bash\ndocker pull ahmetozer/samba\n```\n\nIf you want to build in your computer you can use git and docker build\n\n```bash\ngit clone git@github.com:AhmetOZER/docker-samba.git\ncd docker-samba\ndocker build -t samba .\n```\n\n---\n\n## Basic Run\n\nIt is easy to use and configure with automated script.\n\n```bash\ndocker run -it ahmetozer/samba\n ```\n\n## Accessing container network\n\nThere is a few option at this point.\nFirst one is 1 docker container and share with docker-proxy with -p argumant.\n\n```bash\ndocker run -it -p 445:445 ahmetozer/samba \n```\n\nSecond one is without port share. Each docker container has a own static IP address and it is accessible only local network.\n\n```bash\ndocker run -it ahmetozer/samba --ip 172.17.0.80\n```\n\n## Share Folders With Samba Container\n\nIf you want to share outside of folder you can use -v argumant while creating docker.\n-v has a \":\" to bind local and container folder. Before the \":\" it's your server directory, after the \":\" it's your container directory\nFor example your website files at /var/www directory and you want to share your web folder with samba.\n\n```bash\nserver:~# docker run -it -v/var/www:/share/web ahmetozer/samba\nHello. You are installing samba server\nusername » root\nPlease enter password (at least 8 character) random password 1dM3ltN6 »\nPlease retype password »\nNew SMB password:\nRetype new SMB password:\nAdded user root.\nShare Name » web\nShare Comment » web Directory\nShare path » /share/web\nValid users for web » root\nRe generating config file\nReloading samba service\n```\n\n---\n\n## Container Commands\n\nThis script also has a some basic futures.\n\n### Add User\n\nTo add new user in samba container\n\n```bash\nuseradd\n```\n\nExample\n\n```bash\n36f60553d4aa:/# useradd\nusername » web\nPlease enter password (at least 8 character) random password AjNvK3Gb »\nPlease retype password »\nNew SMB password:\nRetype new SMB password:\nAdded user web.\nReloading samba service\n\n###   OR\n36f60553d4aa:/# useradd root3 mypassword\nNew SMB password:\nRetype new SMB password:\nAdded user root3.\nReloading samba service\n\n###   OR\n36f60553d4aa:/# useradd root5\nPlease enter password (at least 8 character) random password VsQLHn5C »\nPlease retype password »\nNew SMB password:\nRetype new SMB password:\nAdded user root5.\nReloading samba service\n\n```\n\n### Add Share\n\nAdd new folder share\n\nNote: You can't add outside of docker container folder to share with samba after first run. If you want to share outside of the container folder, you have to use -v argument to bind Moby folder to container folder.\n\n```bash\nshareadd  \n```\n\nExample\n\n```bash\n36f60553d4aa:/# shareadd\nShare Name » newshare\nShare Comment » newshare Directory\nShare path » /share/newshare\nValid users for newshare » newshare\nRe generating config file\nReloading samba service\n\n###   OR\n36f60553d4aa:/# shareadd newshare \"/share/newshare\" \"newshareuser\" \"newshare Directory\"\nShare Name » newshare\nShare Comment » newshare Directory\nShare path » /share/newshare\nValid users for newshare » newshareuser\nRe generating config file\nReloading samba service\n\n```\n\n### List Shares\n\nYou can see your shares in container with sharelist command.\n\n```bash\nsharelist\n```\n\nExample\n\n```bash\n36f60553d4aa:/# sharelist\nnewshare\nroot\n```\n\n### Show Configure of Share\n\nShow share samba configration.\n\n```bash\nshareshow\n```\n\nExample\n\n```bash\n36f60553d4aa:/# shareshow newshare\n[newshare]\n              comment = newshare Directory\n              path = /share/newshare\n              read only = No\n              writeable = yes\n              browsable = yes\n              valid users = newshare\n              public = no\n              create mask = 0640\n              directory mask = 0750\n              guest ok = no\n```\n\n### Update Samba Configuration\n\nIf you add new share without \"shareadd\" or \"useradd\" commands, like a add with custom config with nano, you can update configure and reload samba with update-samba.\n\n```bash\nupdate-samba\n```\n\nExample\n\n```bash\n36f60553d4aa:/# update-samba\nRe generating config file\nReloading samba service\n\n```\n\n### Delete Share\n\nIf you want to delete share in docker container, you can use sharedel command.\n\n```bash\nsharedel\n```\n\nExample\n\n```bash\n36f60553d4aa:/# sharedel newshare\nDeleting file /etc/samba/conf.d/newshare.conf\nRe generating config file\nReloading samba service\n```\n\n### Reload Samba\n\nTo reload samba.\n\n```bash\nreload-samba\n ```\n\n---\n\n## Fast Install\n\nThis script also has a fast install option. Set sharename variable to use fast install option.\n\n```bash\nserver:/#docker run -v/var/www:/share/web -e sharename=web -it ahmetozer/samba\nYour password is c3b-NbmV\nNew SMB password:\nRetype new SMB password:\nAdded user root.\nRe generating config file\nReloading samba service\n```\n\nIf you don't want to use random password, set the password variable.\n\n```bash\nserver:/#docker run -it -v/var/www:/share/web -e sharename=web -e password=1234578 ahmetozer/samba\nNew SMB password:\nRetype new SMB password:\nAdded user root.\nRe generating config file\nReloading samba service\n```\n\nOR you can set passato to no and script will be ask password in terminal\n\n```bash\nserver:/#docker run --rm -it -e sharename=web -e passato=no ahmetozer/samba\nPlease enter password (at least 8 character) random password 8jUPPDVb »\nPlease retype password »\nNew SMB password:\nRetype new SMB password:\nAdded user root.\nShare name » web\nshare dir » /share/root\nshare comment » root directory\nshare valid users » root\nRe generating config file\nReloading samba service\n```\n\nFast install supported variables username, sharename, sharecomment, sharepath and passato.\n\n---\n\nSamba share configs are stored at  /etc/samba/conf.d/ in docker container directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetozer%2Fdocker-samba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmetozer%2Fdocker-samba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmetozer%2Fdocker-samba/lists"}