Skip to content

Building from Source

NK edited this page Aug 14, 2026 · 1 revision

Building from source

Requirements

  • A C++17 compiler (GCC or Clang)
  • CMake ≥ 3.16
  • zlib (optional) — enables SquashFS / cramfs / JFFS2 decompression
  • zstd (optional) — enables Btrfs zstd extents

Build

git clone https://github.com/nkbeast/ghost-recover
cd ghost-recover
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

The engine binary is build/ghost_recover. Run ./build/ghost_recover --help for usage, or just ./build/ghost_recover to start the web interface.

Run

./build/ghost_recover            # web interface on http://127.0.0.1:3030
./build/ghost_recover --help     # CLI reference

Recovered files go to $GHOST_OUTPUT, or ~/ghost-recover-output.

Tests

Unit and fixture-based integration tests live in tests/:

cd build
ctest --output-on-failure

Test fixtures (real ext4 / NTFS / exFAT / Btrfs images with known deleted files) are generated by scripts under tests/ — e.g. build-fixtures.sh, exfat_fixture.py, btrfs_compress_fixture.py — and every recovery result is verified byte-for-byte.

Continuous integration

CI (.github/workflows/ci.yml) builds on Ubuntu, installs the fixture-build dependencies (e2fsprogs, dosfstools, exfatprogs, zlib, ccache, …), runs the full test suite, and only passes when every recovered file matches its original bytes. The release workflow produces a statically linked, stripped binary and attaches it to the GitHub release.

Release

Prebuilt binaries are attached to releases: a single tarball with the engine and the web interface assets. Extract and run:

tar xzf ghost-recover-1.0.0-linux-x86_64.tar.gz
./ghost_recover

Clone this wiki locally