Quick Start
Turn a Linux binary into a single portable file in under a minute. This page assumes onelf is installed and that the binary runs on your machine.
The short version
Scaffold a recipe beside nothing but the binary itself:
bashonelf init --binary /path/to/mybinaryThis writes an
onelf.tomlwhose command isbin/mybinaryand whose[input]section names the binary you gave it. On the next step the build copies it tobin/mybinaryand packs the AppDir it assembles around the recipe: the recipe's directory is that AppDir, and nothing outside it is touched, the binary you named included. An AppDir that already holds the binary needs no[input]section: a recipe whose only field iscommandbuilds the same way, andinit --binarypointed at the AppDir's ownbin/copy writes none.Build the package:
bashonelf buildOne command does the whole journey: it stages the imported binary, reads the libraries the binary links (
DT_NEEDED) and the commonlydlopened libraries named in its strings, copies every one it needs intolib/, and packs the result. Mesa and the other GPU drivers are left out on purpose: the packed app uses the host's. The executable lands next to the recipe, named after the command, heremybinary.onelf.Run it:
bash./mybinary.onelf --any --args --you --likeArguments go straight to the app. Copy
mybinary.onelfto another machine and it runs there too.
On a typical desktop the runtime mounts the package as a private FUSE filesystem in a user namespace, execs the target, and lets the kernel clean everything up on exit. Hosts that deny user namespaces get one of the fallbacks in Execution Modes.
Without a recipe
The same two steps by hand, for a one-off:
onelf bundle-libs ./mypkg --from-binary /path/to/mybinary --scan-dlopen
onelf pack ./mypkg -o mybinary.onelf --command bin/mybinarybundle-libs copies the binary to ./mypkg/bin/mybinary and its libraries into ./mypkg/lib/; pack turns the directory into one executable. --command is the path of the binary inside the AppDir. The command line cannot do everything the recipe can, so anything reused or committed to a repo belongs in an onelf.toml.
If something is missing
A library the app loads by a computed name at run time is invisible to the scan in step 2, and the packed app fails on another machine with cannot open shared object file. Let the app show what it loads:
onelf bundle-libs ./mypkg --target bin/mybinary --trace-runThis runs the binary for a few seconds and bundles every library it opened. Then pack again. Bundling Libraries covers the other ways to find and add libraries.
Dev loop
Run the AppDir in place, without packing:
onelf run --bundle # assemble from the recipe, then run
onelf run # subsequent runs: reuse the prepared viewonelf run stages the tree once, uncompressed, into a private per-identity view under the onelf cache and reuses it untouched until something that changes what the launch shows or restores changes. See Developing Packages.
Inspect
onelf info mybinary.onelf # metadata, entrypoints, sizes
onelf list mybinary.onelf # file tree
onelf verify mybinary.onelf # BLAKE3 integrity check
./mybinary.onelf --onelf-doctor # host, sets and execution viewWhat's next
- How onelf Thinks: why a bundle carries its own libc and takes the GPU drivers from the host
- AppDir Layout: how the directory is structured
- Recipe File: declarative packaging, imports and set selection
- Execution Modes: how the runtime actually runs things
- Self-Update: signed delta updates over HTTPS