### Install ffmpeg using a Custom Init Script Source: https://docs.linuxserver.io/general/container-customization A custom script example to install ffmpeg within a container. Ensure the script is executable and owned by root. ```bash #!/bin/bash echo "**** installing ffmpeg ****" apk add --no-cache ffmpeg ``` -------------------------------- ### Example Environment Variable Setup Source: https://docs.linuxserver.io/images/docker-flexget Sets FlexGet logging level and log file location using environment variables. ```bash -e FG_LOG_LEVEL=info -e FG_LOG_FILE=/config/flexget.log ``` -------------------------------- ### Example Port Mapping for Kasm Installation Source: https://docs.linuxserver.io/images/docker-kasm?q= Maps the internal Kasm installation wizard port to an external host port. ```bash -p 3000:3000 ``` -------------------------------- ### Nextcloud Docker CLI Setup Source: https://docs.linuxserver.io/general/swag Use these Docker CLI commands to create Nextcloud containers. This example assumes a user-defined bridge network 'lsio' is already set up. ```bash docker create \ --name=nextcloud \ --net=lsio -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ -v /home/aptalca/appdata/nextcloud/config:/config \ -v /home/aptalca/appdata/nextcloud/data:/data \ --restart unless-stopped \ lscr.io/linuxserver/nextcloud ``` -------------------------------- ### Install Application with PRoot Apps Source: https://docs.linuxserver.io/images/docker-altus?q= Use this command inside the container to install applications that will persist across container recreations. ```bash proot-apps install filezilla ``` -------------------------------- ### Example Docker Run Command with Ports and Volumes Source: https://docs.linuxserver.io/images/docker-phpmyadmin This example demonstrates a typical Docker run command for PHPMyAdmin, specifying port mappings and volume mounts for persistent configuration. ```bash docker run -d \ --name phpmyadmin \ -p 8080:80 \ -v /path/to/your/config:/config \ -e PMA_ARBITRARY=1 \ -e PMA_ABSOLUTE_URI=https://phpmyadmin.example.com \ phpmyadmin/phpmyadmin:latest ``` -------------------------------- ### Nvidia Container Runtime Setup Source: https://docs.linuxserver.io/images/docker-emby?q= For Nvidia hardware acceleration, install the Nvidia container runtime and use the '--runtime=nvidia' flag. Set the NVIDIA_VISIBLE_DEVICES environment variable to 'all' or a specific GPU UUID. ```bash --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all ``` -------------------------------- ### Configure Native App Installation Source: https://docs.linuxserver.io/images/docker-cura?q= Add these environment variables to your compose.yaml to install packages from the system's native repository. Note that this method is not persistent and may increase container start time. ```yaml environment: - DOCKER_MODS=linuxserver/mods:universal-package-install - INSTALL_PACKAGES=libfuse2|git|gdb ``` -------------------------------- ### Nvidia GPU Setup for Hardware Acceleration Source: https://docs.linuxserver.io/images/docker-boinc?q= For Nvidia GPUs, install the nvidia-container-toolkit on the host. Recreate the container using the nvidia runtime and set the NVIDIA_VISIBLE_DEVICES environment variable. This allows the container to utilize host GPU features. ```bash --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all ``` -------------------------------- ### Start SWAG Container with Docker CLI Source: https://docs.linuxserver.io/general/swag?q= Command to start the previously created SWAG container. ```bash docker start swag ``` -------------------------------- ### Docker CLI Command for Monica Setup Source: https://docs.linuxserver.io/images/docker-monica This docker run command can be used to create and start a Monica container. It includes essential environment variables and port mappings. ```bash docker run -d \ --name=monica \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -e DB_HOST= \ -e DB_PORT= \ -e DB_USERNAME= \ -e DB_PASSWORD= \ -e DB_DATABASE= \ -e APP_URL=http://localhost:80 #optional \ -e TRUSTED_PROXIES= #optional \ -e APP_ENV=local #optional \ -e APP_DISABLE_SIGNUP=true #optional \ -p 80:80 \ -p 443:443 \ -v /path/to/monica/config:/config \ --restart unless-stopped \ lscr.io/linuxserver/monica:latest ``` -------------------------------- ### Docker CLI Setup for ProjectSend Source: https://docs.linuxserver.io/images/docker-projectsend?q= Deploy ProjectSend using the Docker CLI. This command includes essential environment variables, volume mounts, and port mappings for a functional setup. ```bash docker run -d \ --name=projectsend \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -p 80:80 \ -v /path/to/projectsend/config:/config \ -v /path/to/data:/data \ --restart unless-stopped \ lscr.io/linuxserver/projectsend:latest ``` -------------------------------- ### Docker CLI Setup for Manyfold Source: https://docs.linuxserver.io/images/docker-manyfold?q= Alternative setup using the docker CLI. This command mirrors the docker-compose configuration, including essential environment variables and volume mounts. ```bash docker run -d \ --name=manyfold \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -e DATABASE_URL= \ -e REDIS_URL= \ -e SECRET_KEY_BASE= \ -p 3214:3214 \ -v /path/to/manyfold/config:/config \ -v /path/to/libraries:/libraries #optional \ --restart unless-stopped \ lscr.io/linuxserver/manyfold:latest ``` -------------------------------- ### Docker CLI Setup for Kavita Source: https://docs.linuxserver.io/images/docker-kavita This docker cli command provides a way to run the Kavita container directly. It mirrors the docker-compose setup with environment variables, volume mounts, and port mapping. ```bash docker run -d \ --name=kavita \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -p 5000:5000 \ -v /path/to/kavita/config:/config \ -v /path/to/data:/data `#optional` \ --restart unless-stopped \ lscr.io/linuxserver/kavita:latest ``` -------------------------------- ### Docker Installation Storage Volume Source: https://docs.linuxserver.io/images/docker-kasm Maps the host's directory to the container's /opt directory for Docker and installation storage. ```bash /opt ``` -------------------------------- ### Docker Compose Setup for Manyfold Source: https://docs.linuxserver.io/images/docker-manyfold?q= Recommended setup using docker-compose. Ensure you configure PUID, PGID, TZ, and database/Redis URLs as needed. The config and libraries volumes are essential for persistent data. ```yaml --- services: manyfold: image: lscr.io/linuxserver/manyfold:latest container_name: manyfold environment: - PUID=1000 - PGID=1000 - TZ=Etc/UTC - DATABASE_URL= - REDIS_URL= - SECRET_KEY_BASE= volumes: - /path/to/manyfold/config:/config - /path/to/libraries:/libraries #optional ports: - 3214:3214 restart: unless-stopped ``` -------------------------------- ### Install Native Apps using Universal Package Install Mod Source: https://docs.linuxserver.io/images/docker-altus?q= Configure your compose.yaml to use the universal-package-install mod for installing system packages. Note that these installations are not persistent and may increase container start time. ```yaml environment: - DOCKER_MODS=linuxserver/mods:universal-package-install - INSTALL_PACKAGES=libfuse2|git|gdb ``` -------------------------------- ### Setup QEMU for ARM Builds Source: https://docs.linuxserver.io/images/docker-adguardhome-sync?q= Run the QEMU static binary to enable building ARM variants on non-ARM architectures. This is necessary for cross-compilation. ```bash docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset ``` -------------------------------- ### Configure Native App Installation in Docker Compose Source: https://docs.linuxserver.io/images/docker-audacity Add these environment variables to your compose.yaml to install packages from the system's native repository using the universal-package-install mod. Note that this method increases container start time and is not persistent. ```yaml environment: - DOCKER_MODS=linuxserver/mods:universal-package-install - INSTALL_PACKAGES=libfuse2|git|gdb ``` -------------------------------- ### Run the 'hello-world' Docker container Source: https://docs.linuxserver.io/general/containers-101?q= This command downloads and runs the 'hello-world' container, demonstrating the basic usage of Docker to execute a containerized application without needing to know its dependencies. ```bash docker run hello-world ``` -------------------------------- ### MariaDB Docker Container Setup Source: https://docs.linuxserver.io/general/swag This snippet shows the docker create command for setting up a MariaDB container. It includes environment variables for user, password, database, and volume mapping for configuration. ```bash docker create \ --name=mariadb \ --net=lsio \ -e PUID=1000 \ -e PGID=1000 \ -e MYSQL_ROOT_PASSWORD=mariadbpassword \ -e TZ=Europe/London \ -e MYSQL_DATABASE=nextcloud \ -e MYSQL_USER=ncuser \ -e MYSQL_PASSWORD=ncpassword \ -v /home/aptalca/appdata/mariadb:/config \ --restart unless-stopped \ lscr.io/linuxserver/mariadb ``` -------------------------------- ### Example Environment Variable for Secret Path Source: https://docs.linuxserver.io/images/docker-pwndrop?q= Sets the secret path for admin access. This parameter only takes effect during initial install. ```bash -e SECRET_PATH=/pwndrop ``` -------------------------------- ### Control Docker-in-Docker (DinD) Startup Source: https://docs.linuxserver.io/images/docker-azahar Set START_DOCKER to false to prevent a container with privilege from automatically starting the DinD Docker setup. ```bash -e START_DOCKER=false ``` -------------------------------- ### Build qBittorrent Docker Image Locally Source: https://docs.linuxserver.io/images/docker-qbittorrent Clones the qBittorrent Docker repository and builds the image locally with the latest code. Use --no-cache and --pull for a clean build. ```bash git clone https://github.com/linuxserver/docker-qbittorrent.git cd docker-qbittorrent docker build \ --no-cache \ --pull \ -t lscr.io/linuxserver/qbittorrent:latest . ``` -------------------------------- ### Vulkan Support for Video Processing Source: https://docs.linuxserver.io/images/docker-ffmpeg Demonstrates using Vulkan for hardware acceleration, specifically for benchmarking. This example initializes Vulkan hardware devices and outputs to null. ```bash docker run --rm -it \ --device=/dev/dri:/dev/dri \ -v $(pwd):/config \ -e ANV_VIDEO_DECODE=1 \ linuxserver/ffmpeg \ -init_hw_device "vulkan=vk:0" \ -hwaccel vulkan \ -hwaccel_output_format vulkan \ -i /config/input.mkv \ -f null - -benchmark ``` -------------------------------- ### Docker CLI Setup for Pwndrop Source: https://docs.linuxserver.io/images/docker-pwndrop This command demonstrates how to run Pwndrop using the Docker CLI. It includes essential environment variables and volume mappings for configuration. ```bash docker run -d \ --name=pwndrop \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -e SECRET_PATH=/pwndrop `#optional` \ -p 8080:8080 \ -v /path/to/pwndrop/appdata:/config \ --restart unless-stopped \ lscr.io/linuxserver/pwndrop:latest ``` -------------------------------- ### Nginx Container with Cloudflared Docker Mod Source: https://docs.linuxserver.io/general/container-customization This example demonstrates how to configure an Nginx container to use the universal cloudflared Docker Mod for enhanced functionality. It includes environment variables for Cloudflare tunnel setup. ```yaml nginx: image: lscr.io/linuxserver/nginx container_name: nginx environment: PUID: 1000 PGID: 1000 TZ: Europe/London DOCKER_MODS: lscr.io/linuxserver/mods:universal-cloudflared CF_ZONE_ID: zone_id CF_ACCOUNT_ID: acct_id CF_API_TOKEN: token CF_TUNNEL_NAME: example CF_TUNNEL_PASSWORD: pleasedontusethisexamplepassword CF_TUNNEL_CONFIG: | ingress: - hostname: test.example.com service: http://localhost:80 - service: http_status:404 volumes: - /path/to/appdata/config:/config restart: unless-stopped ``` -------------------------------- ### Run Docker-in-Docker with GPU Mount Source: https://docs.linuxserver.io/images/docker-bitcoin-knots?q= Starts a Docker-in-Docker (DinD) environment with privileged access. For better performance, mount the Docker data directory from the host. This example also mounts a GPU into the container for accelerated applications. ```bash --privileged -v /path/to/docker-data:/var/lib/docker -v /var/run/docker.sock:/var/run/docker.sock --device /dev/dri:/dev/dri ``` -------------------------------- ### Docker CLI Command for Webtop Source: https://docs.linuxserver.io/images/docker-webtop?q= Run this docker CLI command to start the webtop container. It includes essential environment variables, port mappings, volume configuration, and restart policy. ```bash docker run -d \ --name=webtop \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -p 3000:3000 \ -p 3001:3001 \ -v /path/to/data:/config \ --shm-size="1gb" \ --restart unless-stopped \ lscr.io/linuxserver/webtop:latest ``` -------------------------------- ### Create a LinuxServer Container Source: https://docs.linuxserver.io/general/running-our-containers Use this command template to create a container from a LinuxServer.io image. Ensure you replace placeholders like , , , , , , and with your specific values. Mapping the /config volume is crucial for persisting application data. ```bash docker create \ --name= \ -v :/config \ -e PUID= \ -e PGID= \ -p : \ linuxserver/ ``` -------------------------------- ### Install Plugin Requirements Source: https://docs.linuxserver.io/images/docker-limnoria Manually install requirements for a plugin by executing a pip install command within the container's shell. This is an alternative to restarting the container. ```bash pip install /config/plugins/ThePlugin/requirements.txt ``` -------------------------------- ### Setting Wayland Mode and Desktop Environment Source: https://docs.linuxserver.io/images/docker-calligra Enable Wayland mode for GPU-accelerated zero-copy encoding and optionally initialize a desktop panel. ```bash -e PIXELFLUX_WAYLAND=true -e SELKIES_DESKTOP=true ``` -------------------------------- ### Set up Docker QEMU Static for ARM Builds Source: https://docs.linuxserver.io/images/docker-socket-proxy Run the Docker QEMU static container to enable building ARM variants on x86_64 hardware. This command resets the QEMU environment. ```bash docker run --rm --privileged lscr.io/linuxserver/docker-qemu-static --reset ``` -------------------------------- ### Install Docker Compose Manually Source: https://docs.linuxserver.io/general/docker-compose Installs the Docker Compose CLI plugin to the user's home directory. Ensure Docker is installed prior to running this command. ```bash mkdir -p "$HOME/.docker/cli-plugins" && \ curl -sL "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o "$HOME/.docker/cli-plugins/docker-compose" && \ chmod +x $HOME/.docker/cli-plugins/docker-compose ``` -------------------------------- ### Configure Container Display and GPU Options Source: https://docs.linuxserver.io/images/docker-vscodium Set environment variables to configure display modes (Wayland/X11), GPU acceleration (VAAPI/NVENC, EGL/3D), and basic authentication for Selkies-based containers. ```bash -e PIXELFLUX_WAYLAND=true -e SELKIES_DESKTOP=true -e CUSTOM_USER=myuser -e DRI_NODE=/dev/dri/renderD128 -e DRINODE=/dev/dri/renderD129 -e AUTO_GPU=true -e PASSWORD=mypassword -e SUBFOLDER=/subfolder/ -e TITLE=MySelkies -e DASHBOARD=selkies-dashboard-wish -e FILE_MANAGER_PATH=/data -e START_DOCKER=false -e DISABLE_IPV6=true -e NO_DECOR=true -e NO_FULL=true -e NO_GAMEPAD=true -e DISABLE_ZINK=true -e DISABLE_DRI3=true -e MAX_RES=15360x8640 -e WATERMARK_PNG=/usr/share/selkies/www/icon.png -e WATERMARK_LOCATION=4 ``` -------------------------------- ### Map Docker and Installation Storage Volume Source: https://docs.linuxserver.io/images/docker-kasm?q= Maps the host directory for Docker and Kasm installation storage to the container. ```bash -v /opt ``` -------------------------------- ### Docker CLI Command for Wiki.js Setup Source: https://docs.linuxserver.io/images/docker-wikijs?q= This docker run command deploys the Wiki.js container. It includes essential environment variables, port mappings, and volume mounts. Database configuration variables are effective only on the initial container launch. ```bash docker run -d \ --name=wikijs \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -e DB_TYPE=sqlite `#optional` \ -e DB_HOST= `#optional` \ -e DB_PORT= `#optional` \ -e DB_NAME= `#optional` \ -e DB_USER= `#optional` \ -e DB_PASS= `#optional` \ -p 3000:3000 \ -v /path/to/wikijs/config:/config \ -v /path/to/data:/data \ --restart unless-stopped \ lscr.io/linuxserver/wikijs:latest ``` -------------------------------- ### Build Docker Syncthing Image Locally Source: https://docs.linuxserver.io/images/docker-syncthing Clone the repository, navigate to the directory, and build the Docker image using the provided command. This is useful for local development and customization. ```bash git clone https://github.com/linuxserver/docker-syncthing.git cd docker-syncthing docker build \ --no-cache \ --pull \ -t lscr.io/linuxserver/syncthing:latest . ``` -------------------------------- ### Check for SNAP Docker Installation Source: https://docs.linuxserver.io/FAQ This command helps to determine if the SNAP version of Docker is installed on your system. It should be removed if present. ```bash snap list | grep docker ``` -------------------------------- ### Docker CLI Command for Bambu Studio Source: https://docs.linuxserver.io/images/docker-bambustudio Run this docker CLI command to start the Bambu Studio container. It includes essential environment variables, port mappings, and volume configurations. ```bash docker run -d \ --name=bambustudio \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Etc/UTC \ -e DARK_MODE=true `#optional` \ -p 3000:3000 \ -p 3001:3001 \ -v /path/to/bambustudio/config:/config \ --shm-size="1gb" \ --restart unless-stopped \ lscr.io/linuxserver/bambustudio:latest ``` -------------------------------- ### Bootstrap MariaDB with SQL Files Source: https://docs.linuxserver.io/images/docker-mariadb Place custom SQL files in '/config/initdb.d/' to initialize the database on the container's first boot. This is an alternative to using the REMOTE_SQL environment variable. ```bash /config/initdb.d/ ``` -------------------------------- ### Example User/Group ID Output Source: https://docs.linuxserver.io/images/docker-apprise-api This is an example of the output from the `id your_user` command, showing the uid, gid, and groups for a user. ```bash uid=1000(your_user) gid=1000(your_user) groups=1000(your_user) ``` -------------------------------- ### Kasm Installation Wizard Port Source: https://docs.linuxserver.io/images/docker-kasm Maps the internal Kasm installation wizard port (3000) to the host's port 3000. ```bash 3000:3000 ``` -------------------------------- ### Manual Docker Compose Installation Source: https://docs.linuxserver.io/general/docker-compose?q= Installs the Docker Compose CLI plugin manually. This script downloads the latest release and makes it executable. ```bash mkdir -p "$HOME/.docker/cli-plugins" && \ curl -sL "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o "$HOME/.docker/cli-plugins/docker-compose" && \ chmod +x $HOME/.docker/cli-plugins/docker-compose ``` -------------------------------- ### Check Docker and Docker Compose Versions Source: https://docs.linuxserver.io/FAQ Verify the installed versions of Docker and Docker Compose. This is useful for confirming a successful installation and compatibility. ```bash docker --version && docker compose version ``` -------------------------------- ### Enable Docker-in-Docker (DinD) Source: https://docs.linuxserver.io/images/docker-altus?q= Starts a Docker-in-Docker (DinD) environment. For optimal performance, mount the Docker data directory from the host. ```bash --privileged -v /path/to/docker-data:/var/lib/docker ``` -------------------------------- ### Verify Docker Installation Path (Correct) Source: https://docs.linuxserver.io/FAQ After removing SNAP Docker, use this command to verify that the official Docker installation is correctly recognized and accessible. ```bash sudo whereis docker ``` -------------------------------- ### Build Docker Jellyfin Image Locally Source: https://docs.linuxserver.io/images/docker-jellyfin Clone the repository, navigate to the directory, and build the Docker image using the provided command. The `--no-cache` and `--pull` flags ensure a fresh build. ```bash git clone https://github.com/linuxserver/docker-jellyfin.git cd docker-jellyfin docker build \ --no-cache \ --pull \ -t lscr.io/linuxserver/jellyfin:latest . ``` -------------------------------- ### Register and Use QEMU Static for Cross-Architecture Builds Source: https://docs.linuxserver.io/images/docker-calibre?q= Registers QEMU static binaries to enable building ARM variants on x86_64 hardware and vice versa. It also shows how to specify a Dockerfile for a specific architecture. ```bash docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset ``` ```bash docker build -f Dockerfile.aarch64 --pull --no-cache -t lscr.io/linuxserver/calibre:latest . ```