Linux SDK

Linux Barcode Scanner SDK for x86_64 and ARM64

Add offline 1D, 2D and MRZ decoding to Linux desktop, server, kiosk and embedded applications. The barKoder barcode reader library for Linux has a native C++ API, runs on x86_64 and ARM64, and decodes camera frames, image files and pixel buffers in real time or in batches.

Linux Tux penguin logo for the barKoder barcode scanner SDK for Linux

What the Linux barcode scanner SDK gives you

The barKoder Linux SDK is a barcode reader library you link into your own C++ application. It is hardware-agnostic: your code captures the image from any source, and the SDK returns every barcode it finds. Decoding runs locally, with no image sent to a remote service.

Supported environments

OS and architecture

  • Ubuntu 20.04 or newer, Debian, CentOS or a similar Linux distribution.
  • x86_64 and ARM64 processors.
  • gcc and make to build, plus the libcurl, libiconv, libjpeg and libpng system libraries.
  • Shared libraries (.so) for each architecture. Static linking isn't officially supported.
Linux SDK installation guide →

Inputs and workflows

Cameras, files and buffers

  • Webcams, industrial cameras and image streams.
  • Image files, and RGB or grayscale pixel buffers from your own pipeline.
  • Real-time scanning from live frames and batch scanning of stored images.
  • Fits next to the computer vision stack you already run.
See every supported barcode type →

What it decodes

1D, 2D and MRZ

  • 1D codes such as Code 128, Code 39, EAN, UPC, GS1 DataBar, ITF-14 and postal barcodes.
  • 2D codes such as QR Code, Data Matrix, PDF417, Aztec, DotCode and MaxiCode.
  • Machine Readable Zones on passports and ID documents, with the OCR build.
  • GS1, AAMVA and South African driving license data returned as parsed fields.
Explore the barcode data parsers →

Build the sample app in seven steps

The Linux package ships with a sample application and a build script. These steps follow the installation guide.

  1. Download Log in to the barKoder Developer Portal, open Repository, choose barKoder for Linux and download the latest package.
  2. Install libraries Make sure libcurl, libiconv, libjpeg and libpng are installed.
  3. Copy the .so files Copy the shared library for your architecture from the libs folder to the system library folder, or to your project folder with LD_LIBRARY_PATH set.
  4. Add your key Put a trial or production license key in Config::InitializeWithLicenseKey.
  5. Configure Choose the barcode types, decoding speed and maximum number of results.
  6. Build Run buildSample.sh. Without libjpeg and libpng the sample can still be built, but then it reads BMP files only.
  7. Run Start the sample with an image file name as its only argument.

From the Linux installation guide. Enable only the barcode types your application expects.

C++
            using namespace NSBarkoder;
            printf("SDK version: %s\n",Barkoder::GetLibVersion().c_str());
            //Use valid trial or production key here
            ConfigResponse response = Config::InitializeWithLicenseKey("Put valid license key here");
            Config *config = response.GetConfig();
            // Configure decoder
            config->decodingSpeed = DecodingSpeed::Normal;
            config->maximumResultsCount = 10;
            // Enable specific decoders
            config->SetEnabledDecoders(std::vector<DecoderType>{
            DecoderType::Datamatrix,
            DecoderType::PDF417,
            DecoderType::QR,
            DecoderType::Code128,
            DecoderType::UpcA,
            DecoderType::Ean13
            // ... add others as needed
            });
          

On Debian and Ubuntu, from the C++ SDK installation notes. The notes also list the yum and dnf packages for CentOS, RHEL, AlmaLinux, Rocky Linux and Fedora.

Shell
            sudo apt update
            sudo apt install libcurl4-openssl-dev libjpeg-dev libpng-dev
          

Need MRZ? Use the libraries from the libs_ocr folder, copy the OCR_Resources files next to your executable and use a license key with MRZ enabled. MRZ is supported on 64-bit platforms only.

Get the Linux SDK

Server-side barcode detection on Linux

On a server there is no camera preview. Your service receives an image, passes the pixels to the decoder and stores or routes what comes back. The same process works for nightly batch jobs over scanned documents and photo archives.

What to plan for

  • Several barcodes per image: raise maximumResultsCount instead of cropping images first.
  • Decoding speed is a setting. The C++ notes list Fast, Normal, Slow and Rigorous, where Rigorous is the most robust and the slowest.
  • Decoding can run synchronously or asynchronously with a callback.
  • Custom options of the native decoder library are shared by every Config in the process, so set them before scanning starts.
Custom options of the native decoder library →

Prefer Python?

The Python Barcode Scanner SDK wraps the same decoder for Python 3.11 or newer on 64-bit Linux. It takes a grayscale NumPy array, returns JSON and fits OpenCV pipelines and automation scripts. Its GitHub README covers Linux x86_64 and ARM64 packages.

Server deployment is licensed on custom terms. Tell us your volume and environment when you ask for a quote.

Request a server license quote

