{"id":20399513,"url":"https://github.com/mujz/lets-encrypt-docker","last_synced_at":"2026-06-07T11:31:22.213Z","repository":{"id":124436216,"uuid":"78815107","full_name":"mujz/lets-encrypt-docker","owner":"mujz","description":"Free SSL cert with one command from Let's Encrypt","archived":false,"fork":false,"pushed_at":"2018-11-15T09:53:18.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T11:17:25.144Z","etag":null,"topics":["cert","certbot","certificate","docker","letsencrypt","ssl"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mujz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-01-13T04:25:00.000Z","updated_at":"2022-09-16T11:39:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"54f297db-1bc7-42d9-87c1-2f2fdb4be722","html_url":"https://github.com/mujz/lets-encrypt-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujz%2Flets-encrypt-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujz%2Flets-encrypt-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujz%2Flets-encrypt-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mujz%2Flets-encrypt-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mujz","download_url":"https://codeload.github.com/mujz/lets-encrypt-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241946570,"owners_count":20047031,"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","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":["cert","certbot","certificate","docker","letsencrypt","ssl"],"created_at":"2024-11-15T04:29:42.063Z","updated_at":"2026-06-07T11:31:22.187Z","avatar_url":"https://github.com/mujz.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Let's Encrypt Certbot\nGet a signed SSL certificate from [Let's Encrypt](https://letsencrypt.org) with one command.\n\n# Usage\n\n## Issuing a new certificate:\n\n```shell\ndocker run -it --rm \\\n\t-p 80:80 -p 443:443 \\\n\t-e DOMAINS=\"example.com www.example.com\" \\\n\t-v $(pwd)/out:/etc/letsencrypt \\\n\tmujz/lets-encrypt-docker\n```\n\nYou'll be asked to enter your email address and agree to the terms of service next. The cert files will then be generated for you inside the `out` directory. Make sure you set your own domains instead of the \"example\" ones. \n\n## Renewing an existing certificate:\n\n```shell\ndocker run --rm -v $(pwd)/out:/etc/letsencrypt mujz/lets-encrypt-docker certbot renew\n```\n\nThis will renew your certificate for you if it is due for renewal.\nYou can also set up a cron job so you don't have to do it manually every 3 months. To do this in Ubuntu, for example, you can run `crontab -e` and paste:\n\n```\n30 2 * * 1 /usr/bin/docker run --rm -v \u003clocal_lets_encrypt_dir\u003e:/etc/letsencrypt mujz/lets-encrypt-docker certbot renew \u003e\u003e /var/log/le_renew.log\n35 2 * * 1 /usr/bin/docker restart \u003cserver_container\u003e\n```\n\nThis will run the renew job every week on Monday at 2:30 in the morning.\n\n# How it works\n\nLet's start by disecting the command above:\n\n- `docker run --rm -it` runs an interactive docker container that will be deleted once it is stopped.\n- `-p 80:80 -p 443:443` maps the host ports 80 and 443 to those of the container.\n- `-e DOMAINS=\"example.com www.example.com\"` sets the container's environment variable `DOMAINS` to the domains you want to get the cert for. The certbot looks at this variable to generate the certs.\n- `-v $(pwd)/out:/etc/letsencrypt/live` mounts the local directory \"out\" onto the container's \"/etc/letsencrypt/live\", which is where the cert files will be generated.\n- `mujz/lets-encrypt-docker` tells docker to run this image.\n\nThe image is built by installing certbot on `debian:jessie`. When the run command is executed, we first check if the `DOMAINS` env variable was set and then run `certbot certonly --standalone`, which starts a local server on the ports 80 and 443 and generates the certificate.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujz%2Flets-encrypt-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmujz%2Flets-encrypt-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmujz%2Flets-encrypt-docker/lists"}