Sparrow is configured using environment variables.
Configuration variables are most often set in the
which much be present in the root directory of your Sparrow lab instance. If
sparrow-secrets.sh file will
also be applied, in that order. These "secret" files are designed to contain lab-specific
secret keys, tokens, and other values that should not be added to version control.
Here are a few of the most important variables:
SPARROW_SECRET_KEY="very secret string": A secret key used for management of passwords. Set this in your LOCAL environment (it will be copied to the Docker runtime as needed). It is the only variable required to run a basic test application.
SPARROW_ENV=<development,production>environment variable defaults to
production, which disable development-focused features such as live code reloading and sourcemaps for performance and security.
SPARROW_HTTPS_PORTare used to configure the ports on which Sparrow can be accessed.
SPARROW_HTTP_PORT=5002by default, but
SPARROW_HTTPS_PORT=4435002` are typically used to serve the application publicly.
SPARROW_BACKEND_CONFIG="<path>": Location of
.cfgfiles containing backend configuration. When running in Docker, these values typically do not need to be changed.
- The frontend is configured using the variables
Configuring Sparrow for HTTPS
One of the most important environment variables has to do with running Sparrow using HTTPS transport security. Most commonly, this is done using Certbot, a free service that manages certificates. Certbot will automatically create certificates and update them on a regular basis. To set up Certbot, the following config values must be set:
SPARROW_DOMAIN=<domain>: The domain name (including optional subdomain) of the Sparrow instance. For example,
CERTBOT_EMAIL=<email>: The email address associated with the certificate.
If configured, Sparrow will serve SSL on port 443. This can be adjusted with the
More detailed configurations can be set by directly using docker-compose environment variables.