The fastest way to identify a Moodle site’s version is to sign in as an administrator and open Site administration > Notifications. That page displays the Moodle release and build information. If you need the exact code-level value, open the installation’s version.php file in a text editor, or read $CFG->version and $CFG->release from Moodle code.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
Choose the method that matches your access
Moodle offers several ways to identify a running version. The right choice depends mainly on whether you have administrator, filesystem, shell, Git, or only ordinary teaching access.
As an Amazon Associate I earn from qualifying purchases.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →| Method | Access required | Precision | Effort | Works best for |
|---|---|---|---|---|
| Site administration > Notifications | Moodle administrator | Release and build information shown by the site | Low | Web-managed installations and routine checks |
version.php |
Filesystem access to the Moodle code directory | Exact code-level version values | Low to moderate | Confirming the code installed on a server |
$CFG->version and $CFG->release |
Ability to run or add Moodle PHP code | The values exposed by Moodle’s global configuration | Moderate | Diagnostic pages, support scripts, and compatibility checks |
| Git history | Shell access to a Git checkout | Commit associated with the version file | Moderate | Source-controlled Moodle deployments |
| Moodle Docs for this page | Usually a teacher account; administrator-enabled link | Usually a branch clue, not an exact patch/build | Low | Sites where you cannot access administration or files |
Check the version in the administrator interface
For most site owners, the administration page is the quickest and safest option. MoodleDocs describes this location directly: “The version of Moodle which your site is using can be found if you log in as an administrator and go to Site administration > Notifications.”
- Sign in with an account that has Moodle administrator access.
- Open Site administration.
- Select Notifications.
- Read the Moodle version and build information displayed on the page.
This route does not require shell access, a database query, or access to the server’s code directory. It reports what the site itself identifies as its installed Moodle version, making it the appropriate first check when you are preparing support information or confirming an upgrade.
#1 Best Overall
Find the exact code version in version.php
When the Notifications page is unavailable—or when you need to verify the files deployed on the server—inspect Moodle’s version.php in a text editor. MoodleDocs identifies moodle/version.php as the source for the exact Moodle code version.
What to look for
The file defines two important values:
$versionis the machine-oriented Moodle code version.$releaseis the human-friendly release value, commonly containing a release and build string.
Together, these variables describe the core Moodle code installed in that directory. If you are documenting a server, record both values rather than copying only a shortened branch number.
Recommended Free Tools
How to inspect it safely
- Locate the Moodle code directory on the server.
- Find its
version.phpfile. - Open the file in a text editor or an equivalent server-side file viewer.
- Read the definitions of
$versionand$release. - Close the file without saving changes.
Do not edit the file merely to read it. MoodleDocs also cautions that version.php is not meant to be viewed as ordinary browser content; use a text editor instead. The file you inspect must belong to the active Moodle code directory. Looking at an old backup, an unused release directory, or a different checkout can give you a technically valid version that is not the one serving the site.
Read the version from Moodle code
Developers and administrators who maintain internal diagnostics can obtain the same information programmatically. Moodle copies the version information into the global configuration object, where custom Moodle code can read:
Rank #2
$CFG->version
$CFG->release
What each value represents
$CFG->versionexposes the machine-oriented code version.$CFG->releaseexposes the human-readable release value.
This is useful for a support page that reports environment details, a compatibility check that branches on Moodle’s release, or a script that collects diagnostic information from several installations. Keep the output restricted to trusted administrators or support personnel if the page reveals more configuration data than ordinary users should see.
Reading these globals reports the values loaded by Moodle. It does not replace checking the active deployment path: custom code must run inside the Moodle installation you intend to diagnose.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCheck a Git-managed Moodle installation
A Git checkout provides another way to identify the code revision associated with Moodle’s version file. First inspect the current branch:
git branch
The command shows which branch the checkout is using. To inspect the latest commit affecting the version file, use the path that matches the Moodle layout.
Rank #3
- Used Book in Good Condition
Moodle 5.1 and later
git log --oneline -1 public/version.php
Moodle 5.0 and earlier
git log --oneline -1 version.php
The distinction is important because newer Moodle layouts place the public version file under public/, while Moodle 5.0 and earlier use version.php at the earlier path. Run the command from the Git checkout that supplies the live site’s code. A different checkout, branch, or deployment copy can produce a commit that does not correspond to the running site.
The resulting one-line log entry identifies the latest commit recorded for that file. Use it alongside the release information from the file or Notifications page when support staff need both the human-readable release and the source-control context.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Check Moodle’s branch without administrator access
If you are a teacher or another ordinary user, you may be able to use the Moodle Docs for this page link at the bottom of a Moodle page. This shortcut works only when the administrator has enabled the link, and MoodleDocs documents it for English or German sites.
- Open a Moodle page while signed in with your available account.
- Scroll to the bottom and select Moodle Docs for this page, if the link is present.
- Examine the documentation URL that opens.
- Look for the branch number represented in that URL.
MoodleDocs gives URL-number examples corresponding to Moodle 2.7 and Moodle 3.2. Treat that number as a branch clue, not as proof of the exact patch or build currently installed. The link’s availability depends on administrator settings and the documented language conditions, so its absence does not indicate a problem with your account.
Rank #4
When an exact version is needed—for example, for a plugin compatibility decision or a security-support check—ask an administrator to confirm the value on Site administration > Notifications or have an authorized server operator inspect version.php.
How to interpret the values you find
Branch versus release and build
A branch number identifies a line of Moodle development, but it may not identify the precise patch level. The Notifications page and the $release value provide the release and build wording shown by that installation. The $version value is intended for machine comparisons and may not look like the release label a person would quote.
Why two checks can appear different
Different methods expose different representations of the same code. A documentation URL may reveal only a branch. The Git command reports a commit associated with the version file. The PHP variables expose Moodle’s internal numeric and human-readable values. Compare the method’s purpose before treating a formatting difference as a mismatch.
Use the active code, not a nearby copy
Servers often contain backups, staging directories, or more than one Moodle checkout. The meaningful result is the version belonging to the code that the live site loads. For a web check, use the live site’s Notifications page. For a file or Git check, work in the deployment directory that serves that site.
Best Value
Troubleshoot a missing or confusing version result
You cannot see Notifications
The Notifications route requires administrator access. If the menu or page is not available, use version.php only if you are authorized to access the server, or ask an administrator to report the version. A teacher-level account cannot infer an exact build from a missing administration menu.
The Moodle Docs link is absent
The link is optional and controlled by the administrator. Its absence is expected on sites where the setting is disabled, and the documented shortcut also depends on the site language. Request an administrator check instead of assuming the site’s branch from another installation.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteOpening version.php in a browser does not work
That file is not intended to be read as an ordinary browser page. Retrieve it through an authorized server file tool or open it in a text editor. Do not make edits while inspecting it.
The Git command reports no file
Check the Moodle version layout before choosing the path. For Moodle 5.1 and later, use public/version.php; for Moodle 5.0 and earlier, use version.php. Also confirm that you are inside the correct Git checkout and on the branch used by the deployment.
The file and the live page disagree
First verify that the file belongs to the live code directory. A staging checkout, backup, or partially completed deployment can have a different version. The live Notifications page identifies what the running site reports; the file and Git history identify the code you inspected. Investigate the deployment path before recording either result as the site’s final version.
Which result should you document?
For a normal support ticket, record the exact wording shown in Site administration > Notifications, including the build information. If you are auditing server files, record both $version and $release from version.php. For a Git-managed installation, add the branch from git branch and the one-line commit output from the version-file command. If you only have teacher access, label the Moodle Docs URL number as a branch clue and state that it is not an exact patch/build confirmation.
Quick Recap
Quick decision guide
- Administrator access: use Site administration > Notifications.
- Filesystem access but no administrator login: read
version.phpin a text editor. - Building a diagnostic tool: read
$CFG->versionand$CFG->release. - Git checkout: run
git branch, then use the version-file path appropriate to Moodle 5.1+ or 5.0 and earlier. - No administrator or server access: try Moodle Docs for this page, but report only the branch clue unless an administrator confirms the exact release and build.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




