To check server architecture in CentOS, run uname -m for the CPU/kernel architecture (for example, x86_64 or aarch64). Add uname -r for the kernel release, getconf LONG_BIT for whether the userspace is 32- or 64-bit, and rpm -q centos-release or /etc/os-release for the CentOS version. On a 64-bit kernel, you can also check whether the server can run 32-bit binaries by looking for the lm flag in /proc/cpuinfo.
Those four or five commands cover nearly every practical reason someone asks this question. "Architecture" is doing a lot of work in that sentence, though. It can mean the processor family, the kernel build, the bit width of the installed userland, or the hardware model underneath a virtual machine. This guide goes in the order that resolves ambiguity fastest, flags the CentOS versions where commands differ, and explains what each result does and does not tell you about the server.
What "server architecture" actually means on CentOS
In day-to-day Linux administration, architecture is a three-layer stack, and each layer answers a different question:
CPU architecture is the instruction set the hardware executes: x86_64, aarch64, ppc64le, s390x, and so on. This is what package filenames encode, as in kernel-3.10.0-1160.x86_64.rpm. Kernel architecture is the build the running kernel reports, typically identical to the CPU architecture but not always—you can run a 64-bit kernel with a mixed or 32-bit userland. Userland bit width is whether the installed libraries and binaries are 32-bit or 64-bit. A 64-bit kernel does not guarantee that every process on the box is 64-bit.
There is a fourth layer that is often the real question: host versus guest. If the CentOS server is a virtual machine, its reported architecture is its virtual CPU type, which may not match the physical hypervisor host. And if someone asks "is this server x86 or ARM," they usually need the answer for one of three downstream decisions: which package to download, whether a vendor binary will run, or whether a container image tag is compatible. Name the decision first and you'll know which command matters.
Prerequisites: know the version and the access level you have
No special tools are required for the commands in this article. The core utilities (uname, getconf), the /proc filesystem, and RPM's query interface ship with every mainstream CentOS install.
You do need a shell, which means SSH access or console access. Most of the checks work as an unprivileged user; a few useful ones, particularly dmidecode and reading some /sys entries, require root or sudo.
Know your release line before you start, because CentOS split after version 8. CentOS Linux 7 reached end of life on June 30, 2024, and CentOS Linux 8 reached end of life on December 31, 2021. CentOS Stream 8 ended updates in May 2024, and CentOS Stream 9 and now Stream 10 are the continuing lines. The architecture commands below work across all of them, but the version check in the next section will tell you which stream you're on, and that changes where you get future updates rather than how you read the hardware.
A quick sanity check that you're on the right host and the shell is working: uname -m should return a short architecture string instantly. If you instead see -bash: uname: command not found, something is wrong with the environment, not the architecture.
Step 1: Get the CPU architecture with uname
This is the first command to run on any unfamiliar box:
Expected results and what they mean:
x86_64 — 64-bit AMD/Intel. The overwhelming majority of CentOS servers. aarch64 — 64-bit ARM, increasingly common on cloud instances and ARM server boards. i686 or i386 — 32-bit x86. You'll almost never see this on a modern CentOS server, but old installs exist. ppc64le — 64-bit little-endian Power, seen on IBM hardware. s390x — IBM Z mainframes.
If you need the kernel's full idea of the machine, uname -a prints everything in one line: kernel name, hostname, kernel release, build date, architecture, and OS. That single line answers the most common architecture questions at once, which is why it's the one-liner many admins memorize.
Check for success: the output is one of the known architecture strings and does not contain "unknown." Common failure: if the output looks truncated or garbled, suspect a broken PATH or a shell function shadowing uname — run type uname and, if needed, the absolute path /usr/bin/uname -m.
Step 2: Read kernel and machine details
uname has switches that split the information apart, and on CentOS 7 and later each one is worth knowing:
A note on -p and -i: on many x86_64 systems these report unknown because the kernel doesn't populate them meaningfully. That is normal, not a broken server. The kernel release string from uname -r is more useful: the trailing x86_64 or aarch64 confirms the kernel's build architecture, and the .el7 or .el9 suffix tells you the enterprise Linux major release the kernel was built for.
For the underlying hardware when it's physical, dmidecode reads the SMBIOS tables:
The first shows manufacturer and product name (for example, a Dell PowerEdge model); the second shows CPU family, model, and supported instruction features. This is the closest you get to "what machine is this really," and it's exactly where virtual machines give themselves away—QEMU/KVM guests typically report a vendor like "QEMU" or a generic model name, and VMware guests show VMware strings. On cloud instances, expect the hypervisor's branding instead of a physical server model.
Step 3: Confirm the bit width of the userland
The kernel architecture and the userland architecture can differ. To test the userspace directly:
64 means the C library and the process running getconf are 64-bit; 32 means 32-bit. Cross-check with:
Expected output includes ELF 64-bit LSB executable, x86-64 (or ARM aarch64) for a 64-bit build, or ELF 32-bit for a 32-bit one. The file utility is part of the base install; if it's missing, sudo yum install file on CentOS 7 or sudo dnf install file on Stream resolves it.
On a 64-bit kernel, you can also ask whether the machine is capable of running 32-bit binaries at all:
If lm (long mode) appears, the CPU supports 64-bit execution, and most x86_64 kernels retain the ability to run 32-bit code if the 32-bit libraries are installed. On ARM, the equivalent check is whether the kernel was built with 32-bit compatibility, which shows up in the kernel config rather than /proc/cpuinfo. This distinction matters when a legacy vendor agent is a 32-bit-only binary and someone wants to know if it can run on a 64-bit CentOS host.
Step 4: Identify the CentOS version and release line
Architecture questions often arrive bundled with version questions—"is this CentOS 7 x86_64?"—so confirm the OS identity explicitly:
Expected output on a CentOS 7 box is something like CentOS Linux release 7.9.2009 (Core); on Stream 9 it reads CentOS Stream release 9. The rpm -q form is handy in scripts because it returns a clean package name and version, and a nonzero exit status if the package isn't present—which itself is a signal you may be on a derivative distribution such as Rocky Linux, AlmaLinux, or Oracle Linux that looks similar but identifies differently.
A compatibility trap worth knowing: CentOS 7 installs may report x86_64 even when the hardware is 64-bit, which is expected. But when you download packages or ISOs, the architecture tag in the filename must match the machine architecture from Step 1, not the kernel's build string casually read. Mixing aarch64 packages onto an x86_64 host produces "wrong ELF class" errors at install or run time, and the fix is a correctly tagged download, not a workaround.
Step 5: Match the kernel architecture to what packages expect
Once you know the architecture, the practical follow-through is checking that the package manager agrees with you:
This prints the installed kernel package with its architecture suffix—.x86_64 or .aarch64—confirming what the system considers native. For the whole installed package set grouped by architecture:
A healthy 64-bit CentOS host shows a large x86_64 or aarch64 count, plus noarch for architecture-independent packages like documentation and Perl modules. A meaningful count of i686 packages on an x86_64 host means 32-bit compatibility libraries are installed—usually intentional, sometimes leftover. If you see i386 or i686 binaries that you didn't expect, that's worth a look in rpm -qa --qf '%{NAME} %{ARCH}\n' | grep -v noarch | grep -v x86_64.
Check for success: the kernel package architecture from this step matches uname -m from Step 1. If it doesn't, you're likely looking at a container or chroot with a foreign base image—another reason to confirm host versus guest before drawing conclusions.
Special cases: containers, VMs, and cross-architecture hosts
Containers are the most common source of confusing architecture reports. Inside a container image, uname -m reports the host kernel's architecture, because containers share the kernel—but the image's userland may be a different architecture if it was built for one and run under emulation (for example, an ARM image on x86 through QEMU). In that case uname -m says x86_64 while file /bin/sh says ELF 64-bit ... ARM aarch64. The image's architecture is the one that matters for installing packages inside it, and you check it by inspecting the image manifest before running it, or by running rpm -qa --qf '%{ARCH}\n' | sort | uniq -c inside the container.
On a virtual machine, the CPU model is virtual. dmidecode shows the hypervisor vendor, /proc/cpuinfo shows a model name the hypervisor chose to expose, and the flags shown are the virtual CPU's flags, which may be a subset of the physical host's. VMware, KVM, Xen, and Hyper-V all vary in how much they expose. If you need to know what the host physically is, you generally can't get that from inside the guest without hypervisor cooperation—and that's a sensible place to stop, since the guest's contract is with its virtual hardware.
Cross-architecture matters for migration planning. If uname -m says aarch64, any prebuilt x86_64 binaries, Docker images, or proprietary documents-to-PDF converters that ship only x86 builds will need ARM-compatible replacements. The same logic runs in reverse for moving workloads from ARM back to x86. Checking architecture early, before provisioning, saves a class of "works on my laptop, fails on the target host" incidents.
How to tell if a server is 32-bit or 64-bit: the short version
This is such a common sub-question that it deserves its own decision path, and it's short enough to check without guessing:
1: Run uname -m. If it returns x86_64 or aarch64, the kernel is 64-bit. 2: Run getconf LONG_BIT. If 64, the userland you're in is 64-bit; if 32, it's 32-bit even though the kernel may be 64-bit. 3: Run file /bin/bash to see the bit width of an actual installed binary.
If all three agree, you have a definitive answer. If step 1 says 64-bit and step 2 says 32-bit, you're on a 64-bit kernel with a 32-bit userland—rare on CentOS, but a legitimate configuration where some old applications live. The rule of thumb: the answer to "can this server run a 64-bit program" comes from the kernel and CPU; the answer to "will this specific installed program run" comes from file on that program. They usually agree, and when they don't, the discrepancy is the interesting part.
If you're checking remotely over SSH and want to be sure you're not looking at the wrong machine, the hostname from uname -n and the kernel string from uname -r together identify the box; a mismatched hostname between what you expected and what you see is the classic sign you've landed on a different host than intended.
Reading results without misinterpreting them
Three misreads account for most confusion about architecture on CentOS:
"uname -m says i686, so the server is 32-bit." On a 64-bit CentOS install this shouldn't happen at the kernel level; if it does, you've almost certainly landed in a 32-bit chroot or container rather than a native 32-bit server. Check uname -r and file /bin/bash inside the same environment. "The kernel is 64-bit, so all my software is 64-bit." Not necessarily. 32-bit compatibility libraries and 32-bit-only applications coexist routinely with a 64-bit kernel, and rpm -qa --qf '%{ARCH}\n' reveals them. "The VM says QEMU, so the server is a QEMU physical machine." Virtual CPU vendors will mislead you if you let them. If the question is "is this bare metal or virtual," dmidecode -t system usually settles it, and the answer changes how you interpret further hardware detail.
One more limit: lscpu is a convenient summarizer on CentOS 7 and later, printing architecture, CPU op-modes, byte order, and virtualization type in one screen:
It's a good confirmation but not the source of truth—it reads the same /proc and /sys data the individual commands read. When lscpu and a direct check disagree, trust the direct check and investigate why the summary differs.
If the basics come back wrong: a short troubleshooting order
When the output looks off, work in this order, because each step is reversible and none requires a reboot:
1: Confirm you're on the intended host: compare uname -n with the expected hostname. 2: Confirm the shell and tools are sane: type uname, which getconf, echo $PATH. 3: Rule out a container or chroot: compare ls -di / and ls -di /proc, and check /proc/1/cgroup for container hints. 4: Re-run the architecture checks with absolute paths: /usr/bin/uname -m, /usr/bin/getconf LONG_BIT. 5: Check for a broken dynamic linker or missing libraries if file or getconf fail: ldd --version and /lib64/ld-linux-x86-64.so.2 --list on x86_64.
Stop here for anything that suggests a corrupted system or a host/guest mismatch you can't resolve from inside the guest—reinstalling packages or editing linker configuration to "fix" a symptom you don't understand can break the system further. That's a job for whoever administers the hypervisor or platform, not a next step for a troubleshooting article.
A quick worked example of the whole sequence on a typical CentOS Stream 9 cloud VM: uname -m returns x86_64; getconf LONG_BIT returns 64; file /bin/bash shows an x86-64 ELF; cat /etc/os-release shows Stream 9; rpm -q centos-release returns the Stream package; and dmidecode -t system shows a hypervisor vendor rather than a physical model. Five commands, under a minute, and you have the architecture answer for every downstream decision—package selection, image compatibility, and migration planning. If the server runs on ARM instead, only the architecture strings change, which is the point: the procedure is architecture-independent even when its output isn't.