{"id":39628262,"url":"https://github.com/adrianmusante/docker-samba","last_synced_at":"2026-01-18T08:39:15.942Z","repository":{"id":245946595,"uuid":"815395724","full_name":"adrianmusante/docker-samba","owner":"adrianmusante","description":"An updated version of the Samba Docker image, originally developed by dperson/samba","archived":false,"fork":false,"pushed_at":"2025-12-20T18:14:45.000Z","size":278,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-22T06:36:37.124Z","etag":null,"topics":["docker","samba","samba-server"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/adrianmusante/samba","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrianmusante.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-06-15T03:37:25.000Z","updated_at":"2025-12-20T18:13:17.000Z","dependencies_parsed_at":"2024-06-25T00:33:39.060Z","dependency_job_id":"90a6e92b-2a62-4c03-8928-17e1142679ef","html_url":"https://github.com/adrianmusante/docker-samba","commit_stats":null,"previous_names":["adrianmusante/docker-samba"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/adrianmusante/docker-samba","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmusante%2Fdocker-samba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmusante%2Fdocker-samba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmusante%2Fdocker-samba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmusante%2Fdocker-samba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrianmusante","download_url":"https://codeload.github.com/adrianmusante/docker-samba/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrianmusante%2Fdocker-samba/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["docker","samba","samba-server"],"created_at":"2026-01-18T08:39:15.507Z","updated_at":"2026-01-18T08:39:15.926Z","avatar_url":"https://github.com/adrianmusante.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![logo](https://github.com/adrianmusante/docker-samba/assets/38815440/f72b6c2a-637d-4a66-bbb9-7db4cbde3bb4)](https://www.samba.org)\n\n\n# Samba\n\nAn updated version of the Samba Docker image, originally developed by [dperson/samba](https://github.com/dperson/samba).\n\n## What is Samba?\n\nSince 1992, Samba has provided secure, stable and fast file and print services\nfor all clients using the SMB/CIFS protocol, such as all versions of DOS and\nWindows, OS/2, Linux and many others.\n\n## Docker registry\n\nThe recommended way to get Samba Docker Image is to pull the prebuilt image from the [Docker Hub Registry](https://hub.docker.com/r/adrianmusante/samba).\n\nTo use a specific version, you can pull a versioned tag. You can view the [list of available versions](https://hub.docker.com/r/adrianmusante/samba/tags/) in the Docker Hub Registry.\n\n- [`4`, `4.22`, `latest` (samba/Dockerfile)](https://github.com/adrianmusante/docker-samba/blob/main/samba/Dockerfile)\n\n\n## Configuration\n\n### How to use this image\n\nBy default there are no shares configured, additional ones can be added.\n\n\n    docker run -it -p 139:139 -p 445:445 -d adrianmusante/samba -p\n\nOR set local storage:\n\n    docker run -it --name samba -p 139:139 -p 445:445 \\\n                -v /path/to/directory:/mount \\\n                -d adrianmusante/samba -p\n\n### Command options\n\nWhen starting the container you can pass options to the `samba` command. \nFor see the available options run:\n\n    $ docker run -it --rm adrianmusante/samba -h\n    Usage: samba [-opt] [command]\n    Options (fields in '[]' are optional, '\u003c\u003e' are required):\n        -h          This help\n        -c \"\u003cfrom:to\u003e\" setup character mapping for file/directory names\n                    required arg: \"\u003cfrom:to\u003e\" character mappings separated by ','\n        -G \"\u003csection;parameter\u003e\" Provide generic section option for smb.conf\n                    required arg: \"\u003csection\u003e\" - IE: \"share\"\n                    required arg: \"\u003cparameter\u003e\" - IE: \"log level = 2\"\n        -g \"\u003cparameter\u003e\" Provide global option for smb.conf\n                    required arg: \"\u003cparameter\u003e\" - IE: \"log level = 2\"\n        -i \"\u003cpath\u003e\" Import smbpassword\n                    required arg: \"\u003cpath\u003e\" - full file path in container\n        -n          Start the 'nmbd' daemon to advertise the shares\n        -p          Set ownership and permissions on the shares\n        -r          Disable recycle bin for shares\n        -S          Disable SMB2 minimum version\n        -s \"\u003cname;/path\u003e[;browse;readonly;guest;users;admins;writelist;comment]\"\n                    Configure a share\n                    required arg: \"\u003cname\u003e;\u003c/path\u003e\"\n                    \u003cname\u003e is how it's called for clients\n                    \u003cpath\u003e path to share\n                    NOTE: for the default values, just leave blank\n                    [browsable] default:'yes' or 'no'\n                    [readonly] default:'yes' or 'no'\n                    [guest] allowed default:'yes' or 'no'\n                    NOTE: for user lists below, usernames are separated by ','\n                    [users] allowed default:'all' or list of allowed users\n                    [admins] allowed default:'none' or list of admin users\n                    [writelist] list of users that can write to a RO share\n                    [comment] description of share\n        -u \"\u003cusername;password\u003e[;ID;group;GID]\"       Add a user\n                    required arg: \"\u003cusername\u003e;\u003cpasswd\u003e\"\n                    \u003cusername\u003e for user\n                    \u003cpassword\u003e for user\n                    [ID] for user\n                    [group] for user\n                    [GID] for group\n        -w \"\u003cworkgroup\u003e\"       Configure the workgroup (domain) samba should use\n                    required arg: \"\u003cworkgroup\u003e\"\n                    \u003cworkgroup\u003e for samba\n        -W          Allow access wide symbolic links\n        -I          Add an include option at the end of the smb.conf\n                    required arg: \"\u003cinclude file path\u003e\"\n                    \u003cinclude file path\u003e in the container, e.g. a bind mount\n\n    The 'command' (if provided and valid) will be run instead of samba\n\n### Environment variables\n\nThe container can also be configured with environment variables.\nWhen you start the Samba image, you can adjust the configuration of the instance by passing one or more environment \nvariables either on the docker-compose file or on the `docker run` command line.\nIf you want to add a new environment variable:\n\n- `PUID`: Set the UID for the samba server's default user (smbuser)\n- `PGID`: Set the GID for the samba server's default user (smbuser)\n- `TZ`: Set a timezone, IE `EST5EDT`\n- `SAMBA_DEBUG`: Verbose mode. Default: **false**\n- `SAMBA_LOG_LEVEL`: Set the log level (0-10). Higher levels generate more detailed logs, but should only be used for debugging. The default is 0 (only critical errors and warnings) but if `SAMBA_DEBUG` is enabled the default value is 3.\n- `SAMBA_CHARMAP`: As above, configure character mapping\n- `SAMBA_GENERIC`: As above, configure a generic section option (See NOTE3 below)\n- `SAMBA_GLOBAL`: As above, configure a global option (See NOTE3 below)\n- `SAMBA_IMPORT`: As above, import a smbpassword file\n- `SAMBA_NMBD`: As above, enable nmbd\n- `SAMBA_PERMISSIONS`: As above, set file permissions on all shares\n- `SAMBA_RECYCLE`: As above, disable recycle bin\n- `SAMBA_SHARE`: As above, setup a share (See NOTE3 below)\n- `SAMBA_SMB`: As above, disable SMB2 minimum version\n- `SAMBA_USER`: As above, setup a user (See NOTE3 below)\n- `SAMBA_WIDELINKS`: As above, allow access wide symbolic links\n- `SAMBA_WORKGROUP`: As above, set workgroup\n- `SAMBA_INCLUDE`: As above, add a smb.conf include\n\n\n**NOTE**: if you enable nmbd (via `-n` or the `SAMBA_NMBD` environment variable), you\nwill also want to expose port 137 and 138 with `-p 137:137/udp -p 138:138/udp`.\n\n**NOTE2**: there are reports that `-n` and `SAMBA_NMBD` only work if you have the\ncontainer configured to use the hosts network stack.\n\n**NOTE3**: optionally supports additional variables starting with the same name,\nIE `SAMBA_SHARE` also will work for `SAMBA_SHARE2`, `SAMBA_SHARE3`... `SAMBA_SHAREx`, etc.\n\n## Examples\n\nAny of the commands can be run at creation with `docker run` or later with\n`docker exec -it samba samba` (as of version 1.3 of docker).\n\n### Setting the Timezone\n\n    docker run -it -e TZ=EST5EDT -p 139:139 -p 445:445 -d adrianmusante/samba -p\n\n### Start an instance creating users and shares:\n\n    docker run -it -p 139:139 -p 445:445 -d adrianmusante/samba -p \\\n                -u \"example1;badpass\" \\\n                -u \"example2;badpass\" \\\n                -s \"public;/share\" \\\n                -s \"users;/srv;no;no;no;example1,example2\" \\\n                -s \"example1 private share;/example1;no;no;no;example1\" \\\n                -s \"example2 private share;/example2;no;no;no;example2\"\n\n### Start an instance without NetBIOS:\n\n    docker run -it -e SAMBA_GLOBAL=\"disable netbios = yes\" -e SAMBA_GLOBAL_1=\"netbios name = $(hostname)\" \\\n                -p 445:445 -d adrianmusante/samba -p \\\n                -u \"example1;badpass\" \\\n                -u \"example2;badpass\" \\\n                -s \"public;/share\" \\\n                -s \"users;/srv;no;no;no;example1,example2\" \\\n                -s \"example1 private share;/example1;no;no;no;example1\" \\\n                -s \"example2 private share;/example2;no;no;no;example2\"\n\n## User Feedback\n\n### Troubleshooting\n\n* You get the error `Access is denied` (or similar) on the client and/or see\n`change_to_user_internal: chdir_current_service() failed!` in the container\nlogs.\n\nAdd the `-p` option to the end of your options to the container, or set the\n`SAMBA_PERMISSIONS` environment variable.\n\n    docker run -it --name samba -p 139:139 -p 445:445 \\\n                -v /path/to/directory:/mount \\\n                -d adrianmusante/samba -p\n\nIf changing the permissions of your files is not possible in your setup you\ncan instead set the environment variables `PUID` and `PGID` to the\nvalues of the owner of your files.\n\n* High memory usage by samba. Multiple people have reported high memory usage\nthat's never freed by the samba processes. Recommended work around below:\n\nAdd the `-m 512m` option to docker run command, or `mem_limit:` in\ndocker_compose.yml files, IE:\n\n    docker run -it --name samba -m 512m -p 139:139 -p 445:445 \\\n                -v /path/to/directory:/mount \\\n                -d adrianmusante/samba -p\n\n* Attempting to connect with the `smbclient` command-line tool: By default, Samba\ntries to use SMB1, which is deprecated and has security issues. This\ncontainer defaults to SMB2, but for no discernible reason, even though it's\nsupported, it is disabled by default. Run the command as `smbclient -m SMB3` along with\nany other options you would specify.\n\n### Issues\n\nIf you have any problems with or questions about this image, please contact me\nthrough a [GitHub issue](https://github.com/adrianmusante/docker-samba/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmusante%2Fdocker-samba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrianmusante%2Fdocker-samba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrianmusante%2Fdocker-samba/lists"}