- Newest
- Most votes
- Most comments
When working with AWS IoT Greengrass in Docker containers, it's important to use permanent certificates rather than claim certificates for reliable and continuous device connectivity. Here's a best practice approach for handling permanent certificates with AWS IoT Greengrass in Docker:
-
Create an AWS IoT thing: First, register your device as an AWS IoT thing in the AWS IoT Core console. This process will generate permanent X.509 certificates for your device.
-
Download the certificates: After creating the thing, download the device certificate, private key, public key, and the Amazon Root CA certificate. These are the permanent credentials your device will use.
-
Store certificates securely: Create a dedicated folder on your host machine to store these security resources. For example, you might create a folder like "certs" in your user's Downloads directory.
-
Move certificates to the secure folder: Transfer the downloaded certificates and keys to this secure folder. Ensure you move the device certificate, private key, public key, and the Amazon Root CA certificate.
-
Configure Docker volume: When running your Greengrass Docker container, use a volume mount to make these certificates available inside the container. This allows the container to access the certificates without embedding them in the image, which is more secure.
-
Update Greengrass configuration: Ensure your Greengrass configuration file (config.json) points to the correct locations of these certificates within the container's file system.
-
Run the Docker container: When starting your Greengrass Docker container, include the volume mount for the certificates. For example:
docker run -it --rm --name aws-iot-greengrass \ -v /path/to/certs:/greengrass/certs \ -v /path/to/config:/greengrass/config \ amazon/aws-iot-greengrass -
Implement certificate rotation: Although these certificates are long-lived, it's a good security practice to rotate them periodically. AWS IoT Greengrass supports automatic certificate rotation for the local MQTT server. You can configure the rotation period (between 7 and 30 days) in the Greengrass group settings.
By following these steps, you'll be using permanent certificates that don't expire after 24 hours, allowing your devices to maintain long-term connectivity with AWS IoT, even after interruptions. Remember to keep your certificates and private keys secure at all times, as they are used to authenticate your device to AWS IoT services.
Sources
Device authentication and authorization for AWS IoT Greengrass - AWS IoT Greengrass
Provision an AWS IoT thing to use as a Greengrass core - AWS IoT Greengrass
Running AWS IoT Greengrass in a Docker container - AWS IoT Greengrass
Device authentication and authorization for AWS IoT Greengrass - AWS IoT Greengrass
answered 2 years ago
The shell scripts assume a set of SigV4 credentials and then go down the process of generating the claim certificates. Prior to launching GreenGrass, you should generate and store permanent credentials (which can be via a claim process) and persist those for the next time the containers need to start. If you have SigV4 IAM credentials today, you can do that if the role permits the needed iot: actions.
answered 2 years ago
Relevant content
asked 5 years ago
asked 3 years ago
- AWS OFFICIALUpdated 2 years ago

Thank you for your answer.
Unfortunately, this is a bit too manual for me, I would like to have an automated approach - sorry, but I had not communicated this before.
I will add my current non-functioning script to my original question. This script is started when the docker container is started/built