Installation & Setup
You can install Mux via the plugin store, or through Composer.
Craft Plugin Store
To install Mux, navigate to the Plugin Store section of your Craft control panel, search for Mux, and click the Try button.
Composer
You can also add the package to your project using Composer and the command line.
- Open your terminal and go to your Craft project:
cd /path/to/project- Then tell Composer to require the plugin, and Craft to install it:
composer require rocketpark/craft-mux && php craft plugin/install craft-muxMux Account Setup and Webhook Configuration
This guide will walk you through setting up a Mux account and configuring webhooks for the Mux Craft CMS plugin.
1. Creating a Mux Account
Step 1: Sign Up for Mux
Visit Mux's website and click "Get Started" Create your account using your email address Verify your email address when prompted
Step 2: Access Your Dashboard
Log into your Mux dashboard You'll be taken to the main dashboard where you can see your video assets and analytics
2. Generating API Access Tokens
The Mux plugin requires API credentials to communicate with Mux's services.
Step 1: Navigate to Access Tokens
In your Mux dashboard, go to Settings → Access Tokens Click "Generate new token"
Step 2: Configure Token Permissions
- Token Name: Give your token a descriptive name (e.g., "Craft CMS Production")
- Environment: Select your environment (Production or Development)
- Permissions:
- Mux Video: Select "Full Access" (required for video management)
- Mux Data: Select "Read" (required for analytics)
Step 3: Save Your Credentials
Click "Generate Token" Important: Copy both the Token ID and Secret immediately The Secret will only be displayed once and cannot be retrieved later Store these credentials securely
3. Configuring the Mux Plugin
Step 1: Access Plugin Settings
In your Craft CMS admin panel, go to Settings → Plugins Find the Mux plugin and click "Settings"
Step 2: Enter API Credentials
- MUX Token Id: Paste your Token ID from Mux
- MUX Token Secret: Paste your Secret from Mux
- Max Resolution Tier: Choose the maximum resolution for your videos (default: 1080p)
- Static Renditions: Choose whether to enable static renditions for offline viewing
- MP4 Support: Choose whether to enable static MP4 renditions (deprecated, use Static Renditions instead)
Step 3: Configure Additional Settings
- Secure Playback: Enable if you want to use JWT tokens for secure video access
- Watermark Settings: Configure overlay/watermark options if needed
4. Setting Up Webhooks
Webhooks allow Mux to notify your Craft CMS site when video processing events occur, ensuring your content stays synchronized.
Step 1: Get Your Webhook URL
In your Mux plugin settings, you'll see a Webhook section Copy the webhook URL displayed (format: https://yoursite.com/actions/mux/webhooks/mux-webhooks)
Step 2: Configure Webhook in Mux Dashboard
In your Mux dashboard, go to Settings → Webhooks Click "Create new webhook" Webhook URL: Paste the URL from your Craft CMS plugin settings Events: The plugin automatically handles these webhook events:
video.asset.ready- Video processing completedvideo.asset.updated- Video metadata updatedvideo.asset.deleted- Video deletedvideo.asset.track.errored- Track processing errorvideo.upload.asset_created- New video uploadedvideo.asset.static_renditions.preparing- Static renditions being preparedvideo.asset.static_renditions.ready- Static renditions readyvideo.asset.static_renditions.deleted- Static renditions deleted
Step 3: Save and Test
Click "Create Webhook"
Environment Variables (Recommended)
For security, store your API credentials as environment variables:
# Basic Configuration
MUX_PLUGIN_NAME="MUX"
MUX_TOKEN_ID="your_token_id_here"
MUX_TOKEN_SECRET="your_token_secret_here"
# Video Processing
MUX_MAX_RESOLUTION_TIER="1080p"
MUX_MP4_SUPPORT="none"
MUX_STATIC_RENDITIONS="none"
# Security
MUX_SECURE_PLAYBACK=false
# Watermark Settings
MUX_WATERMARK_URL=""
MUX_VERTICAL_ALIGN="top"
MUX_VERTICAL_MARGIN="0"
MUX_HORIZONTAL_ALIGN="left"
MUX_HORIZONTAL_MARGIN="0"
MUX_WIDTH=""
MUX_HEIGHT=""
MUX_OPACITY="100"
# Upload Settings (In bytes)
MUX_MAX_UPLOAD_FILESIZE="734003200" #700MB
# Must be multiples of 256kb
MUX_UPLOAD_CHUNK_SIZE="8388608" #8MB (Mux recommended)Licensing
You can try Mux in a development environment for as long as you like. Once your site goes live, you are required to purchase a license for the plugin.
For more information, see Craft's Commercial Plugin Licensing.