Install the AWS IoT Greengrass Core software (CLI)
Note
These steps do not apply to nucleus lite.
To install and configure the AWS IoT Greengrass Core software
-
On your Greengrass core device, run the following command to switch to the home directory.
-
On your core device, download the AWS IoT Greengrass Core software to a file named
greengrass-nucleus-latest.zip
.By downloading this software, you agree to the Greengrass Core Software License Agreement
. -
Unzip the AWS IoT Greengrass Core software to a folder on your device. Replace
GreengrassInstaller
with the folder that you want to use. -
Run the following command to launch the AWS IoT Greengrass Core software installer. This command does the following:
-
Create the AWS resources that the core device requires to operate.
-
Set up the AWS IoT Greengrass Core software as a system service that runs at boot. On Linux devices, this requires the Systemd
init system. Important
On Windows core devices, you must set up the AWS IoT Greengrass Core software as a system service.
-
Deploy the AWS IoT Greengrass CLI component, which is a command-line tool that enables you to develop custom Greengrass components on the core device.
-
Specify to use the
ggc_user
system user to run software components on the core device. On Linux devices, this command also specifies to use theggc_group
system group, and the installer creates the system user and group for you.
Replace argument values in your command as follows.
-
or/greengrass/v2
C:\greengrass\v2
: The path to the root folder to use to install the AWS IoT Greengrass Core software. -
GreengrassInstaller
. The path to the folder where you unpacked the AWS IoT Greengrass Core software installer. -
region
. The AWS Region in which to find or create resources. -
MyGreengrassCore
. The name of the AWS IoT thing for your Greengrass core device. If the thing doesn't exist, the installer creates it. The installer downloads the certificates to authenticate as the AWS IoT thing. For more information, see Device authentication and authorization for AWS IoT Greengrass.Note
The thing name can't contain colon (
:
) characters. -
MyGreengrassCoreGroup
. The name of AWS IoT thing group for your Greengrass core device. If the thing group doesn't exist, the installer creates it and adds the thing to it. If the thing group exists and has an active deployment, the core device downloads and runs the software that the deployment specifies.Note
The thing group name can't contain colon (
:
) characters. -
GreengrassV2IoTThingPolicy
. The name of the AWS IoT policy that allows the Greengrass core devices to communicate with AWS IoT and AWS IoT Greengrass. If the AWS IoT policy doesn't exist, the installer creates a permissive AWS IoT policy with this name. You can restrict this policy's permissions for you use case. For more information, see Minimal AWS IoT policy for AWS IoT Greengrass V2 core devices. -
GreengrassV2TokenExchangeRole
. The name of the IAM role that allows the Greengrass core device to get temporary AWS credentials. If the role doesn't exist, the installer creates it and creates and attaches a policy named
. For more information, see Authorize core devices to interact with AWS services.GreengrassV2TokenExchangeRole
Access -
GreengrassCoreTokenExchangeRoleAlias
. The alias to the IAM role that allows the Greengrass core device to get temporary credentials later. If the role alias doesn't exist, the installer creates it and points it to the IAM role that you specify. For more information, see Authorize core devices to interact with AWS services.
Note
If you are running AWS IoT Greengrass on a device with limited memory, you can control the amount of memory that AWS IoT Greengrass Core software uses. To control memory allocation, you can set JVM heap size options in the
jvmOptions
configuration parameter in your nucleus component. For more information, see Control memory allocation with JVM options.When you run this command, you should see the following messages to indicate that the installer succeeded.
Successfully configured Nucleus with provisioned resource details! Configured Nucleus to deploy aws.greengrass.Cli component Successfully set up Nucleus as a system service
Note
If you have a Linux device and it doesn't have systemd
, the installer won't set up the software as a system service, and you won't see the success message for setting up the nucleus as a system service. -