Skip to main content

Setup the environment

Open the .env file in your favorite text editor. Here you can edit docker's variables to match your current environment. Right now we're only interested in the SEEDS_* variables, which are used to populate the database.

VariableDescription
SEEDS_REALMThe name of your Data Orchestrator realm. It should match what you've created in your Data Orchestrator setup
SEEDS_REALM_PRIVATE_KEY_FILEThe location of the realm's private key file (test_private.pem from the Data Orchestrator in 5 minutes guide)
SEEDS_TENANT_PRIVATE_KEY_FILEThe location of the tenant's private key file
SEEDS_ASTARTE_BASE_API_URLThe endpoint for Data Orchestrator API.

If for whatever reason you don't want to edit the .env file, you can also export environment variables of the same name.

SEEDS_REALM and SEEDS_ASTARTE_BASE_API_URL should already be set for you, so only edit those if needed.

SEEDS_REALM_PRIVATE_KEY_FILE must point to the private key of the test realm you created in Data Orchestrator. If you followed the "Data Orchestrator in 5 minutes" guide, astartectl generated the key as test_private.pem in the Data Orchestrator repository, so set this variable to its full path, for example ../astarte/test_private.pem. Keeping the default value (the bundled realm_private.pem) would prevent Device Manager from communicating with your Data Orchestrator instance.

Generate a key pair for the tenant​

Although it is possible to use a default key, it is recommended to have your own key pair for the tenant.

You should already have astartectl installed from the Data Orchestrator in 5 minutes guide.

$ astartectl utils gen-keypair acme

This creates acme_private.pem and acme_public.pem in the current working directory.

Remember to update the .env file, setting SEEDS_TENANT_PRIVATE_KEY_FILE to the location of acme_private.pem (e.g. ./acme_private.pem if you ran the command in the edgehog directory)!

The SEEDS_* variables and the key files are read by Docker Compose when the containers are created, so make sure to edit .env and generate your key pairs before starting the containers. If you already ran docker compose up -d, recreate the containers for the changes to take effect:

$ docker compose up -d --force-recreate