Deployarr Environment Variable

8 min read Oct 06, 2024
Deployarr Environment Variable

Deployarr is a powerful tool that automates your media library management. It's a great way to streamline your media server setup, but it also relies heavily on environment variables to function correctly.

Understanding Environment Variables

Think of environment variables as little notes you attach to your Deployarr application. They store information like your login credentials, download directories, and preferences. Deployarr reads these notes and uses them to configure itself.

Why are environment variables crucial?

  • Security: Environment variables prevent sensitive information like API keys and passwords from being hardcoded directly into your Deployarr configuration files. This is crucial for keeping your server safe.
  • Flexibility: Environment variables make it easy to adapt your Deployarr setup to different environments (like development, testing, and production) without modifying the core Deployarr code.
  • Simplicity: Environment variables help keep your Deployarr configuration tidy and organized.

Essential Deployarr Environment Variables

Let's dive into some key environment variables you'll want to define for your Deployarr installation:

1. DEPLOYARR_API_KEY

  • What it does: This variable stores the API key required for Deployarr to interact with your chosen provider (like Sonarr, Radarr, or Lidarr).
  • Importance: Without a valid API key, Deployarr won't be able to communicate with your media management applications.
  • How to set it: You'll typically obtain this key from your Sonarr, Radarr, or Lidarr settings.

2. DEPLOYARR_DATABASE_URL

  • What it does: This variable defines the connection string for Deployarr's database.
  • Importance: Deployarr relies on a database to store its configuration and track downloads.
  • How to set it: The exact format of this string depends on your database type (PostgreSQL, MySQL, SQLite, etc.).

3. DEPLOYARR_DOWNLOAD_PATH

  • What it does: This variable specifies the directory where Deployarr will download your media files.
  • Importance: This is where your downloaded movies, TV shows, and music will be stored.
  • How to set it: Choose a directory on your server with enough storage space and appropriate permissions.

4. DEPLOYARR_LOG_LEVEL

  • What it does: This variable controls the level of logging information generated by Deployarr.
  • Importance: Setting an appropriate log level helps you troubleshoot issues more effectively.
  • How to set it: Common values include 'debug', 'info', 'warning', and 'error'.

5. DEPLOYARR_NOTIFICATION_ENABLED

  • What it does: This variable enables or disables notifications from Deployarr.
  • Importance: You can receive notifications when downloads complete, fail, or encounter errors.
  • How to set it: Set to 'true' for notifications or 'false' to disable them.

6. DEPLOYARR_NOTIFICATION_METHOD

  • What it does: This variable specifies the notification method for Deployarr (e.g., email, webhook, etc.).
  • Importance: Determines how Deployarr will send you alerts.
  • How to set it: The specific options available will depend on your notification provider.

Setting Environment Variables

There are several ways to define your environment variables for Deployarr:

  • Directly in your Deployarr configuration file: While not recommended for security reasons, you can define variables within your configuration file for development purposes.
  • Environment variables in your shell: Set variables in your shell environment using the export command.
  • System-wide environment variables: Configure variables globally for your entire system.
  • Container environment variables (Docker): If you're running Deployarr in a Docker container, you can define variables within your Dockerfile or when launching the container.

Managing Your Environment Variables

Once you've set your environment variables, you can use various tools to manage and view them:

  • env command: List the current environment variables in your shell.
  • Environment variable editors: Some operating systems offer graphical tools for managing environment variables.
  • Configuration management tools: For more complex deployments, tools like Ansible or Puppet can streamline your environment variable management.

Example: Setting Environment Variables

Let's take a look at a simple example of setting environment variables in your shell:

export DEPLOYARR_API_KEY="YOUR_API_KEY"
export DEPLOYARR_DOWNLOAD_PATH="/path/to/downloads"

This sets the DEPLOYARR_API_KEY and DEPLOYARR_DOWNLOAD_PATH variables, which Deployarr will then use to configure its operations.

Troubleshooting

If you're encountering problems with Deployarr related to environment variables, consider the following:

  • Check for typos: Double-check the spelling of your environment variable names, as even minor mistakes can cause issues.
  • Verify variable values: Ensure that the values you've set are correct, especially for API keys and database connection strings.
  • Check for conflicts: If multiple tools are trying to define the same environment variable, you might have conflicting values.
  • Review your configuration: Check that Deployarr is correctly reading your environment variables.

Conclusion

Environment variables are essential for managing Deployarr effectively and securely. By properly defining and setting these variables, you can ensure that your media library is organized, automated, and runs smoothly. Remember to choose the most appropriate method for managing your environment variables based on your system and deployment needs.