> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cinepro.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

> Configure CinePro Core through a .env file with environment variables for the TMDB API key, ports, public URL, caching, and provider settings.

<Info>
  Copy `.env.example` to `.env` before starting the server. CinePro Core requires a valid `TMDB_API_KEY` to resolve metadata and start correctly.
</Info>

## Required vs optional

<Columns cols={2}>
  <Card title="Required" icon="circle-alert" color="#f5413f">
    * `TMDB_API_KEY` — required for metadata lookups and startup
  </Card>

  <Card title="Optional" icon="circle-check" color="#22c55e">
    * `PORT`, `HOST`, `PUBLIC_URL`, `NODE_ENV` — server runtime settings
    * `CACHE_TYPE`, `REDIS_*` — only needed for Redis-backed caching
    * `STREMIO_ADDON`, `MCP_ENABLED`, `CORS_ORIGIN`, `TMDB_CACHE_TTL` — optional integrations and tuning
  </Card>
</Columns>

## Server configuration

<ParamField path="PORT" type="number" default="3000">
  The port CinePro Core listens on.

  ```bash .env theme={"theme":"material-theme-darker"}
  PORT=3000
  ```

  ```bash .env theme={"theme":"material-theme-darker"}
  PORT=8080
  ```
</ParamField>

<ParamField path="HOST" type="string" default="localhost">
  The hostname or IP address the server binds to.

  Use `localhost` during development to keep the API limited to your machine.\
  Use `0.0.0.0` in Docker or production if the API should be reachable from other devices.

  ```bash .env theme={"theme":"material-theme-darker"}
  HOST=localhost
  ```

  ```bash .env theme={"theme":"material-theme-darker"}
  HOST=0.0.0.0
  ```
</ParamField>

<ParamField path="PUBLIC_URL" type="string">
  The public base URL of your CinePro Core instance. Use this when your server is exposed through a public hostname, reverse proxy, or domain.

  ```bash .env theme={"theme":"material-theme-darker"}
  PUBLIC_URL=https://api.example.com
  ```

  <Warning>
    Include the protocol and do not add a trailing slash. A wrong `PUBLIC_URL` can produce broken absolute URLs in responses.
  </Warning>
</ParamField>

<ParamField path="NODE_ENV" type="string" default="development">
  Controls the runtime mode.

  | Value         | Usage                                                    |
  | ------------- | -------------------------------------------------------- |
  | `development` | Local development, debugging, and `npm run dev`          |
  | `production`  | Optimized runtime for `npm start` and deployed instances |

  ```bash .env theme={"theme":"material-theme-darker"}
  NODE_ENV=development
  ```

  ```bash .env theme={"theme":"material-theme-darker"}
  NODE_ENV=production
  ```
</ParamField>

<ParamField path="CORS_ORIGIN" type="string">
  Optional. Restricts which browser origins may call the CinePro API.

  Leave unset to keep the default behavior, or set it to a specific origin if you expose the API publicly.

  ```bash .env theme={"theme":"material-theme-darker"}
  CORS_ORIGIN=https://example.com
  ```
</ParamField>

## Optional integrations

<ParamField path="STREMIO_ADDON" type="boolean" default="false">
  Enables CinePro's Stremio addon support.

  When enabled, CinePro exposes a Stremio manifest endpoint at `/stremio/manifest.json` so your instance can be added as a Stremio source.

  ```bash .env theme={"theme":"material-theme-darker"}
  STREMIO_ADDON=true
  ```

  ### Adding custom Stremio addons as sources

  CinePro Core can also pull streams *from* existing Stremio addons and surface them as additional sources. This list is configured in `src/server.ts` rather than via an environment variable.

  As of the May 7, 2026 release, the default `stremioAddons` array is **empty** — you must explicitly add the addons you want to use:

  ```typescript src/server.ts theme={"theme":"material-theme-darker"}
  stremio: {
      enableNativeAddon: process.env.STREMIO_ADDON === 'true',
      stremioAddons: [
          {
              id: 'some-unique-id',
              url: 'https://example.com/manifest.json',
              enabled: true
          }
      ]
  }
  ```

  | Field     | Type      | Description                                    |
  | --------- | --------- | ---------------------------------------------- |
  | `id`      | `string`  | Unique identifier for the addon within CinePro |
  | `url`     | `string`  | Full URL to the addon's `manifest.json`        |
  | `enabled` | `boolean` | Toggle the addon without removing the entry    |

  <Note>
    Earlier versions of CinePro Core shipped two community addons (WebStreamerMBG and Streamify) pre-wired in this list. They have been removed so you can curate your own list from a clean slate.
  </Note>
</ParamField>

<ParamField path="INTERNAL_DEBUG" type="boolean" default="false">
  Returns **every** source the providers find — including non-playable ones — and attaches detailed per-provider diagnostics to the response. Use this when developing or debugging providers; leave it off in normal use.

  ```bash .env theme={"theme":"material-theme-darker"}
  INTERNAL_DEBUG=true
  ```

  <Warning>
    Keep `INTERNAL_DEBUG=false` for regular usage. With it enabled, the API surfaces broken or unplayable sources alongside working ones, which clients are not expected to filter.
  </Warning>
