153 words
1 minutes
🐳 Running x86_64 Docker Containers on ARM64 Architecture

πŸ› οΈ Why This is Needed#

ARM-based servers (like AWS Graviton) use the ARM64 architecture and can’t run amd64/x86 containers natively without emulation. qemu with binfmt_misc allows running x86_64 (amd64) binaries via emulation.


1. Enable binfmt Emulation Support#

Pull and run the Docker image to register QEMU binaries for various architectures:

docker run --rm --privileged --platform=linux/arm64 tonistiigi/binfmt --install all

βœ… This sets up emulation for:

  • qemu-aarch64
  • qemu-arm
  • qemu-x86_64
  • and more…

2. Verify QEMU Emulators Are Registered#

Run the following:

ls /proc/sys/fs/binfmt_misc/

You should see entries like:

qemu-aarch64
qemu-arm
qemu-x86_64
...

3. Run an amd64 Docker Image (ShellNGN Example)#

Option A: Run with docker run#

docker run --rm -p 8070:8080 --platform linux/amd64 shellngn/pro:latest

Access it at: http://your-server-ip:8070


Option B: Use docker-compose.yml#

Use This Flag in Compose:

platform: linux/amd64
version: "3.3"

services:
  shellngn:
    platform: linux/amd64
    container_name: shellngn-pro
    image: shellngn/pro:latest
    ports:
      - 8070:8080
    environment:
      - HOST=0.0.0.0
    user: "0:0"
    volumes:
      - ./data:/home/node/server/data
    networks:
      - nginx

networks:
  nginx:
    external: true

Then run:

docker-compose up -d

NOTE
  • Make sure your docker-compose version supports the platform key (v3.3+).
  • Always restart your container if you reinstall or update binfmt/qemu.
🐳 Running x86_64 Docker Containers on ARM64 Architecture
https://www.itsnooblk.com/posts/run-x86_64-docker-on-arm64-vps/
Author
Lahiru Sandaruwan Liyanage
Published at
2025-05-23
License
MIT License