The kernel can't execute the file: it's the wrong arch (ARM vs x86), a glibc/musl mismatch variant, or the file isn't actually a binary. One command classifies it.
x86-64 binary on ARM (or Apple Silicon downloads on a Linux/AMD64 host). uname -m vs file <binary> settles it in five seconds. Docker: image built for the wrong --platform.
A Windows PE binary, a corrupt/truncated download, or a script missing its shebang — all 'exec format error' because the kernel doesn't recognize a runnable format.
file <binary> ; uname -m # 'ELF 64-bit ... x86-64' on aarch64 = the mismatch
# download the matching release artifact (linux-arm64 vs linux-amd64), or: docker build --platform linux/amd64 ... where emulation is acceptable
docker build --platform linux/arm64 -t app:arm . ; docker run --platform linux/amd64 app # error message during run = image arch mismatch
head -1 <script> # #!/bin/bash missing or with CRLF = 'exec format error' variant
Apple Silicon developers: default release downloads are often aarch64 — check what your deploy target runs before scp'ing. file(1) also catches corrupt downloads ('data' instead of 'ELF') — re-fetch and checksum in that case.
The image's binaries don't match the host (or the --platform you forced): an arm64 image on amd64, or vice versa. Match platforms explicitly in build/run, or build multi-arch manifests.
Only via emulation (qemu binfmt + docker --platform), with a real performance cost — and it fails for some syscalls. Prefer native builds per arch in CI (docker buildx --platform linux/amd64,linux/arm64).
Our most-documented failures, packaged as ready-to-ship starter kits: Docker, Kubernetes, and Terraform.
Browse the template store →One-time. Yours to modify. Instant download from the NinjaOps template store.
One short email when new fixes and production templates drop. No spam, unsubscribe anytime.
Spin up a cloud server in 60 seconds and reproduce this fix yourself — pay by the hour.
Sentry — Free tier: see the exact line of code that broke, before users report it.
We earn a commission if you buy through our links — it never costs you extra. More vetted tools on our picks hub · comparing clouds? DigitalOcean vs Vultr and vs AWS · full deals: DigitalOcean · Vultr · NordLayer · Semrush