Remote storage (Enterprise)

The Lab utilizes remote storage to securely store the shared data, ensuring sensitive information is protected. Without remote storage, Lab stores data in the browser where it becomes hard to share your progress with your team members or in cases when you use the Lab from different location or different browser.

Environment: Remote storage is available exclusively when the Lab is started in a Docker environment.

How to set it up

Remote storage requires a valid Memgraph Enterprise license configured on the Lab side. Ensure that you configure the following environment variables when running Lab with Docker:

VariableDescriptionType
ENTERPRISE_LICENSE_ORG_NAMEEnterprise license organization namestring
ENTERPRISE_LICENSE_KEYEnterprise license keystring

For example:

docker run \
  -p 3000:3000 \
  -e ENTERPRISE_LICENSE_ORG_NAME="My company" \
  -e ENTERPRISE_LICENSE_KEY="key..." \
  memgraph/lab

The enterprise license will be checked once you set up the remote storage. Remote storage should be a new Memgraph instance or a new Memgraph database in a multi-tenant environment.

Using a standalone Memgraph instance as remote storage

In this scenario, Memgraph should be used only for Lab purposes to store query-sharing information. Memgraph can be a community or enterprise version. Make sure your Memgraph is running and then set the following environment variables so Lab can connect to it for remote storage capability.

These two environment variables are required:

VariableDescriptionType
STORAGE_MG_HOSTMemgraph host for the Lab remote storagestring
STORAGE_MG_PORTMemgraph port for the Lab remote storagenumber

These variables are optional and depend on the configuration of the Memgraph instance:

VariableDescriptionType
STORAGE_MG_IS_ENCRYPTEDMemgraph SSL on/off for the Lab remote storageboolean
STORAGE_MG_USERNAMEMemgraph username for the Lab remote storagestring
STORAGE_MG_PASSWORDMemgraph password for the Lab remote storagestring

If your Memgraph instance has SSL defined and there is a username lab and password lab, the complete Docker command should look like this:

docker run \
  -p 3000:3000 \
  -e ENTERPRISE_LICENSE_ORG_NAME="My company" \
  -e ENTERPRISE_LICENSE_KEY="key..." \
  -e STORAGE_MG_HOST=127.0.0.1 \
  -e STORAGE_MG_PORT=7867 \
  -e STORAGE_MG_IS_ENCRYPTED=true \
  -e STORAGE_MG_USERNAME=lab \
  -e STORAGE_MG_PASSWORD=lab \
  memgraph/lab

If there is no username or password and Memgraph is accepting non-SSL connections, omit the optional environment variables:

docker run \
  -p 3000:3000 \
  -e ENTERPRISE_LICENSE_ORG_NAME="My company" \
  -e ENTERPRISE_LICENSE_KEY="key..." \
  -e STORAGE_MG_HOST=127.0.0.1 \
  -e STORAGE_MG_PORT=7867 \
  memgraph/lab

Upon successful configuration, you should see the following log output when starting the Lab:

INFO: [lab] Checking connectivity to remote storage *** with a timeout of *** ms...
INFO: [lab] Enterprise license applied successfully. Enjoy the premium features.
...
INFO: [lab] Remote storage *** successfully connected.

Using a Memgraph multi-tenant environment as remote storage

This scenario works only with Memgraph Enterprise because multi-tenancy is an enterprise feature. In a multi-tenant environment, you can use your existing Memgraph instance with a new database that Lab will use for remote storage to store information.

These three environment variables are required:

VariableDescriptionType
STORAGE_MG_HOSTMemgraph host for the Lab remote storagestring
STORAGE_MG_PORTMemgraph port for the Lab remote storagenumber
STORAGE_MG_DATABASE_NAMEMemgraph database name for the Lab remote storagestring

These variables are optional and depend on the configuration of the Memgraph instance:

VariableDescriptionType
STORAGE_MG_IS_ENCRYPTEDMemgraph SSL on/off for the Lab remote storageboolean
STORAGE_MG_USERNAMEMemgraph username for the Lab remote storagestring
STORAGE_MG_PASSWORDMemgraph password for the Lab remote storagestring

Let’s say that you already created a new database called lab in your enterprise Memgraph instance for remote storage. For better security, it is recommended to always define usernames and passwords. However, if it accepts non-SSL connections with no username or password, the following command should make Lab successfully connect to the remote storage:

docker run \
  -p 3000:3000 \
  -e ENTERPRISE_LICENSE_ORG_NAME="My company" \
  -e ENTERPRISE_LICENSE_KEY="key..." \
  -e STORAGE_MG_HOST=127.0.0.1 \
  -e STORAGE_MG_PORT=7867 \
  -e STORAGE_MG_DATABASE_NAME=lab \
  memgraph/lab

If your Memgraph instance has SSL defined and there is a username lab and password lab, the complete Docker command should look like this:

docker run \
  -p 3000:3000 \
  -e ENTERPRISE_LICENSE_ORG_NAME="My company" \
  -e ENTERPRISE_LICENSE_KEY="key..." \
  -e STORAGE_MG_HOST=127.0.0.1 \
  -e STORAGE_MG_PORT=7867 \
  -e STORAGE_MG_IS_ENCRYPTED=true \
  -e STORAGE_MG_USERNAME=lab \
  -e STORAGE_MG_PASSWORD=lab \
  memgraph/lab

Upon successful configuration, you should see the following log output when starting the Lab:

INFO: [lab] Checking connectivity to remote storage *** with a timeout of *** ms...
INFO: [lab] Enterprise license applied successfully. Enjoy the premium features.
...
INFO: [lab] Remote storage *** successfully connected.