Skip to content

Repository files navigation

Plugin Development Documentation for Unraid®

The community-maintained guide to building plugins for Unraid® OS

Unraid® is a registered trademark of Lime Technology, Inc. This project is not affiliated with, endorsed by, or sponsored by Lime Technology, Inc.

License: MITWorks with Unraid®Contributions WelcomeTotal Views



📖 About This Documentation

This is the unofficial, community-driven documentation for developing plugins for Unraid® OS. The Unraid® plugin system is powerful but has historically lacked comprehensive documentation. This project aims to fill that gap by providing clear, well-organized, and up-to-date resources for plugin developers.

⚠️Disclaimer: This is not official Lime Technology documentation. Unraid® is a registered trademark of Lime Technology, Inc. This project is not affiliated with, endorsed by, or sponsored by Lime Technology, Inc. While every effort is made to ensure accuracy, please verify critical information against official sources and existing plugins.


🚀 Quick Start

New to Unraid® plugin development? Start here:

  1. Introduction to Plugins - What are plugins and how do they work?
  2. Plugin File Structure - Anatomy of a .plg file
  3. Your First Plugin - Step-by-step tutorial
  4. Web UI Pages - Creating .page files for the web GUI

📚 Documentation Index

Getting Started

TopicDescription
IntroductionOverview of the Unraid® plugin system
Your First PluginStep-by-step tutorial
Example PluginsReal-world plugin references

Core Concepts

TopicDescription
PLG File Reference.plg installer format & metadata
Page FilesCreating web UI pages (.page files)
File System LayoutWhere plugin files live
Event SystemResponding to array and system events
Plugin CommandUsing the plugin CLI tool

UI Development

TopicDescription
UI DevelopmentOverview of UI-related docs
JavaScript PatternsCommon jQuery patterns & AJAX
Form ControlsStandard input elements and styling
Tab PagesMulti-tab settings pages
Icons & StylingFontAwesome, themes, and CSS

Advanced Topics

TopicDescription
Advanced TopicsAdvanced plugin development guidance
Docker IntegrationDocker API & container management
Update MechanismsVersion checks and auto-updates
Debugging TechniquesLogging, error handling, dev tools
TestingTesting strategies and tools

Distribution

TopicDescription
Distribution & PublishingHow to ship and support your plugin
Community ApplicationsPublishing to CA
HostingHosting plugin files
SupportSupporting users

Reference

TopicDescription
Plugin CommandUsing the plugin CLI tool
Example PluginsLinks to well-documented plugins

🗂️ Plugin System Overview

At a high level, an Unraid® plugin consists of:

┌─────────────────────────────────────────────────────────────────┐
│ myplugin.plg │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ XML-based installer that: │ │
│ │ • Downloads and extracts packages │ │
│ │ • Runs install/remove scripts │ │
│ │ • Defines plugin metadata (name, version, author) │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ myplugin-package.txz │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Slackware package containing: │ │
│ │ /usr/local/emhttp/plugins/myplugin/ │ │
│ │ ├── myplugin.page (Web UI) │ │
│ │ ├── myplugin.settings.page │ │
│ │ ├── default.cfg │ │
│ │ ├── php/ │ │
│ │ ├── scripts/ │ │
│ │ ├── javascript/ │ │
│ │ └── event/ │ │
│ │ ├── started │ │
│ │ └── stopping_docker │ │
│ └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘

🔗 Key Directories

PathPurposePersistence
/boot/config/plugins/Plugin files stored on USB flash✅ Survives reboot
/boot/config/plugins/myplugin/Plugin config and cached files✅ Survives reboot
/usr/local/emhttp/plugins/myplugin/Active plugin files (web UI)❌ RAM disk
/var/log/plugins/Symlinks indicating installed plugins❌ RAM disk
/tmp/plugins/Downloaded plugin files for updates❌ Temporary

🎯 emhttp Events

Plugins can respond to system events by placing executable scripts in their event/ directory:

EventTriggered When
driver_loadedEarly in emhttp initialization
startingArray start begins
array_startedArray devices are valid
disks_mountedDisks and shares are mounted
docker_startedDocker service starts
libvirt_startedVM service starts
startedArray start completes
stoppingArray stop begins
stopping_dockerAbout to stop Docker
stopping_libvirtAbout to stop VMs
unmounting_disksAbout to unmount disks
stoppedArray has stopped
poll_attributesSMART data polled

See Event System for full details.


🛠️ Development Tips

Quick Testing Workflow

  1. Edit files directly in /usr/local/emhttp/plugins/myplugin/ on your server
  2. Refresh the browser to see changes (PHP/HTML changes are instant)
  3. A reboot will restore original files from the package, so copy changes back to your source!

Useful CLI Commands

# Install a plugin
plugin install /path/to/myplugin.plg
# Check for plugin updates
plugin check myplugin.plg
# Update a plugin
plugin update myplugin.plg
# Remove a plugin
plugin remove myplugin.plg
# Get plugin version
plugin version /var/log/plugins/myplugin.plg

🤝 Contributing

GitHub

This documentation is a community effort! Contributions are welcome:

See CONTRIBUTING.md for guidelines.


📜 Resources & Links

Official Resources

Community Developer Resources

Historical References


📄 License

This documentation and the code examples are licensed under the MIT License.


Made with ❤️ by the Unraid® community
unraid.net

About

Community-maintained documentation for Unraid plugin development

Topics

Resources

Contributing

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages