### Install and Run Unraid Docs Locally Source: https://context7.com/unraid/docs/llms.txt Clone the repository, install dependencies using pnpm, and start the development server to preview documentation changes. Supports starting with specific locales. ```bash git clone https://github.com/unraid/docs.git cd docs corepack enable pnpm install pnpm start pnpm start -- --locale zh pnpm start -- --locale es pnpm lint pnpm build pnpm serve ``` -------------------------------- ### Enable and Start QEMU Guest Agent Service Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/troubleshooting/common-issues/unclean-shutdowns.mdx Enable the QEMU Guest Agent service to start on boot and start it immediately. This is required for VM hibernation on Linux. ```bash sudo systemctl enable qemu-guest-agent sudo systemctl start qemu-guest-agent ``` -------------------------------- ### Install project dependencies Source: https://github.com/unraid/docs/blob/main/README.md Enable Corepack and install the required packages using pnpm. ```bash corepack enable pnpm install ``` -------------------------------- ### Start Development Server with Locale Source: https://context7.com/unraid/docs/llms.txt Starts the development server with a specific locale. Use this to test translations. ```bash pnpm start -- --locale zh ``` ```bash pnpm start -- --locale fr ``` ```bash pnpm start -- --locale es ``` ```bash pnpm start -- --locale de ``` -------------------------------- ### Install Node.js with nvm Source: https://github.com/unraid/docs/blob/main/README.md Use nvm to install and switch to the required Long Term Support version of Node.js. ```bash nvm install --lts nvm use ``` -------------------------------- ### Create API Key with Description Source: https://github.com/unraid/docs/blob/main/docs/API/programmatic-api-key-management.mdx Example of creating an API key and providing a descriptive text for its purpose. ```bash --description "CI/CD key" ``` -------------------------------- ### Start Docker Container Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/using-unraid-to/run-docker-containers/managing-and-customizing-containers.mdx Use this command to start a specific Docker container. Replace 'container_name' with the actual name of your container. ```bash docker start container_name ``` -------------------------------- ### Install QEMU Guest Agent on Ubuntu/Debian Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/troubleshooting/common-issues/unclean-shutdowns.mdx Install the QEMU Guest Agent on Ubuntu or Debian-based Linux VMs. This is a prerequisite for enabling VM hibernation. ```bash sudo apt install qemu-guest-agent ``` -------------------------------- ### Create API Key with Name and Roles Source: https://github.com/unraid/docs/blob/main/docs/API/programmatic-api-key-management.mdx Example of creating an API key with a specific name and assigned roles. ```bash --name "my key" --roles ADMIN,VIEWER ``` -------------------------------- ### Prepare Windows for migration using Sysprep Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/using-unraid-to/create-virtual-machines/vm-conversion-and-migration.mdx Commands to navigate to the Sysprep directory and generalize the Windows installation for hardware migration. ```bash cd C:\Windows\System32\Sysprep ``` ```bash sysprep.exe /generalize /shutdown /oobe ``` -------------------------------- ### Install QEMU Guest Agent on CentOS/RHEL/Fedora Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/troubleshooting/common-issues/unclean-shutdowns.mdx Install the QEMU Guest Agent on CentOS, RHEL, or Fedora-based Linux VMs. This is a prerequisite for enabling VM hibernation. ```bash sudo yum install qemu-guest-agent ``` ```bash sudo dnf install qemu-guest-agent ``` -------------------------------- ### Manually boot from UEFI shell Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/using-unraid-to/create-virtual-machines/vm-setup.mdx Use these commands at the UEFI shell prompt to manually trigger the boot process if the VM fails to start automatically. ```bash fs0: cd efi/boot bootx64.efi ``` -------------------------------- ### Start SMART Self-Test Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx Initiate SMART self-tests on a drive. Use 'short' for a quick test or 'long' for an extended test that may take several hours. ```bash smartctl -t short /dev/sdX ``` ```bash smartctl -t long /dev/sdX ``` -------------------------------- ### Configure Bonding Module Parameters Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/release-notes/6.9.0.md Specify module options by creating a configuration file in the modprobe.d directory. This example sets the primary interface for a bonding driver. ```bash options bonding primary=eth1 ``` -------------------------------- ### Start a Docker Container Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/using-unraid-to/run-docker-containers/partials/managing-and-customizing-containers/command-start.mdx Use this command to start a stopped Docker container. Replace 'container-name' with the actual name of your container. ```bash docker start "container-name" ``` -------------------------------- ### Start Docusaurus Dev Server Source: https://github.com/unraid/docs/blob/main/README.md Run this command to spin up a local Docusaurus development server. The server defaults to http://localhost:3001. ```bash pnpm start ``` -------------------------------- ### JavaScript Example for API Key Authorization Source: https://github.com/unraid/docs/blob/main/docs/API/api-key-app-developer-authorization-flow.mdx This JavaScript code demonstrates how to construct the authorization URL, redirect the user, and handle the callback to securely save the received API key. ```javascript // JavaScript example const unraidServer = 'tower.local'; const appName = 'My Docker Manager'; const scopes = 'docker:*,system:read'; const redirectUri = 'https://myapp.com/unraid/callback'; const state = generateRandomState(); // Store state for verification sessionStorage.setItem('oauth_state', state); // Redirect user to authorization page window.location.href = `https://${unraidServer}/ApiKeyAuthorize?` + `name=${encodeURIComponent(appName)}&` + `scopes=${encodeURIComponent(scopes)}&` + `redirect_uri=${encodeURIComponent(redirectUri)}&` + `state=${encodeURIComponent(state)}`; // Handle callback const urlParams = new URLSearchParams(window.location.search); const apiKey = urlParams.get('api_key'); const returnedState = urlParams.get('state'); if (returnedState === sessionStorage.getItem('oauth_state')) { // Save API key securely saveApiKey(apiKey); } ``` -------------------------------- ### Create startup.nsh for EFI Boot Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/using-unraid-to/create-virtual-machines/unraid-as-a-vm.mdx Create a startup.nsh file in the root of the VM's flash drive to enable EFI boot. This file should contain the path to the EFI bootloader. ```bash \EFI\boot\bootx64.efi ``` -------------------------------- ### Install wakeonlan via Homebrew Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/system-administration/advanced-tools/partials/wake-on-lan/macos.mdx Installs the wakeonlan utility on macOS using the Homebrew package manager. ```bash brew install wakeonlan ``` -------------------------------- ### Complete Workflow: Temporary API Key Provisioning Source: https://github.com/unraid/docs/blob/main/docs/API/programmatic-api-key-management.mdx This bash script demonstrates a complete workflow for temporary API key provisioning. It creates a key, extracts it, uses it for an API call, and ensures cleanup via a trap. ```bash #!/bin/bash set -e # 1. Create temporary API key echo "Creating temporary API key..." KEY_DATA=$(unraid-api apikey --create \ --name "temp deployment key" \ --roles ADMIN \ --description "Temporary key for deployment $(date)" \ --json) # 2. Extract the API key API_KEY=$(echo "$KEY_DATA" | jq -r '.key') echo "API key created successfully" # 3. Use the key for operations echo "Configuring services..." curl -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"provider": "azure", "clientId": "your-client-id"}' \ http://localhost:3001/graphql # 4. Clean up (always runs, even on error) trap 'echo "Cleaning up..."; unraid-api apikey --delete --name "temp deployment key"' EXIT echo "Deployment completed successfully" ``` -------------------------------- ### Start Unraid API Service Source: https://github.com/unraid/docs/blob/main/docs/API/cli.mdx Starts the Unraid API service. The log level can be set using the --log-level option or the LOG_LEVEL environment variable. ```bash unraid-api start [--log-level ] ``` ```bash LOG_LEVEL=trace unraid-api start ``` -------------------------------- ### Service Management Commands Source: https://github.com/unraid/docs/blob/main/docs/API/cli.mdx Commands to start, stop, restart, and view logs for the Unraid API service. ```APIDOC ## CLI unraid-api start ### Description Starts the Unraid API service. ### Parameters #### Options - **--log-level** (string) - Optional - Set logging level (trace|debug|info|warn|error|fatal) ## CLI unraid-api stop ### Description Stops the Unraid API service. ### Parameters #### Options - **--delete** (flag) - Optional - Delete the PM2 home directory. ## CLI unraid-api restart ### Description Restarts the Unraid API service. ### Parameters #### Options - **--log-level** (string) - Optional - Set logging level (trace|debug|info|warn|error|fatal) ## CLI unraid-api logs ### Description View the API logs. ### Parameters #### Options - **-l, --lines** (number) - Optional - Number of lines to tail (default: 100) ``` -------------------------------- ### Launch Midnight Commander File Manager Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx Starts the text-based dual-pane file manager for navigating and transferring files. ```bash mc ``` -------------------------------- ### Clone the repository Source: https://github.com/unraid/docs/blob/main/README.md Download the project source code and navigate into the directory. ```bash git clone https://github.com/unraid/docs.git cd docs ``` -------------------------------- ### Unraid API CLI - OIDC Provider Configuration Notes Source: https://context7.com/unraid/docs/llms.txt Notes on configuring OIDC providers for Unraid SSO. Includes required redirect URIs, example issuer URLs for common providers, and necessary scopes. Also details simple email-based and advanced claim-based authorization rules. ```bash # Required redirect URI format for all OIDC providers: # http://YOUR_UNRAID_IP/graphql/api/auth/oidc/callback # Issuer URLs by provider: # Google: https://accounts.google.com # Microsoft: https://login.microsoftonline.com/YOUR_TENANT_ID/v2.0 # Keycloak: https://keycloak.example.com/realms/YOUR_REALM # Authelia: https://auth.yourdomain.com # Authentik: https://authentik.example.com/application/o// # Okta: https://YOUR_DOMAIN.okta.com # Required scopes for most providers: # openid, profile, email # Enable debug logging to troubleshoot OIDC issues LOG_LEVEL=debug unraid-api start --debug # Simple authorization (email-based): # - Allowed Email Domains: company.com (without @) # - Specific Email Addresses: user@example.com # Advanced authorization (claim-based rules): # - Claim: email, Operator: endsWith, Value: @company.com # - Claim: email_verified, Operator: equals, Value: true # - Claim: groups, Operator: contains, Value: admins # Rule modes: OR (any rule passes) or AND (all rules must pass) ``` -------------------------------- ### Markdown Link Example Source: https://github.com/unraid/docs/blob/main/docs/contribute/style-guide.mdx Use inline Markdown for creating links to other documents. Ensure the link text clearly describes the destination. ```markdown You can also check our [getting started guide](../unraid-os/getting-started/quick-start-guide.mdx). ``` -------------------------------- ### Create Unraid API Key via CLI Source: https://github.com/unraid/docs/blob/main/docs/API/partials/manage-api-keys-cli.mdx Use this command to initiate the creation of a new API key. Follow the on-screen prompts to configure its name, description, roles, and permissions. ```bash unraid-api apikey --create ``` -------------------------------- ### MDX Admonition Example Source: https://context7.com/unraid/docs/llms.txt Shows how to use admonition components (tip, warning, info) in MDX for highlighting important information, cautions, or suggestions. ```mdx :::tip[Pro Tip] Helpful suggestion or shortcut. ::: :::warning Important caution or potential issue. ::: :::info Additional context or background information. ::: ``` -------------------------------- ### Real-time Process and Resource Monitor Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx The 'top' command provides a dynamic view of system processes, CPU, and memory usage. Press 'q' to exit. ```bash top ``` -------------------------------- ### AMD Processor mcelog Error Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/release-notes/6.10.0.md Example of an error message that may appear in the system log for AMD processors due to the inclusion of the mcelog package. ```text mcelog: ERROR: AMD Processor family 23: mcelog does not support this processor. Please use the edac_mce_amd module instead. ``` -------------------------------- ### List block devices with lsblk Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx Use `lsblk` to display all block devices and their mount points in a tree format. Provides a clear overview of the storage layout. ```bash lsblk ``` -------------------------------- ### Enable Debug Logging for Unraid API Source: https://github.com/unraid/docs/blob/main/docs/API/oidc-provider-setup.mdx Use this command to start the Unraid API with debug-level logging enabled to troubleshoot authentication and token validation issues. ```bash LOG_LEVEL=debug unraid-api start --debug ``` -------------------------------- ### Display CPU architecture information Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/system-administration/advanced-tools/partials/command-line-interface/cpu-info.mdx Use this command to view details regarding cores, threads, virtualization support, and cache. ```bash lscpu ``` -------------------------------- ### Enable GraphQL Sandbox via CLI Source: https://github.com/unraid/docs/blob/main/docs/API/how-to-use-the-api.mdx Use the unraid-api command-line tool to enable the GraphQL sandbox. This is an alternative to the WebGUI method. ```bash unraid-api developer --sandbox true ``` ```bash unraid-api developer ``` -------------------------------- ### List all processes with ps Source: https://github.com/unraid/docs/blob/main/docs/unraid-os/system-administration/advanced-tools/command-line-interface.mdx Use `ps aux` to display all running processes with detailed information. This is useful for monitoring system activity. ```bash ps aux ```