Longhorn Engine implements a lightweight block device storage controller capable of storing the data in a number of replicas. It functions like a network RAID controller.
- The replicas are backed by Linux sparse files, and support efficient snapshots using differencing disks.
- The replicas function like a networked disk, supporting read/write operations over a network protocol.
- The frontend (only Open-iSCSI/tgt are supported at this moment) is a kernel driver that translates read/write operations on the Longhorn block device (mapped at
/dev/longhorn/vol-name) to user-level network requests on the controller. - Each Longhorn block device is backed by its own dedicated controller.
- The controller synchronously replicates write operations to all replicas.
- The controller detects faulty replicas and rebuilds replicas.
- The controller coordinates snapshot and backup operations.
- Controllers and replicas are packaged as Docker containers.
The following figure illustrates the relationship between the Longhorn block device, tgt frontend, controller, and replicas.
make
The easiest way to try the Longhorn Engine is to start a controller with a single replica.
Host needs to have docker installed. Run the following command to make sure:
docker info
User needs to make sure the host has iscsiadm installed. Run the following command to check:
iscsiadm --version
To start Longhorn Engine with an single replica, run the following command:
docker run --privileged -v /dev:/host/dev -v /proc:/host/proc -v /volume \
longhornio/longhorn-engine:master-head launch-simple-longhorn vol-name 10g tgt-blockdev
That will create the device /dev/longhorn/vol-name
In order to start Longhorn Engine with multiple replicas, you need to setup a network between replica container and controller container. Here we use Docker network feature to demonstrate that:
docker network create --subnet=172.18.0.0/16 longhorn-net
docker run --net longhorn-net --ip 172.18.0.2 -v /volume \
longhornio/longhorn-engine longhorn replica --listen 172.18.0.2:9502 --size 10g /volume
docker run --net longhorn-net --ip 172.18.0.3 -v /volume \
longhornio/longhorn-engine longhorn replica --listen 172.18.0.3:9502 --size 10g /volume
docker run --net longhorn-net --privileged -v /dev:/host/dev -v /proc:/host/proc \
longhornio/longhorn-engine longhorn controller --frontend tgt-blockdev \
--replica tcp://172.18.0.2:9502 --replica tcp://172.18.0.3:9502 vol-name
Now you will have device /dev/longhorn/vol-name.
The longhorn command in the controller container, you can list replicas, add and remove replicas, take snapshots, and create backups.
$ docker exec <controller-docker-id> longhorn ls
ADDRESS MODE CHAIN
tcp://172.18.0.2:9502 RW [volume-head-000.img]
tcp://172.18.0.3:9502 RW [volume-head-000.img]
The longhornio/longhorn-engine images are signed by the build workflow with Cosign keyless signing: right after the multi-arch image index is created and pushed, its digest is signed using the GitHub Actions OIDC identity of the workflow, and the signature is stored in the registry and recorded in the Rekor transparency log. Release images and branch builds (master and v* branches, published as <branch>-head) are signed; images published before signing was introduced are not.
Verify an image with cosign v3.1.0 or later. The exact identity ties the signature to the release you expect, so an image signed for another tag is rejected:
cosign verify docker.io/longhornio/longhorn-engine:${LonghornVersion} \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity "https://github.com/longhorn/longhorn-engine/.github/workflows/build.yml@refs/tags/${LonghornVersion}"For a branch build, use the branch ref in the identity, such as build.yml@refs/heads/master for master-head.
Only the multi-arch image index is signed: verify an image by its tag or index digest, not by the digest of a single-platform manifest. The per-architecture -amd64 and -arm64 tags, from which the index is created, are not signed.
A mirrored image, such as docker.io/rancher/mirrored-longhornio-longhorn-engine, keeps the same digest. If its signature was not mirrored with it, read the signature from the original repository:
COSIGN_REPOSITORY=docker.io/longhornio/longhorn-engine cosign verify <mirrored-image> ...To mirror an image together with its signature, copy its OCI referrers as well, for example with regctl image copy --referrers.
Please check the main repo for the contributing guide.
Copyright (c) 2014-2026 The Longhorn Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.