Skip to main content

Joomla File Structure Explained: What Every Folder Does

13 August 2026

Open a Joomla installation in a file manager and you see about twenty folders with short, similar names: components, modules, media, images, libraries, includes. Which ones hold your content? Which ones does an update overwrite? Where may you put things, and where must you never touch anything? Most Joomla problems that involve "a file in the wrong place" trace back to not knowing this map.

This article explains Joomla's file and folder structure from top to bottom. It covers what every folder is for and which ones are yours for site owners, the practical what-goes-where decisions for administrators, and the path constants, bootstrap flow, and autoloading for developers. It connects to the Focus On articles on templates, overrides, security hardening, and troubleshooting - many of their rules become obvious once you can read the map they operate on.

Joomla's folder tree is not clutter. It is a contract: every folder has one job, and knowing the jobs makes the whole system predictable.

The goal is simple: help you look at any path in a Joomla installation and know what it is, whose it is, and whether it belongs there.

1. The Basics

1.1 The Root at a Glance

A standard Joomla 6 installation has this root (your uploads and a possible logs relocation aside, nothing else should be there):

administrator/    the backend application
api/              the Web Services application
cache/            generated page/system cache
cli/              the command-line entry point
components/       frontend components (the page builders)
files/            YOUR uploaded documents (Media Manager files area)
images/           YOUR uploaded media
includes/         bootstrap files for the frontend
language/         frontend language files
layouts/          shared render layouts (JLayout)
libraries/        the Joomla framework + vendor packages
media/            extension assets: css, js, fonts
modules/          frontend modules
plugins/          all plugins, grouped by type
templates/        frontend templates
tmp/              scratch space for installs and uploads

configuration.php your settings + credentials
index.php         the frontend entry point
htaccess.txt      Apache rules (rename to .htaccess)
web.config.txt    the IIS equivalent
robots.txt        crawler instructions
LICENSE.txt, README.txt   documentation

1.2 Three Kinds of Things

KindFoldersWho writes here
Entry points index.php, administrator/, api/, cli/, includes/ Joomla only.
Code components/, modules/, plugins/, templates/, libraries/, layouts/, media/, language/ Joomla and extension installers - never you, with one exception: your template's html/ folder.
Data images/, files/, cache/, tmp/, administrator/logs/, configuration.php You and Joomla at runtime. This is the part that must be in every backup.

1.3 The One Rule Behind Every Other Rule

Updates replace code; they never touch data folders or your template overrides. That single fact explains the advice repeated across this whole article series: customisations go in overrides and user.css (survive updates), uploads go in images/ (survive updates), and edits inside code folders evaporate at the next release.

Back to top

2. The Entry Points: Four Doors, One House

2.1 Four Applications

Joomla is one codebase running four applications, each with its own front door:

Entry pointApplication
index.php The website your visitors see.
administrator/index.php The backend.
api/index.php The Web Services API (REST).
cli/joomla.php The command line - no web server involved.

This is why, in the authentication article, site login and API login are separate permissions, and why the troubleshooting article's CLI rescue kit works while the website is down: different doors into the same house.

2.2 The includes/ Folder

The frontend's includes/ holds three small bootstrap files: defines.php (the path constants from section 9), framework.php (loads the framework), and app.php (starts the application). index.php is just a few lines that pull these in - the entry points are thin doors, not the house.

Back to top

3. The Extension Folders

3.1 One Extension, Many Homes

An extension is not one folder - its pieces live where their function dictates. Take com_content, the article system:

components/com_content/                 frontend code + layouts
administrator/components/com_content/   backend code, forms, access.xml
media/com_content/                      its css/js assets
language/en-GB/com_content.ini          frontend language strings
administrator/language/en-GB/...        backend language strings
api/components/com_content/             its API endpoints

Modules follow the same split (modules/ and administrator/modules/), templates too (templates/ and administrator/templates/). Plugins are the exception: all plugins live in one place, plugins/{group}/{name}/, grouped by their type - system, content, authentication, task, and the other groups you have met across this series.

Inside each of those homes, a modern extension follows one internal pattern:

