> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/open-source/new-to-harness-open-source/settings.md).

# Configurations

Configure a Harness Open Source instance with the following Docker [environment variables](https://docs.docker.com/compose/environment-variables/set-environment-variables/).

This command starts a Harness Open Source instance and enables the **Admin** account. It disables user registration. The **Admin** account creates all user accounts manually.

```{}
docker run -d \
  -e GITNESS_PRINCIPAL_ADMIN_EMAIL=mail@example.com \
  -e GITNESS_PRINCIPAL_ADMIN_PASSWORD=correct-horse-battery-staple \
  -e GITNESS_USER_SIGNUP_ENABLED=false \
  -p 3000:3000 -p 3022:3022 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp/harness:/data \
  --name opensource \
  --restart always \
  harness/harness
```

### GITNESS\_CI\_CONTAINER\_NETWORKS <a href="#gitnesscicontainernetworks" id="gitnesscicontainernetworks"></a>

Optional comma separated list of Docker networks that are attached to every pipeline step.

Harness Open Source creates a temporary Docker network for steps during pipeline execution. Attach additional Docker networks to all steps in your pipelines by setting this variable.

When setting this variable, [GITNESS\_URL\_CONTAINER](#gitness_url_container) must also be set based on the container name.

```
GITNESS_CI_CONTAINER_NETWORKS=networkA,networkB
```

### GITNESS\_CI\_PARALLEL\_WORKERS <a href="#gitnessciparallelworkers" id="gitnessciparallelworkers"></a>

Optional number of parallel workers. Each worker can run a single [pipeline](/open-source/use-harness-open-source/pipelines-1/overview.md).

The default value is `2`.

```
GITNESS_CI_PARALLEL_WORKERS=2
```

### GITNESS\_DATABASE\_DATASOURCE <a href="#gitnessdatabasedatasource" id="gitnessdatabasedatasource"></a>

Set the database connection string.

The default value is the sqlite database file.

```
GITNESS_DATABASE_DATASOURCE=database.sqlite3
```

If you configure Harness Open Source to use your own [Postgres database](/open-source/use-harness-open-source/pipelines-1/samples/postgres.md), you must set the connection string according to your Postgres server configuration. This can be a URI or a series of key-value pairs, for example:

```
GITNESS_DATABASE_DATASOURCE=postgres://root:password@1.2.3.4:5432/postgres?sslmode=disable
GITNESS_DATABASE_DATASOURCE="host=1.2.3.4 port=5678 sslmode=disable dbname=gitness user=$USER password=$PASSWORD"
```

For more information, go to the [Postgres driver documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING).

### GITNESS\_DATABASE\_DRIVER <a href="#gitnessdatabasedriver" id="gitnessdatabasedriver"></a>

Set the database driver name.

The default value is the sqlite3 driver.

```
GITNESS_DATABASE_DRIVER=sqlite3
```

If you configure Harness Open Source to use your own [Postgres database](/open-source/use-harness-open-source/pipelines-1/samples/postgres.md), you must set the database driver to `postgres`.

```
GITNESS_DATABASE_DRIVER=postgres
```

### GITNESS\_DEBUG <a href="#gitnessdebug" id="gitnessdebug"></a>

Set DEBUG log level.

The default value is `false`.

```
GITNESS_DEBUG=false
```

### GITNESS\_ENCRYPTER\_MIXED\_CONTENT <a href="#gitnessencryptermixedcontent" id="gitnessencryptermixedcontent"></a>

If set to `true`, existing secrets stored in plaintext are fully supported, **even if** [**GITNESS\_ENCRYPTER\_SECRET**](#gitness_encrypter_secret) **is provided and new secrets are stored encrypted.**

The default value is `false`.

```
GITNESS_ENCRYPTER_MIXED_CONTENT=false
```

### GITNESS\_ENCRYPTER\_SECRET <a href="#gitnessencryptersecret" id="gitnessencryptersecret"></a>

The secret used to encrypt secrets in the database. **If no value is provided, data is stored in plaintext.**

1. Create an encryption key:

   ```
   $ openssl rand -hex 16
   550df36e9620dd842eb06ca37f9e717e
   ```
2. Provide the encryption key to Harness Open Source:

   ```
   GITNESS_ENCRYPTER_SECRET=550df36e9620dd842eb06ca37f9e717e
   ```

{% hint style="warning" %}
This only impacts newly created secrets, existing secrets are not migrated. If this value is changed, all values encrypted with the previous secret will fail decryption.
{% endhint %}

### GITNESS\_GRACEFUL\_SHUTDOWN\_TIME <a href="#gitnessgracefulshutdowntime" id="gitnessgracefulshutdowntime"></a>

The max time the service is waiting for its components to complete any ongoing operations before shutting down.

The default is 300 seconds.

```
GITNESS_GRACEFUL_SHUTDOWN_TIME=300s
```

### GITNESS\_HTTP\_PORT <a href="#gitnesshttpport" id="gitnesshttpport"></a>

The port on which the system listens for incoming calls.

The default port is `3000`.

```
GITNESS_HTTP_PORT=3000
```

### GITNESS\_PRINCIPAL\_ADMIN\_EMAIL <a href="#gitnessprincipaladminemail" id="gitnessprincipaladminemail"></a>

Enable the **Admin** user with the email specified. When setting this variable, [GITNESS\_PRINCIPAL\_ADMIN\_PASSWORD](#gitness_principal_admin_password) must also be set.

```
GITNESS_PRINCIPAL_ADMIN_EMAIL=mail@example.com
```

### GITNESS\_PRINCIPAL\_ADMIN\_PASSWORD <a href="#gitnessprincipaladminpassword" id="gitnessprincipaladminpassword"></a>

Enable the **Admin** user with the password specified. When setting this variable, [GITNESS\_PRINCIPAL\_ADMIN\_EMAIL](#gitness_principal_admin_email) must also be set.

```
GITNESS_PRINCIPAL_ADMIN_PASSWORD=correct-horse-battery-staple
```

### GITNESS\_TOKEN\_COOKIE\_NAME <a href="#gitnesstokencookiename" id="gitnesstokencookiename"></a>

The name of the cookie that is generated for UI during login/signup which contains the JWT.

The default value is `token`.

```
GITNESS_TOKEN_COOKIE_NAME=token
```

### GITNESS\_TOKEN\_EXPIRE <a href="#gitnesstokenexpire" id="gitnesstokenexpire"></a>

The validity time of session tokens that are generated during user login/signup.

The default is 720 hours.

```
GITNESS_TOKEN_EXPIRE=720h
```

### GITNESS\_TRACE <a href="#gitnesstrace" id="gitnesstrace"></a>

Set TRACE log level.

The default value is `false`.

```
GITNESS_TRACE=false
```

### GITNESS\_URL\_API <a href="#gitnessurlapi" id="gitnessurlapi"></a>

Used to generate user-facing API URLs.

The default value is `http://$GITNESS_URL_BASE/api`

```
GITNESS_URL_API=http://localhost:3000/api
```

### GITNESS\_URL\_BASE <a href="#gitnessurlbase" id="gitnessurlbase"></a>

Used to generate the default value for all URLs. This allows for a custom DNS address without setting multiple variables.

The default value is `http://localhost:$GITNESS_HTTP_PORT`

```
GITNESS_URL_BASE=http://localhost:3000
```

### GITNESS\_URL\_CONTAINER <a href="#gitnessurlcontainer" id="gitnessurlcontainer"></a>

Optional endpoint used by pipeline step containers to communicate with Harness Open Source, such as cloning repositories.

This variable is usually set along with [GITNESS\_CI\_CONTAINER\_NETWORKS](#gitness_ci_container_networks).

The default value is `http://host.docker.internal:$GITNESS_HTTP_PORT`

```
GITNESS_URL_CONTAINER=http://host.docker.internal:3000
```

### GITNESS\_URL\_GIT <a href="#gitnessurlgit" id="gitnessurlgit"></a>

Used to generate user facing git clone URLs for repositories.

The default value is `http://$GITNESS_URL_BASE/git`

```
GITNESS_URL_GIT=http://localhost:3000/git
```

### GITNESS\_URL\_REGISTRY <a href="#gitnessurlregistry" id="gitnessurlregistry"></a>

Set the registry endpoint for your Harness Open Source instance.

The default value is `http://host.docker.internal:3000`.

```
GITNESS_URL_REGISTRY=http://host.docker.internal:3000
```

### GITNESS\_URL\_UI <a href="#gitnessurlui" id="gitnessurlui"></a>

The URL that is used to generate user-facing UI URLs.

The default value is `http://$GITNESS_URL_BASE`

```
GITNESS_URL_UI=http://localhost:3000
```

### GITNESS\_USER\_SIGNUP\_ENABLED <a href="#gitnessusersignupenabled" id="gitnessusersignupenabled"></a>

Enable user signups.

The default value is `true`.

```
GITNESS_USER_SIGNUP_ENABLED=true
```
