Skip to content

Configure Server

Is your server running? See Installation > Getting Started first.

When the server has started without errors, the web client will be available at localhost:8888 or whatever port you've specified.

Create an Admin User

After starting a new AnyStream instance, the first user signup does not require an invitation code and will be granted global permissions.

Danger

It is important to register an admin user immediately after starting AnyStream for the first time. If left incomplete, unauthorized users may be able to modify system files via AnyStream.

Config File

AnyStream supports configuration through a YAML config file in addition to environment variables and CLI arguments. The config file path is set with the CONFIG_PATH environment variable or the -config= CLI argument.

Supported file extensions: .yml or .yaml.

If the specified config file does not exist, AnyStream will create one with default values on startup.

Example YAML config (anystream.yml)

port: 8888
host: 0.0.0.0
base_url: https://stream.example.com
database_url: /path/to/anystream/data/anystream.db

web:
  enable: true
  path: /path/to/web/client

paths:
  data_path: /path/to/anystream/data
  transcode_path: /tmp
  ffmpeg_path: /usr/bin

qbittorrent:
  url: http://localhost:9090
  user: admin
  password: adminadmin

libraries:
  tv:
    directories:
      - /media/TV
  movies:
    directories:
      - /media/Movies
  music:
    directories:
      - /media/Music

oidc:
  enable: false
  provider:
    name: my-provider
    endpoint: https://auth.example.com
    client_id: anystream
    client_secret: your-secret

Values set in the YAML file take precedence over environment variables. Environment variables only act as defaults when the matching field is absent from the config file. The mapping between environment variables and YAML keys is:

Environment variable YAML key
PORT port
HOST host
BASE_URL base_url
DATABASE_URL database_url
WEB_PATH web.path
DATA_PATH paths.data_path
TRANSCODE_PATH paths.transcode_path
FFMPEG_PATH paths.ffmpeg_path

Importing Media

Importing your media files starts by adding a directory to a Library.

Before adding a library directory, ensure your media files follow the guidelines in File and Directory Naming.

  1. Navigate to Settings > Libraries
  2. Click "Edit" on the desired Library
  3. Click "Add Folder"
  4. Select or paste the folder path and click "Add"

That's it! All the media files will be scanned and metadata will be downloaded. You can navigate to the home page to see your library populate in real time.

Pre-configuring Library Directories

Library directories can also be set in the config file or environment, which is useful for Docker deployments where the media paths are known ahead of time. See the libraries section in the config file examples above.

Directories configured this way are added automatically on startup.

Inviting Users

You can add new users manually or create unique URLs to share which allow a single person to create an account with the desired permissions.

To create an invitation URL:

  1. Navigate to Settings > Users, then click "Manage Invites".
  2. Select the permissions required by the new User, then click "Create Invite".
  3. The new invite will be added to the list and a sharable signup link will be copied to your clipboard.

The available permissions are:

Permission Description
View Collection Browse and stream media from the library.
Manage Collection Add, remove, and scan library directories.
Manage Torrents View, add, pause, resume, and delete torrents in qBittorrent.
Configure System Access admin settings, view active sessions and server logs.

An admin user (with Global permissions) has all permissions and can manage other users.

Reverse Proxy

When running AnyStream behind a reverse proxy (e.g. Nginx, Caddy, Traefik), set the BASE_URL environment variable or config option to your public URL so that redirects and OIDC callbacks work correctly.

AnyStream supports X-Forwarded-For, X-Forwarded-Proto, and standard Forwarded headers automatically when BASE_URL is not set.