src/                    namespaced PHP classes (the autoload map's target)
tmpl/                   the layouts - overridable, per the overrides article
services/provider.php   registers the extension's services (DI wiring)
forms/                  XML form definitions for edit screens

And how does the installer know which folders an extension writes to? Every extension ships a manifest XML (the templateDetails.xml from the Cassiopeia article is one) that declares its files, folders, language files, and media - the installer reads it on install, update, and uninstall. Beware of old tutorials here: pre-Joomla 4 extensions used helper.php files and assets inside their own folders; the src/-plus-services/ pattern is the current one.

3.2 layouts/: the Shared Ones

The root layouts/ folder holds render layouts shared by everything - pagination, custom fields, form fields. The overrides article covers how LayoutHelper finds them and how your template can override each one.

3.3 language/ and Overrides

Language files install into language/{tag}/ per client. Your own text changes do not belong in those files (updates replace them) but in language overrides, managed in the backend and stored under language/overrides/ - the same survive-the-update pattern as template overrides.

Back to top

4. media/ versus images/: the Distinction That Matters Most

4.1 Two Folders, Two Owners

The most consequential confusion in the whole tree:

FolderContainsOwner
images/ Your uploads: photos, PDFs, logos. What the Media Manager shows. You. Updates never touch it.
media/ Extension assets: the css, js, fonts, and icons that extensions and templates ship. Installers. Updates replace its contents per extension.

Upload a client's brochure into media/ and it may vanish with the next update of whatever folder it landed in. Put custom CSS loose in images/ and it works - but no asset management, no versioning, and puzzled successors. Each folder does its own job well and the other's job badly.

images/ has a sibling: files/, the Media Manager's separate area for non-image uploads (documents, downloads), configurable via the file_path option in the Media settings. The same ownership rule applies: it is yours, updates never touch it, and it belongs in every backup.

4.2 The Exceptions That Prove the Rule

Two locations in media/ are yours, by design: media/templates/site/{template}/css/user.css and js/user.js (the update-proof custom files from the Cassiopeia article), and the media folder of your own child template. They are yours precisely because no installer ever writes there.

4.3 Sorry, Wrong Number

Since Joomla 4.1 template assets live under media/templates/ rather than inside templates/{name}/. The templates/ folder keeps the PHP side - index.php, overrides in html/, the manifest - while the browser-facing files live in media/. When a tutorial tells you to edit templates/cassiopeia/css/, it is describing Joomla 3.

Back to top

5. The Data Folders

5.1 What Runtime Writes

  • cache/ and administrator/cache/: generated cache. Safe to empty (System → Clear Cache), never delete the folders themselves. One special file lives here: administrator/cache/autoload_psr4.php, the class map from the troubleshooting article.
  • tmp/: scratch space for extension installs and uploads. Empty it freely; a wrong tmp_path is the classic install failure.
  • administrator/logs/: Joomla's log files - update logs, the failed-login log, everything the rotatelogs task rotates.

5.2 Move Them Out (Security Article, Applied)

The paths of tmp/ and the log folder are configurable in the Global Configuration precisely so you can move them outside the web root, and the security hardening article recommends exactly that. The public-folder layout in section 9.3 takes the same idea to its conclusion.

5.3 configuration.php

One file is the site's identity: database credentials, the $secret key, every Global Configuration value. It sits in the root, it is in every backup, it never goes in version control or a support ticket, and the security article's advice to make it read-only (444) applies. If configuration.php plus images/ plus the database survive, your site survives.

Back to top

6. administrator/ and api/: the Mirrors

6.1 The Backend is a Second Joomla

administrator/ mirrors the root's shape: its own components/, modules/, templates/ (Atum lives here), language/, includes/, and cache/. Two folders exist only here: manifests/, the XML manifests of core packages and libraries (what the extension manager reads to know what is installed), and help/ for the help screens. And logs/, as covered above.

6.2 api/ is a Thin Mirror

The api/ application is deliberately small: index.php, includes/, language/, and components/ containing only the API endpoints of components that support them. No templates, no modules - an API needs neither. The slimness is the point: the Web Services article's "raw data only" behaviour is visible right there in the folder listing.

Back to top

7. libraries/: the Framework Itself

7.1 Two Halves

  • libraries/src/: the Joomla CMS classes - every Joomla\CMS\... class you have seen in this series (Authentication, Access, LayoutHelper, Log) maps to a file here.
  • libraries/vendor/: third-party packages managed via Composer - the Joomla Framework packages, the database layer, PSR interfaces, and libraries like TUF for update verification.

7.2 Read Freely, Write Never

libraries/ is the best Joomla documentation there is - this whole article series verified its claims by reading these files. But it is also the folder where "quick fixes" do the most damage: an edit here affects everything, disappears on update, and (per the troubleshooting article) a modified core file is indistinguishable from a hack in an audit. Read daily; write never.

Back to top

8. What Goes Where: the Practical Map

8.1 "I Want To…"

I want to…It goes in…
Upload photos and documents images/, via the Media Manager.
Add custom CSS or JS media/templates/site/{child}/css/user.css - the Cassiopeia article's way.
Change extension markup templates/{child}/html/ - the overrides article's way.
Change interface text Language overrides in the backend (language/overrides/).
Add functionality An installed extension - never loose files in code folders.
Store backups Not in the tree at all. Outside the web root, off the server (backups article).

8.2 The Healthy-Root Test

A well-kept Joomla root contains exactly the items from section 1.1 - nothing more. Every extra item is worth a question: a backup.zip (security risk), a test.php (forgotten experiment or web shell), an old/ folder (a complete second site with its own outdated vulnerabilities). The quarterly file-integrity check from the maintenance article is essentially this test, automated.

Back to top

9. Under the Hood (Developer View)

9.1 The JPATH Constants

includes/defines.php names every location once, and all core code uses the names - which is why relocating folders works at all:

JPATH_ROOT           the installation root
JPATH_SITE           frontend application root
JPATH_ADMINISTRATOR  the administrator/ folder
JPATH_API            the api/ folder
JPATH_LIBRARIES      libraries/
JPATH_PLUGINS        plugins/
JPATH_THEMES         the active client's templates folder
JPATH_CACHE          the active client's cache folder
JPATH_MANIFESTS      administrator/manifests/
JPATH_PUBLIC         the web-served root (defaults to JPATH_ROOT)

In your own code, always build paths from these constants - JPATH_ROOT . '/images/...' - never from guessed relative paths.

9.2 From Namespace to File

Joomla autoloads classes by mapping namespaces to folders. The generated map in administrator/cache/autoload_psr4.php shows the pattern literally:

Joomla\CMS\...                          → libraries/src/...
Joomla\Component\Content\Site\...       → components/com_content/src/...
Joomla\Component\Content\Administrator\ → administrator/components/com_content/src/...
Joomla\Plugin\System\Debug\...          → plugins/system/debug/src/...

Read a namespace, know the file; read a path, know the namespace. This mapping is also why deleting the stale cached map fixes the troubleshooting article's "class not found" mysteries: the map said one thing, the disk another.

9.3 JPATH_PUBLIC and the Public-Folder Layout

JPATH_PUBLIC exists for the layout the security article recommends for new sites: only the entry points and web assets in the served folder, everything else - code, configuration, logs - one level above the web root, out of any URL's reach. On a classic install the constant simply equals JPATH_ROOT; the tree in this article is the classic layout.

Back to top

10. The Web Services API

The structure itself is the lesson here: api/components/ contains a folder per component that offers endpoints, and the webservices plugin group (in plugins/webservices/) registers their routes. When the API article said routes like v1/content/articles map to component code, this is the code they map to. A component without an api/components/ presence has no REST surface - checking the folder is the fastest way to know.

Nothing in the file tree is served by the API - it returns database content, not files. Files reachable over the web are served by the web server directly, which is exactly why stray files in the tree (section 8.2) are a security and SEO concern rather than an API one.

Back to top

11. SEO and Metadata

The file tree touches SEO at its edges, and the edges matter. Everything under the web root is potentially crawlable: a forgotten old/ copy of the site gets indexed as duplicate content, a stray database dump can end up in search results (it happens - and it is a data leak first, an SEO issue second), and robots.txt - sitting in the root, as covered in its own article - is your instrument for steering crawlers away from what should not be indexed.

The positive side lives in images/: descriptive folder and file names (images/products/blue-widget.webp beats images/IMG_4711.jpg) carry ranking weight for image search, and a tidy images tree keeps editors choosing the right, optimised file instead of re-uploading duplicates - the performance article's image discipline starts with folder discipline.

Back to top

12. Common Mistakes and Pitfalls

12.1 Uploads in media/, Assets in images/

Symptom: documents vanish after an extension update, or custom CSS floats unmanaged in the uploads folder.

Fix: the section 4 rule: images/ is yours, media/ belongs to installers - except user.css/user.js and your child template's media folder.

12.2 Editing Files in Code Folders

Symptom: a customisation made directly in components/, media/, or libraries/ disappears after an update.

Fix: the section 1.3 contract: updates replace code. Redo the change as an override, a user.css rule, or a proper extension.

12.3 Backups and Dumps Inside the Tree

Symptom: site-backup.zip or dump.sql in the root - downloadable by anyone who guesses the name.

Fix: backups live outside the web root, full stop. The backups and security articles both insist, and the file tree shows why: everything in the tree is potentially public.

12.4 Deleting Folders Instead of Contents

Symptom: after "cleaning up", cache or tmp errors everywhere - the folder itself is gone.

Fix: cache/ and tmp/ must exist and be writable; only their contents are disposable. Recreate the folder, set folder permissions 755, and use System → Clear Cache next time.

12.5 Unexplained Files Treated as Harmless

Symptom: a test.php or oddly named file in the root "that was probably always there".

Fix: nothing in a Joomla tree is unexplained. Compare against section 1.1 and a clean download; if you cannot account for a file, treat it as the security article's incident-response territory, not as clutter.

12.6 Hand-Editing the Wrong configuration.php

Symptom: configuration edits have no effect - on inspection, an editor saved a copy (configuration.php.bak, or one in a subfolder) instead of the real root file.

Fix: the live file is exactly JPATH_ROOT/configuration.php. Delete stray copies - they contain credentials and belong nowhere else.

Back to top

13. Best Practices

If you remember only a few things from this article, remember these:

  • Learn the three kinds: entry points and code belong to Joomla; images/, configuration.php, and the runtime folders are the site's data.
  • Uploads in images/, custom assets in your child template's user.css, markup changes in html/ overrides, text changes in language overrides.
  • Never write inside code folders - libraries/ is for reading.
  • Keep the root exactly as shipped: every extra file is a question, and backups live outside the tree entirely.
  • Move tmp/ and logs out of the web root; consider the public-folder layout for new sites.
  • Build paths from JPATH_* constants in code, and read namespaces as directions to files.
  • When in doubt whose folder it is: check whether an update or installer would write there.
Back to top

14. Quick Reference

YOURS        images/ + files/   uploads (Media Manager)
             configuration.php  settings + credentials (444, backup!)
             templates/{child}/html/          overrides
             media/templates/site/{child}/    user.css, user.js
             language/overrides/              text changes

JOOMLA'S     components/ modules/ plugins/ templates/ layouts/
             libraries/ (src = CMS classes, vendor = packages)
             media/  (extension assets - NOT uploads)
             includes/ + index.php entry points

RUNTIME      cache/ + administrator/cache/  (empty, never delete)
             tmp/                           (scratch, relocatable)
             administrator/logs/            (logs, relocatable)

MIRRORS      administrator/  full backend (+ manifests/, help/, logs/)
             api/            thin: components with REST endpoints only
             cli/joomla.php  the fourth door

ENTRY        index.php > includes/defines|framework|app.php

PATHS        JPATH_ROOT SITE ADMINISTRATOR API LIBRARIES
             PLUGINS THEMES CACHE MANIFESTS PUBLIC
             namespace → path: Joomla\Component\X\Site\
             = components/com_x/src  (map: autoload_psr4.php)

RULES        updates replace code, never data or overrides
             root = shipped list only; extras are questions
             backups OUTSIDE the tree; media/ is not images/
Back to top

15. Summary

Joomla's file structure is a small system of contracts:

  • Three kinds of content: entry points, code, and data - and only data (plus your overrides) is yours to write.
  • Four doors: site, administrator, API, CLI - one codebase, four thin entry points.
  • Extensions live distributed: frontend, backend, media, language, and API pieces each in the folder their function dictates; plugins grouped by type in one tree.
  • The critical distinction: images/ is your media, media/ is extension assets - with user.css and child template folders as the deliberate exceptions.
  • Runtime folders (cache/, tmp/, logs) are disposable in content, essential in existence, and best moved out of the web root.
  • For developers: JPATH_* constants name every location, namespaces map to paths, and the public-folder layout takes the web server out of reach of everything but the entry points.

Once the map is in your head, half this article series gets simpler: overrides, hardening, backups, and troubleshooting all become applications of "whose folder is this, and who writes there?".

And if a site's tree has grown mysterious over the years - stray files, duplicate copies, customisations nobody can place - a file-structure audit against a clean Joomla is methodical, satisfying work: everything explained, relocated, or removed. It is precisely the kind of spring cleaning a Joomla specialist does before every migration, and the site is safer and lighter afterwards.

Back to top
Joomla File Structure Explained: What Every Folder Does
Peter Martin
Peter Martin
Joomla Specialist

Peter is a Joomla specialist and a Linux admin for fast, secure and scalable websites.