Skip to main content
This guide covers all configuration options for Lionz IPTV Downloader, including environment variables, service setup, and application initialization.

Environment Configuration

All configuration is managed through the .env file in your project root. Start by copying the example file:
cp .env.example .env

Application Settings

APP_NAME
string
default:"Laravel"
The name of your application, displayed in the UI and emails.
APP_NAME="Lionz IPTV Downloader"
APP_ENV
string
default:"local"
Application environment. Use local for development, production for live deployments.
APP_ENV=local
APP_KEY
string
required
Application encryption key. Generated automatically by php artisan key:generate.
APP_KEY=base64:your-generated-key-here
APP_DEBUG
boolean
default:"true"
Enable debug mode for detailed error messages. Set to false in production.
APP_DEBUG=true
APP_URL
string
default:"http://localhost"
The base URL of your application.
APP_URL=http://localhost:8000
SYNC_MEDIA_MEMORY_LIMIT
string
default:"512M"
Memory limit for media synchronization jobs. Increase if syncing large catalogs.
SYNC_MEDIA_MEMORY_LIMIT=512M

Lionz TV / Xtream Codes API

These credentials are required for the application to function. Obtain them from your Lionz TV subscription.
Configure your Xtream Codes API credentials to connect to Lionz TV:
# Lionz IPTV Service Credentials
XTREAM_CODES_API_HOST=your-host.lionz.tv
XTREAM_CODES_API_PORT=80
XTREAM_CODES_API_USER=your-username
XTREAM_CODES_API_PASS=your-password
XTREAM_CODES_API_HOST
string
required
Your Lionz TV API host URL (without http:// or https://).
XTREAM_CODES_API_PORT
integer
default:"80"
API port number. Typically 80 for HTTP or 443 for HTTPS.
XTREAM_CODES_API_USER
string
required
Your Lionz TV username.
XTREAM_CODES_API_PASS
string
required
Your Lionz TV password.
HTTP_CLIENT_USER_AGENT
string
Custom user agent for API requests. Defaults to Firefox user agent.
HTTP_CLIENT_USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"

MeiliSearch Configuration

MeiliSearch must be running before starting the application or syncing content.
Configure MeiliSearch for fast content search and indexing:
# MeiliSearch Configuration
SCOUT_DRIVER=meilisearch
SCOUT_QUEUE=true
MEILISEARCH_HOST=http://localhost:7700
MEILISEARCH_KEY=your-master-key
SCOUT_DRIVER
string
default:"meilisearch"
Laravel Scout driver. Must be meilisearch.
SCOUT_QUEUE
boolean
default:"true"
Whether to queue search indexing operations. Recommended to keep true for better performance.
MEILISEARCH_HOST
string
required
MeiliSearch server URL with port.
MEILISEARCH_HOST=http://localhost:7700
MEILISEARCH_KEY
string
required
MeiliSearch master key for authentication. Must match the key used when starting MeiliSearch.

aria2 Download Manager

For desktop use, we recommend Motrix which provides a GUI for aria2 with RPC enabled.
Configure aria2 for handling downloads:
# Aria2 Configuration
ARIA2_RPC_HOST=http://localhost
ARIA2_RPC_PORT=6800
ARIA2_RPC_SECRET=your-secret-token
ARIA2_DOWNLOAD_ROOT=/path/to/downloads
ARIA2_RPC_HOST
string
default:"http://localhost"
aria2 RPC server hostname with protocol.
ARIA2_RPC_PORT
integer
default:"6800"
aria2 RPC server port.
ARIA2_RPC_SECRET
string
Secret token for aria2 RPC authentication. Must match the --rpc-secret used when starting aria2.
ARIA2_DOWNLOAD_ROOT
string
Root directory for downloads. Defaults to storage/app/public/downloads.
ARIA2_DOWNLOAD_ROOT=/home/user/Downloads/Lionz

Database Configuration

SQLite is the default and recommended database for ease of setup. You can switch to MySQL or PostgreSQL if needed.
DB_CONNECTION=sqlite
# No additional configuration needed
# Database file: database/database.sqlite

Queue Configuration

QUEUE_CONNECTION
string
default:"database"
Queue driver for background jobs. Default database works well for most use cases.
QUEUE_CONNECTION=database
Background jobs are used for media synchronization, search indexing, and download monitoring. The queue worker is automatically started with composer dev.

Optional Features

TELESCOPE_ENABLED
boolean
default:"true"
Enable Laravel Telescope debug assistant. Set to false in production.
TELESCOPE_ENABLED=true
Enable direct download links feature for content.
FEATURE_DIRECT_DOWNLOAD_LINKS=true

Service Initialization

After configuring your .env file, initialize the application configuration:
1

Initialize Configurations

Store aria2 and Xtream Codes configurations from .env into the database:
php artisan lionz:configure
This command reads from your environment variables and creates database records:
/**
 * Initialize application configurations in the database
 */
public function handle(
    Aria2Config $aria2Config,
    XtreamCodesConfig $xtreamCodesConfig
): int {
    $this->initializeAria2($aria2Config);
    $this->initializeXtreamCodes($xtreamCodesConfig);
    $this->info('All configurations initialized successfully!');

    return Command::SUCCESS;
}
This only needs to be run once after initial setup or when updating service credentials.
2

Sync Media Content

Perform the initial content synchronization:
php artisan lionz:sync-media
This command:
  • Fetches all categories from Lionz TV via Xtream Codes API
  • Syncs VOD and Series content to the local database
  • Indexes all content in MeiliSearch for fast searching
/**
 * Sync media content from Xtream Codes API
 */
public function handle(SyncMediaAction $syncMedia): int
{
    $this->info('Starting media synchronization...');

    try {
        $this->info('Running SyncMedia action...');
        $syncMedia->run();
        $this->info('Media synchronization completed successfully!');

        return Command::SUCCESS;
    } catch (Exception $exception) {
        $this->error('Media synchronization failed: '.$exception->getMessage());
        Log::error($exception->getMessage(), ['exception' => $exception]);

        return Command::FAILURE;
    }
}
The first sync may take several minutes depending on catalog size. Ensure MeiliSearch is running before executing.
3

Verify Configuration

Test your configuration by accessing the application:
composer dev
Then open http://localhost:8000 in your browser. You should see:
  • Recently added movies and series
  • Working search functionality
  • Ability to browse content

Running the Application

Development Mode

Start all development services:
composer dev
This concurrently runs:
  • Laravel server on http://localhost:8000
  • Queue worker for background jobs
  • Log watcher (Pail) for real-time logs
  • Vite dev server for hot module reloading
"scripts": {
    "dev": [
        "Composer\\Config::disableProcessTimeout",
        "bunx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1 --timeout=0\" \"php artisan pail --timeout=0\" \"bun run dev\" --names=server,queue,logs,vite"
    ]
}

Development with SSR

For server-side rendering support:
composer dev:ssr

Production Mode

1

Build Frontend Assets

pnpm run build
2

Optimize Laravel

php artisan config:cache
php artisan route:cache
php artisan view:cache
composer install --optimize-autoloader --no-dev
3

Start Queue Worker

php artisan queue:work --daemon
4

Serve with Octane (Optional)

php artisan octane:start --server=swoole --host=0.0.0.0 --port=8000

Scheduled Tasks

For automated content syncing, add to your crontab:
crontab
# Sync media content every 6 hours
0 */6 * * * cd /path/to/lionzhd && php artisan lionz:sync-media >> /dev/null 2>&1

# Monitor series for new episodes every hour
0 * * * * cd /path/to/lionzhd && php artisan schedule:run >> /dev/null 2>&1

Configuration Summary

Essential Configuration Checklist
  • .env file created from .env.example
  • APP_KEY generated
  • Xtream Codes API credentials configured
  • MeiliSearch installed and running
  • aria2 installed and RPC enabled
  • Database created and migrated
  • php artisan lionz:configure executed
  • php artisan lionz:sync-media completed
  • Application accessible at http://localhost:8000

Next Steps

Usage Guide

Learn how to search, download, and manage your IPTV content

API Reference

Explore the Xtream Codes API integration

Troubleshooting

Common configuration issues and solutions

Advanced Features

Series monitoring, bulk downloads, and automation

Build docs developers (and LLMs) love