You're about to install something, or a support engineer just asked which OS your server runs, and you need the answer now. This is how to check Linux version details in about 10 seconds over SSH, plus which of the numbers you'll see actually matters for the job in front of you.
Quick Answer: Run
cat /etc/os-releaseto see your distribution and release (for example, Ubuntu 26.04 LTS), then rununame -rto see the kernel that's running right now (for example, 7.0.0-30-generic). Neither needs root, and both work on every mainstream distro. Adduname -mfor the CPU architecture. As of October 2026, those three lines answer nearly every installer and support question.
Last verified: October 2026, against Ubuntu 26.04 LTS (kernel 7.0) and the systemd os-release specification.
Our engineers ask for exactly this output on a big share of the tickets that land in our queue every day, so what follows is the same walkthrough we'd give you on a ticket, written so you can do it yourself.
Distro Version vs Kernel Version: Two Different Numbers
A Linux server reports two versions, and they answer different questions. The distribution version (Ubuntu 26.04, Debian 13, AlmaLinux 9) decides your packages, your repositories and how long you'll keep getting security updates. The kernel version (7.0, 6.12, 6.8) is the core that talks to the CPU, the disks and the network.
In the 20 to 30 client issues Hostaccent's engineers resolve each day, mixing these two up is a mistake we see regularly. A tutorial that says "requires Ubuntu 22.04 or newer" wants the distro. A VPN module, a container runtime feature or a monitoring agent that says "kernel 5.10+" wants the kernel. Same server, two separate checks.
The distro number also tells you how much runway you have left. Ubuntu 26.04 LTS, released in April 2026, shipped with Linux kernel 7.0 and gets standard security updates for 5 years, until 2031, according to Ubuntu's release cycle page. Interim releases get only 9 months. If a production server reports a non-LTS version, put an upgrade on the calendar now rather than discovering it when updates stop.
Still choosing which distro to run in the first place? Our comparison of the best Linux distro for VPS hosting covers that decision. This guide is only about identifying what's already installed.
How to Check Linux Version From the Command Line
Five commands cover every mainstream distro. Start with the first one; the rest are fallbacks or extra detail.
1. Read /etc/os-release (works almost everywhere)
bashcat /etc/os-release
Example output on a fresh Ubuntu 26.04 server:
bashPRETTY_NAME="Ubuntu 26.04 LTS" NAME="Ubuntu" VERSION_ID="26.04" VERSION="26.04 LTS (Resolute Raccoon)" VERSION_CODENAME=resolute ID=ubuntu ID_LIKE=debian
Running cat /etc/os-release is the most reliable way to identify a Linux distribution in 2026, because the file follows the systemd os-release specification and ships on Ubuntu, Debian, AlmaLinux, Rocky, Fedora and Arch alike. Humans read PRETTY_NAME. Scripts should read ID and VERSION_ID, using ID_LIKE as the fallback for derivative distros.
If /etc/os-release is missing (rare, but it happens on stripped-down images), the spec says to fall back to /usr/lib/os-release, which is usually the file it points to anyway.
Pro Tip: In scripts, source the file instead of parsing it with grep:
. /etc/os-release && echo "$ID $VERSION_ID". You get clean values likeubuntu 26.04with no quotes to strip, and the same line works on Debian and AlmaLinux.
2. hostnamectl (systemd systems)
hostnamectl prints the operating system, kernel and architecture in one block, and on most virtual servers it adds a Virtualization: line (kvm, lxc, openvz) that turns out to be surprisingly useful, as you'll see below. It needs systemd running, so some minimal containers return an error instead. It's also the tool you'd use to change a hostname in Linux without breaking sudo.
3. The lsb_release -a command
On Ubuntu, lsb_release -a prints Distributor ID, Description, Release and Codename. On minimal Debian and AlmaLinux images it often returns command not found, because the lsb-release package isn't installed by default. In our experience, it's the first command people try and the first to fail on a fresh VPS. Don't install a package just to read a version: /etc/os-release already holds the same data.
4. uname -r kernel version (and uname -m)
bashuname -r # running kernel, e.g. 7.0.0-30-generic uname -m # architecture, e.g. x86_64 or aarch64 uname -a # everything on one line
uname -r reports the release of the kernel currently loaded in memory, and the uname manual page lists the other flags. cat /proc/version gives the same kernel plus the compiler that built it. Don't skip uname -m: an ARM (aarch64) server needs different binaries from an Intel or AMD (x86_64) one, and grabbing the wrong download is a classic 2-minute mistake that turns into a 2-hour one.
Check Ubuntu version over SSH without opening a shell
You can query a remote box straight from your laptop:
bashssh user@your-server 'grep PRETTY_NAME /etc/os-release; uname -r'
If you've moved SSH off port 22, add -p and your port number (here's how to change the SSH port without locking yourself out if you haven't yet). It's the quickest way to check Ubuntu version over SSH across several servers in a row.
Legacy release files you'll still meet
| Distro family | File | What to watch for |
|---|---|---|
| Debian / Ubuntu | /etc/debian_version | On Ubuntu it shows a Debian codename ending in /sid, not your Ubuntu release |
| RHEL / AlmaLinux / Rocky | /etc/redhat-release | Accurate, but a single line with no machine-readable fields |
| Older Ubuntu | /etc/lsb-release | Still present, but os-release supersedes it |
| Any distro | /etc/issue | A login banner that admins and panels often edit |
Still working through this server issue?
Send the symptoms, error output, and what you have already tried. We can work with Hostaccent services or infrastructure hosted with another provider.
When the Output Lies: Containers, Pending Reboots and Edited Banners
The commands above are correct, but three situations make them return a misleading answer. Knowing them saves you from chasing a problem that isn't really there.
Why does uname show an old kernel after I just updated?
After a kernel update, uname -r keeps reporting the old kernel until the server reboots, because it reads the kernel running in memory, not the newest one on disk. On Ubuntu and Debian, the file /var/run/reboot-required appears when a reboot is pending. On AlmaLinux and Rocky, dnf needs-restarting -r tells you directly whether one is needed.
You can also compare against what's installed with ls /lib/modules. If the newest folder there is higher than your uname -r output, the security fixes in that kernel aren't protecting you yet. To see how far your series sits behind upstream, the Linux Kernel Archives at kernel.org list the current stable and longterm releases. If tracking reboots across several servers sounds like a chore, that's exactly the work fully managed VPS hosting takes off your plate.
Container VPS plans report the host's kernel
On container-based virtualization such as LXC or OpenVZ, every guest shares the host machine's kernel. uname -r shows that shared kernel, which you can't upgrade yourself, while /etc/os-release still shows your container's own distro. Run systemd-detect-virt to find out: kvm means a full virtual machine with its own kernel, while lxc or openvz means a shared one.
Insider Insight: Hostaccent VPS plans run on KVM, so
uname -rthere reports your own kernel, one you can update, reboot into and load modules for. When software insists on a kernel feature that a container simply can't provide, that single output line is usually the whole explanation.
/etc/issue is a banner, not a source of truth
/etc/issue is the text printed before a console login. Admins customise it and some control panels rewrite it, so never base a script decision on what it says.
The 3-Line Server ID: What Your Host or Tutorial Actually Needs
Most people asking for "your Linux version" need one of three facts, and the quickest way to hand over all three is a habit we call the 3-Line Server ID:
bashgrep PRETTY_NAME /etc/os-release uname -r uname -m
The 3-Line Server ID is a three-command snapshot (distro, running kernel, architecture) that takes under 10 seconds to run and answers the first question on almost any install guide, driver download or support ticket. Paste all three lines unedited, and nobody has to come back to you with a follow-up question.
Across the 4,000+ sites Hostaccent has migrated since 2016, our team starts every source-server review with this same snapshot. The distro decides package names and config paths on the new machine, and the kernel reveals which features the old setup was quietly relying on.
Who needs which line:
- Installers and tutorials want the distro and architecture.
- Drivers, VPNs and eBPF-based monitoring tools want the kernel.
- Support tickets want all three, plus
systemd-detect-virtif you're on a VPS.
A couple of mistakes come up again and again. People quote their PHP version as the OS version, but the two are unrelated: php -v is a separate check, and so is checking the PHP error log when a site breaks. Others run these commands with sudo out of habit. That isn't needed. Any limited account, like the one you'd create when you add a user in Linux with the right permissions, can read every file above.
Pro Tip: Before following any tutorial, compare the release it was written for with your
VERSION_ID. A guide written for Ubuntu 20.04 can reference package names and config paths that changed two LTS releases later, and the error you'll get rarely says "wrong version."
Your Next Step: A Server Where the Kernel Is Yours
Now that you know how to check Linux version details, and why a pending reboot or a shared container kernel can mislead you, the next question is what you run them on. You could keep juggling container limits, or start on a VPS where the kernel shown is genuinely yours to update. The Standard plan at $12.00/mo, renewing at the same $12.00/mo, gives you a KVM server with full root access, free 30 Gbps DDoS protection and 24/7 support from Hostaccent's in-house engineers, backed by a 30-day money-back guarantee. One honest caveat: no control panel licence is included, so budget separately if you want cPanel or Plesk. When you're ready, start on the Standard plan.
Frequently Asked Questions
How to check Linux version without root access?
You don't need root at all. cat /etc/os-release, uname -r, hostnamectl and lsb_release -a all read world-readable files or kernel data, so any normal user can run them, including a restricted SSH account or a shared hosting shell. The only related check that may ask for sudo is dnf needs-restarting -r on some RHEL-family systems. If a command fails without root, the cause is almost always a missing package rather than permissions.
What is the difference between lsb_release and /etc/os-release?
Both report your distribution name and release, but they come from different places. /etc/os-release is a plain text file defined by the systemd project and present by default on virtually every modern distro. lsb_release is a separate command from the Linux Standard Base tools, preinstalled on Ubuntu but often missing from minimal Debian, AlmaLinux and Rocky images. For scripts and automation, read os-release, and treat lsb_release as a convenience when it happens to be there.
How do I check the kernel version on Ubuntu?
Run uname -r. On Ubuntu 26.04 LTS you'll see a string shaped like 7.0.0-30-generic, where 7.0 is the upstream kernel series, 30 is Ubuntu's build number and generic is the kernel flavour. To list installed kernels rather than the running one, use dpkg --list 'linux-image*'. If the newest installed version is higher than what uname -r reports, the server is waiting for a reboot before those fixes take effect.
How can I tell if my VPS is KVM or a container?
Run systemd-detect-virt. A result of kvm means a full virtual machine with its own kernel that you can update and reboot into. A result of lxc or openvz means a container sharing the host's kernel, so uname -r shows a kernel you can't change. hostnamectl gives the same answer on its Virtualization line. This matters when software needs specific kernel modules or features, such as VPN modules or certain Docker storage drivers.
How do I know if my Linux version is still supported?
Take the VERSION_ID value from /etc/os-release and compare it with your vendor's lifecycle page. Ubuntu LTS releases get 5 years of standard updates, while interim releases get only 9 months, and Debian, AlmaLinux and Rocky publish their own end-of-life dates. An unsupported release stops receiving security patches, which matters far more on an internet-facing server than on a laptop. If you're within a year of that date, plan the upgrade now.












Discussion
Have a question or tip about this topic? Share it below — your comment will appear after review.