Barcode scanning on ARM64 control units and kiosks

The Linux SDK is lightweight enough for local and embedded use. ARM64 builds let you decode on the device that holds the camera, so a kiosk, a machine or a gateway keeps working without a network connection.

Planning a Raspberry Pi or another ARM64 board? Use a 64-bit operating system, especially if you need MRZ, and test your camera and barcodes with a trial key before you commit to hardware.

Read the barcodes that other Linux barcode readers miss

The Linux SDK uses the same decoding engine as barKoder's mobile and web SDKs.

Damaged and deformed codes

C++, Python or another barKoder SDK?

If you are building Use Why
A native Linux service, kiosk or device Linux SDK (C++) Direct control of decoding, x86_64 and ARM64 libraries, MRZ with the OCR build.
A script or data pipeline Python Barcode Scanner SDK One decodeImage call per image, results as JSON, works with OpenCV and NumPy.
A browser app that Linux users open Web Barcode Scanner SDK Scans with the camera inside the browser, nothing to install.
A .NET application on Windows C# Barcode Scanner SDK NuGet package for .NET 6.0 or newer on Windows and Windows Server.

Camera-based scanning in kiosks and machines

Both teams use the barKoder Web SDK. Their setups, a vision pipeline inside a machine and an unmanned kiosk, are the ones the Linux SDK is built for.

One decoding engine on Linux and every other platform

Building more than a Linux service? The same barKoder decoder ships as native, web and cross-platform SDKs, so your mobile, browser and back-office scanning behave the same way.

  • 7 native & desktop SDKs
  • 6 cross-platform integrations
  • One consistent scanning core

Try barKoder on your phone or in your browser

Install the free barKoder demo app, or open the web demo, and scan your own barcodes before you integrate the SDK.

iPhone and iPad

barKoder demo app for iOS

Scan with your camera, or point it at the QR code to open the App Store.

Download on the App Store
QR code linking to the barKoder demo app on the App Store

Android phones and tablets

barKoder demo app for Android

Scan with your camera, or point it at the QR code to open Google Play.

Get it on Google Play
QR code linking to the barKoder demo app on Google Play

Any modern browser

barKoder web demo

Runs the Web SDK in your browser, on desktop or mobile, with nothing to install.

Open the web demo
QR code linking to the barKoder web demo

Test with known samples. Print or display the testing sheet and scan each 1D and 2D barcode with the demo app. The data sheet summarizes the SDK for your team.

Linux barcode scanner SDK questions

Which Linux distributions does the barcode scanner SDK support?

Ubuntu 20.04 or newer, Debian, CentOS and similar distributions. You need gcc and make, plus the libcurl, libiconv, libjpeg and libpng libraries. The Linux installation guide lists every step, and the C++ SDK installation notes give the package commands for Debian, Ubuntu, CentOS, RHEL and Fedora.

Does the Linux SDK run on ARM64 or a Raspberry Pi?

The Linux SDK ships ARM64 libraries next to the x86_64 ones and is used in ARM64-based control units, kiosks and embedded systems. The C++ installation notes also list arm32 and x86 builds, but MRZ needs a 64-bit platform. barKoder doesn't publish a list of tested boards, so run your own camera and barcodes through a trial key on the board you plan to ship.

Can I use it for server-side barcode detection?

Yes. Load uploaded images, scanned documents or camera frames in your service, pass the pixels to the decoder and read every result. Set maximumResultsCount for images with several barcodes. Server deployment is licensed on custom terms, so request a quote with your expected volume.

Does the Linux barcode reader work offline?

Yes. The SDK checks the license key with the barKoder licensing server when it initializes. Decoding runs locally, and each device must reach the licensing server at least once every 30 days. The SDK doesn't store personal information retrieved from scanning a barcode.

Can the Linux SDK read MRZ on passports and ID cards?

Yes. Build with the libraries from the libs_ocr folder, copy the OCR_Resources files next to your executable and use a license key with MRZ enabled. MRZ is available on 64-bit platforms only. See the MRZ Scanner SDK for the document formats and fields.

Is there a Python barcode reader for Linux?

Yes. The Python Barcode Scanner SDK runs on 64-bit Linux with Python 3.11 or newer, with Ubuntu 22.04 or newer recommended. It needs opencv-python and numpy and returns results as JSON.

Which barcode types does the Linux barcode reader library decode?

All major 1D and 2D types, including Code 128, Code 39, EAN, UPC, GS1 DataBar, GS1 Composite, Interleaved 2 of 5, postal barcodes, QR Code, Data Matrix, PDF417, Aztec, DotCode and MaxiCode. See the full list of supported barcode types.

How do I get the Linux SDK and a trial key?

Register on the Developer Portal and download barKoder for Linux from the Repository section. A free trial license runs for 30 days on up to 25 devices with unlimited scans.

Test barKoder on your Linux hardware

Get a free 30-day trial key and decode your own images on x86_64 or ARM64, or talk to an SDK expert about server and embedded licensing.