---
description: Documentation for each available environment variable.
---

# Environment Variables

This is a comprehensive list of environment variables for the **Tube Archivist** container accessible to users. Unless stated otherwise, these environment variables apply to all documented installation instructions.

- <span class="tag-alert">Required</span>: These environment variables are required to be set.
- <span class="tag-optional">Optional</span>: These are optional variables enabling additional configurations.
- Data Types: Expected data type of the environment variable.
    - <span class="tag-neutral">Type: String</span>: Regular string
    - <span class="tag-neutral">Type: Number</span>: Will get converted to a number
    - <span class="tag-neutral">Type: Boolean</span>: Will evaluate to `True` to _enable_ the discribed functionality. Set to anything except blank string to enable. To disable, remove the variable.

## TA_HOST
<span class="tag-alert">Required</span>
<span class="tag-neutral">Type: String</span>

Set the environment variable `TA_HOST` to match with the expected origin from where you will access your **Tube Archivist** instance. That is whatever you input into your browser URL bar.   

- This can be a domain like *example.com*, a subdomain like *ta.example.com* or an IP address like *192.168.1.20*.
- Define the protocol, e.g. `https://` oder `http://`.
- Specify the port If you are using a nonstandard port.
- You can add multiple hostnames separated with a space.
- Any wrong configurations here will result in a `Bad Request (400)` response.
- When in doubt, activate `DJANGO_DEBUG` to get explicit errors in the logs from where the requests are coming from.

## TA_USERNAME
<span class="tag-alert">Required</span>
<span class="tag-neutral">Type: String</span>  
Username for your initial credentials. Changing that after first time starting the application won't have any effect. Use the admin interface to change or add that.

## TA_PASSWORD
<span class="tag-alert">Required</span>
<span class="tag-neutral">Type: String</span>  
Password for your initial user. Changing that after creating the user, does not have any effect. Use the admin interface to change your password.

If you forgot your password, see [User Management/#Forgot Password](../users.md#forgot-password).

## TZ
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: String</span>  
Your timezone. This is used for the scheduler. Defaults to UTC.

!!! info
    If you don't know your timezone, you can find a list [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). Enter the value from the `TZ Identifier` column. 

!!! info
    There is a check at application startup comparing the `TZ` value with your existing schedules. Your schedules will update automatically to reflect the change in timezone.

## HOST_UID and HOST_GID
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Number</span>  
Change the user and group owning the media files generated by TubeArchivist. This uses `chown` on the output files. 

!!! warning "Filesystem Compatibility"
	Not all filesystems support `chown`. Notably `NFS` does not have functionality to change the ownership of files.  

    You will see a error like `PermissionError: [Errno 1] Operation not permitted` when TA is trying to change the ownership of the downloaded file.

    _Not_ setting these variables, will disable the chown functionality.

## TA_PORT
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Number</span>  
This changes the actual port Nginx is listening on. That is the public port exposed through the docker container. If you have a port collision on default port 8000, see bellow.

## TA_BACKEND_PORT
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Number</span>  
This changes the port where the backend service is running on. That is container internal only, but you might need to change that if you use a shared docker network and have a port collision there.

## TA_ENABLE_AUTH_PROXY
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Boolean</span>  
Configure TA to authenticate with a auth proxy. See [configuration/forward-auth](../configuration/forward-auth.md) for more details.

## TA_LDAP
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Boolean</span>  
Configure TA to use LDAP for authentication. See [configuration/ldap](../configuration/ldap.md) for more details.

## TA_AUTO_UPDATE_YTDLP
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: String</span>  
!!! warning "Potential Incompatibility"
    Future versions of yt-dlp may not be compatible with your current Tube Archivist version. Subtle changes in yt-dlp might lead to unexpected, incomplete or wrong data getting indexed. If you use this, make sure to have your backup up to date and monitor that the metadata indexed is as expected.

    If you are experiencing any problems, please report them, so we can address them ahead of a regular relese.

Configure TA to automatically install the latest yt-dlp on container start. Enable by setting to `release` or `nightly` depending on which version you would like to install.

## DISABLE_STATIC_AUTH
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Boolean</span>  
This will disable authentication for static assets like your video mp4 files, subtitles and artwork. This might be required if you need to access the media files over the HTTP server but you are not able to pass authentication headers.

!!! info
    This is `read only` access and does not allow for deleting/modifying any media files. But it is still recommended limit exposure or add additional protections if you enable that.

## DJANGO_DEBUG
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Boolean</span>  
Enable debug to show additional log information like HTTP requests and yt-dlp configurations in your Docker logs. Helpful for development and debugging.

!!! warning "Memory Leak"
    Only set this temporarily if you need to inspect some specific problem. Don't forget to remove it again after. This introduces a memory leak plus standard error messages from the backend will be in HTML showing a detailed stack trace and additional info instead of JSON, meaning the frontend is not able to display any error messages.

## REDIS_CON
<span class="tag-alert">Required</span>
<span class="tag-neutral">Type: String</span>  
Connection string for your Redis instance. Specify protocol, host and port.
E.g.: `redis://archivist-redis:6379`

## ES_URL
<span class="tag-alert">Required</span>
<span class="tag-neutral">Type: String</span>  
URL for your ElasticSearch instance. Add protocol and port.  
E.g. `http://archivist-es:9200`.

## ELASTIC_PASSWORD
<span class="tag-alert">Required</span>
<span class="tag-neutral">Type: String</span>  
This is the password for ElasticSearch. Make sure it matches with the equivalent password set for the ElasticSearch container.

## ELASTIC_USER
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: String</span>  
Optionally change the ElasticSearch username from the default `elastic`.

## ES_DISABLE_VERIFY_SSL
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: Boolean</span>  
Optionally disable SSL verification for ElasticSearch. Useful if you use a self signed certificate for ElasticSearch.

## ES_SNAPSHOT_DIR
<span class="tag-optional">Optional</span>
<span class="tag-neutral">Type: String</span>  
Optionally set a custom path where elastic search stores snapshots for master/data nodes. Note, that path applies to inside the ES container.
