{"id":20332447,"url":"https://github.com/postfixadmin/docker","last_synced_at":"2025-10-08T12:49:20.628Z","repository":{"id":28256947,"uuid":"118003525","full_name":"postfixadmin/docker","owner":"postfixadmin","description":"Docker Image for PostfixAdmin","archived":false,"fork":false,"pushed_at":"2025-01-19T22:33:03.000Z","size":141,"stargazers_count":85,"open_issues_count":13,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-25T22:03:24.890Z","etag":null,"topics":["docker","php-application","postfixadmin"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/_/postfixadmin","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/postfixadmin.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":"2018-01-18T15:49:41.000Z","updated_at":"2025-05-04T13:02:41.000Z","dependencies_parsed_at":"2023-01-14T08:29:27.081Z","dependency_job_id":"d8288616-a9f7-4f70-a732-b461e90c2cfa","html_url":"https://github.com/postfixadmin/docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/postfixadmin/docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfixadmin%2Fdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfixadmin%2Fdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfixadmin%2Fdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfixadmin%2Fdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postfixadmin","download_url":"https://codeload.github.com/postfixadmin/docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postfixadmin%2Fdocker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278948019,"owners_count":26073747,"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-10-08T02:00:06.501Z","response_time":56,"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","php-application","postfixadmin"],"created_at":"2024-11-14T20:26:40.037Z","updated_at":"2025-10-08T12:49:20.622Z","avatar_url":"https://github.com/postfixadmin.png","language":"Shell","readme":"[![GitHub CI build status badge](https://github.com/postfixadmin/docker/workflows/GitHub%20CI/badge.svg)](https://github.com/postfixadmin/docker/actions?query=workflow%3A%22GitHub+CI%22)\n\u003c!--[![update.sh build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/postfixadmin.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/postfixadmin/)--\u003e\n[![Docker Pulls](https://img.shields.io/docker/pulls/library/postfixadmin)](https://hub.docker.com/_/postfixadmin)\n[![Docker Image Version](https://img.shields.io/docker/v/library/postfixadmin?sort=semver\u0026logo=postfixadmin\u0026label=Postfixadmin)](https://hub.docker.com/_/postfixadmin/tags)\n\n# Building\n\n * Clone this repo ( `git clone https://github.com/postfixadmin/docker.git docker` ) and then run :\n * `docker build --pull --rm -t postfixadmin-image \u003cVARIANT\u003e` from within the created directory (where \\\u003cVARIANT\\\u003e is replaced by apache, fpm or fpm-alpine)\n\n## Image Variants\n\nThe following variant are currently provided:\n\n### apache\n\nThis starts an Apache webserver with PHP, so you can use `postfixadmin` out of the box.\n\n### fpm-alpine\n\nThis image has a very small footprint. It is based on Alpine Linux and starts only a PHP FPM process. Use this variant if you already have a seperate webserver. \n\nIf you need more tools, that are not available on Alpine Linux, use the `fpm` image instead.\n\n### fpm\n\nThis image is based on Debian and starts only a PHP FPM container. \n\nUse this variant if you already have a seperate webserver.\n\n# Running\n\nSome knowledge of Postfixadmin is assumed. \n\nAdvanced users will probably want to specify a custom configuration (config.local.php file).\n\nIf you're just trying out the software, there's probably no need for a config.local.php file.\n\n\n## No config.local.php / no existing setup\n\nYou have two options :\n\n * Use a default sqlite database, or\n * Use an external database (MySQL, PgSQL etc).\n \nYou can configure this through the following environment variables when running the docker container.\n\n * POSTFIXADMIN\\_DB\\_TYPE=...  - sqlite, mysqli, pgsql\n * POSTFIXADMIN\\_DB\\_NAME=.... - database name or path to database file (sqlite)\n * POSTFIXADMIN\\_DB\\_USER=...  - mysqli/pgsql only (db server user name)\n * POSTFIXADMIN\\_DB\\_HOST=...  - hostname for database, default is localhost.\n * POSTFIXADMIN\\_DB\\_PORT=...  - port for the database (optional)\n * POSTFIXADMIN\\_DB\\_PASSWORD=... - mysqli/pgsql only (db server user password)\n * POSTFIXADMIN_ENCRYPT=... - database password encryption (e.g. md5crypt, SHA512-CRYPT)\n * POSTFIXADMIN\\_SETUP\\_PASSWORD=... - generated from setup.php or `php -r \"echo password_hash('mysecretpassword', PASSWORD_DEFAULT);\"` \n\nNote: An SQLite database is probably not recommended for production use, but is a quick and easy way to try out the software without dependencies.\n\nNote2: For details about database password encryption please refer to the [postfixadmin hashing documentation](https://github.com/postfixadmin/postfixadmin/blob/postfixadmin_3.3/DOCUMENTS/HASHING.md)\n\nYou can also set the postfix host and port.\n\n * POSTFIXADMIN\\_SMTP\\_SERVER=... - localhost per default\n * POSTFIXADMIN\\_SMTP\\_PORT=...   - 25 per default\n\nYou can enable DKIM through the following enviroment variables\n * POSTFIXADMIN\\_DKIM=...  - YES/NO\n * POSTFIXADMIN\\_DKIM\\_ALL\\_ADMINS=... - YES/NO\n\n### Using Docker secrets\n\nAs an alternative to passing sensitive information via environment variables, `_FILE` may be appended to some of the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/\u003csecret_name\u003e files. For example:\n\n```bash\ndocker run -e POSTFIXADMIN_DB_USER_FILE=/run/secrets/postfix-db-user\n           -e POSTFIXADMIN_DB_PASSWORD_FILE=/run/secrets/postfix-db-passwd\n           -e POSTFIXADMIN_SETUP_PASSWORD_FILE=/run/secrets/postfix-setup-passwd\n        postfixadmin\n```\n\nAll environment vars are supporting the secret's docker strategy.\n\nNote, the POSTFIXADMIN_SETUP_PASSWORD varaible contains dollar signs, so needs quoting to avoid variable expansion. See also #63\n\n### Example docker run\n\nSetup password is : mysecretpassword \n\n```bash\ndocker run -e POSTFIXADMIN_DB_TYPE=mysqli \\\n           -e POSTFIXADMIN_DB_HOST=whatever \\\n           -e POSTFIXADMIN_DB_USER=user \\\n           -e POSTFIXADMIN_DB_PASSWORD=changeme \\\n           -e POSTFIXADMIN_DB_NAME=postfixadmin \\\n           -e POSTFIXADMIN_SETUP_PASSWORD='$2y$10$3ycavDC7g.JQrxZRRDZ5IuS2O2Y6Rpl79XWTDnbI5nPREYfUIf6dK' \\\n           -e POSTFIXADMIN_SMTP_SERVER=postfix \\\n           -e POSTFIXADMIN_SMTP_PORT=25 \\\n           -e POSTFIXADMIN_ENCRYPT=md5crypt \\\n           -e POSTFIXADMIN_DKIM=YES \\\n           -e POSTFIXADMIN_DKIM_ALL_ADMINS=NO \\\n           --name postfixadmin \\\n           -p 8080:80 \\\n        postfixadmin\n```\n\nThen visit http://localhost:8080/setup.php. Use mysecretpassword to login to the page.\n\n## Existing setup / with config.local.php\n\nPostfixadmin's default configuration is stored in a config.inc.php file (see https://github.com/postfixadmin/postfixadmin/blob/master/config.inc.php ). \n\nTo customise, copy this file, remove everything you don't want to override, and call it **config.local.php**.\n\n\n```bash\ndocker run -v /local/path/to/config.local.php:/var/www/html/config.local.php \\\n           --name postfixadmin \\\n           -p 8080:80 \\\n           postfixadmin\n```\n\n# Next Steps\n\nOnce the container is running, try visiting :\n\n * http://localhost:8080/setup.php (to create admin users)\n * http://localhost:8080/ (to login as the domain admin you created through setup.php)\n\n\n# Docker Compose\n\nTry something like the below in a **docker-compose.yml** file; changing the usernames/passwords as required.\n\nThis is using a POSTFIXADMIN_SETUP_PASSWORD of 'mysecretpassword'. Note a $ is changed to $$ to get around variable expansion issues ( see #63 )\n\n## Steps \n\n 1. `docker compose up` \n 2. `docker compose logs -f postfixadmin` (it may take about 30s for the database to build, and the web ui to be ready)\n 3. Point your web browser at http://localhost:8000/setup.php - login with your setup password (mysecretpassword).\n 4. Add a super admin account .... \n 5. Visit http://localhost:8000/login.php and login with your new admin account, add mailboxes etc.\n\n\n```yaml\n\nservices:\n   db:\n     image: mysql:8.0\n     restart: always\n     environment:\n       MYSQL_ROOT_PASSWORD: notSecureChangeMe\n       MYSQL_DATABASE: postfixadmin\n       MYSQL_USER: postfixadmin\n       MYSQL_PASSWORD: postfixadminPassword\n\n   postfixadmin:\n     depends_on:\n       - db\n     image: postfixadmin:latest\n     ports:\n       - \"8000:80\"\n     restart: always\n     environment:\n       POSTFIXADMIN_DB_TYPE: mysqli\n       POSTFIXADMIN_DB_HOST: db\n       POSTFIXADMIN_DB_USER: postfixadmin\n       POSTFIXADMIN_DB_NAME: postfixadmin\n       POSTFIXADMIN_DB_PASSWORD: postfixadminPassword\n       POSTFIXADMIN_SMTP_SERVER: postfix\n       POSTFIXADMIN_SETUP_PASSWORD: $$2y$$10$$8./sbCrwpLGeWv/6auLtC.ROq/pRpm573QNdISESNqZ9p0uoL3eq6\n       POSTFIXADMIN_SMTP_PORT: 25\n       POSTFIXADMIN_ENCRYPT: md5crypt\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostfixadmin%2Fdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostfixadmin%2Fdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostfixadmin%2Fdocker/lists"}