</ParamField>

<ParamField path="MCP_ENABLED" type="boolean" default="false">
  Enables Model Context Protocol support for MCP-compatible clients and AI agents.

  ```bash .env theme={"theme":"material-theme-darker"}
  MCP_ENABLED=true
  ```

  <Note>
    Enable this only if you actually plan to connect CinePro to MCP clients. Regular API users do not need it.
  </Note>
</ParamField>

## TMDB configuration

<ParamField path="TMDB_API_KEY" type="string" required>
  Your TMDB (The Movie Database) API key. CinePro Core uses TMDB for metadata such as titles, IDs, and artwork.

  <Steps>
    <Step title="Create a TMDB account">
      Sign up at [themoviedb.org](https://www.themoviedb.org/).
    </Step>

    <Step title="Request an API key">
      Open **Settings → API** in TMDB and request a developer key.
    </Step>

    <Step title="Add the key to your .env">
      ```bash .env theme={"theme":"material-theme-darker"}
      TMDB_API_KEY=your_tmdb_api_key_here
      ```
    </Step>
  </Steps>

  <Tip>
    Keep this key private and never commit your `.env` file to version control.
  </Tip>
</ParamField>

<ParamField path="TMDB_CACHE_TTL" type="number" default="86400">
  Defines how long TMDB metadata responses are cached, in seconds.

  The default `86400` equals 24 hours.

  ```bash .env theme={"theme":"material-theme-darker"}
  TMDB_CACHE_TTL=86400
  ```
</ParamField>

## Cache configuration

<ParamField path="CACHE_TYPE" type="string" default="memory">
  Selects the cache backend used by CinePro Core.

  | Value    | Best for                                                |
  | -------- | ------------------------------------------------------- |
  | `memory` | Local development and simple single-instance setups     |
  | `redis`  | Production deployments and shared or persistent caching |

  ```bash .env theme={"theme":"material-theme-darker"}
  CACHE_TYPE=memory
  ```

  ```bash .env theme={"theme":"material-theme-darker"}
  CACHE_TYPE=redis
  ```

  <Note>
    If you use `redis`, configure the Redis connection variables below as well.
  </Note>
</ParamField>

## Redis configuration

These variables are only needed when `CACHE_TYPE=redis`.

<ParamField path="REDIS_HOST" type="string" default="localhost">
  Hostname or IP address of your Redis server.

  ```bash .env theme={"theme":"material-theme-darker"}
  REDIS_HOST=localhost
  ```

  ```bash .env theme={"theme":"material-theme-darker"}
  REDIS_HOST=redis.example.com
  ```
</ParamField>

<ParamField path="REDIS_PORT" type="number" default="6379">
  Port of your Redis instance.

  ```bash .env theme={"theme":"material-theme-darker"}
  REDIS_PORT=6379
  ```
</ParamField>

<ParamField path="REDIS_PASSWORD" type="string">
  Optional password for Redis authentication.

  ```bash .env theme={"theme":"material-theme-darker"}
  REDIS_PASSWORD=
  ```

  ```bash .env theme={"theme":"material-theme-darker"}
  REDIS_PASSWORD=supersecretpassword
  ```

  <Warning>
    Never commit Redis credentials to source control. Use environment injection or a secrets manager in production.
  </Warning>
</ParamField>

## Full .env examples

### Development

```bash .env theme={"theme":"material-theme-darker"}
PORT=3000
HOST=localhost
NODE_ENV=development

TMDB_API_KEY=your_tmdb_api_key_here
TMDB_CACHE_TTL=86400

CACHE_TYPE=memory
```

### Production

```bash .env theme={"theme":"material-theme-darker"}
PORT=8080
HOST=0.0.0.0
NODE_ENV=production
PUBLIC_URL=https://api.example.com

TMDB_API_KEY=your_tmdb_api_key_here
TMDB_CACHE_TTL=86400

CACHE_TYPE=redis
REDIS_HOST=redis.example.com
REDIS_PORT=6379
REDIS_PASSWORD=supersecretpassword

STREMIO_ADDON=false
MCP_ENABLED=false
```

### Docker Compose

```bash .env theme={"theme":"material-theme-darker"}
PORT=3000
HOST=0.0.0.0
NODE_ENV=production
PUBLIC_URL=http://localhost:3000

TMDB_API_KEY=your_tmdb_api_key_here
TMDB_CACHE_TTL=86400

CACHE_TYPE=redis
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=
```

<Tip>
  In Docker Compose, `REDIS_HOST` should usually be the Redis service name from `compose.yml`, not `localhost`.
</Tip>


## Related topics

- [Quickstart](/quickstart.md)
- [API Reference](/core/api-reference/introduction.md)
- [Changelog](/core/versions.md)
- [Providers](/core/configuration/providers.md)
- [CineHome](/cinehome/coming-soon.md)
