Where your files live
Every site, app and volume that needs files on a server gets a folder there. This chapter says where the folders are, how they are named, which names you can choose, when a name stops being changeable, and what each action does to the files. For who owns the files and how a login reaches them, see Hosting Accounts and isolation.
The model
Each Hosting Account has one folder tree on every server where its services run:
/srv/users/ root owns it; every account passes through, nobody lists it
.tp-staging/ root's; new releases wait here while they are checked
alice/ root owns it; the SFTP jail root
home/ alice's login home
tmp/ alice's private temporary folder
production/ one folder per environment (the scope)
services/
example.com/ one folder per service that needs files
public/ uploaded files for a site you fill over SFTP
releases/<release id>/ sealed, read-only builds
current link to the release that is live
shared/ files that must outlive a deploy
logs/ the app's own log files
.turbopanel-hosting/ the site's settings for the web server
volumes/
uploads/ one folder per storage volume
staging/
common/ shared by every environment (below)
services/
volumes/home/andtmp/belong to the owner. Everything else is a folder TurboPanel makes for you.- A scope folder is named after the environment (
production,staging), or iscommonfor things shared across environments. - A service folder is made only for services that run from files on the host: sites, uploaded-directory sites and native apps. A service that only runs a container from an image has no service folder; its data lives in volumes.
- A volume folder is the bind-mount source for a storage entry of kind Directory on a host path. It belongs to the owner, so you can fill it and empty it over SFTP, but you cannot delete the folder itself.
- Which parts you can write. You can write to
home/,tmp/,public/,shared/,logs/and inside each volume. Every folder above those is root's, so a Hosting Account cannot rename, replace or delete a service, volume or environment folder, only empty the writable parts inside it. - Who reads
public/. Its group is the web server's account, so the web server can read what you upload. A site served by nginx in front of Apache is read by both, so itspublic/carries the Hosting Account's own group instead, which both web servers join. - Project names are not in paths. The project's name and short name never appear on the server.
Over SFTP with the jail on, the owner sees the same tree starting at /, and signs in to /home.
The owner, group and mode of every folder in this tree are in one table on Hosting Accounts and isolation.
Name rules
A folder name is fixed by the time the folder exists, so TurboPanel checks it up front. The same rules are applied by the app, the API and the host.
| Name | Allowed | Length |
|---|---|---|
| Environment | Lowercase letters, digits, hyphens and underscores; starts with a letter or digit | Up to 32 |
| Service or volume folder | Lowercase letters, digits, dots, hyphens and underscores; starts and ends with a letter or digit; no .. | Up to 63 |
| Hosting Account | Lowercase letters, digits, hyphens and underscores; starts with a letter or underscore; no --, no trailing -, not all digits; not a reserved system name, and not starting with tp or systemd- or ending in -grp | Up to 28 |
| Project short name | Lowercase letters, digits and hyphens; starts with a letter or digit. It is made from the project's name and never appears in a path | Up to 40 |
Reserved names. An environment (or a scope name) cannot be called base, common, home, tmp, services or volumes (those are the owner's own folders), and a handful of other words are kept free so a future folder never needs a rename: data, sites, backup, backups, logs, cache, run, var, etc, bin, root, public, releases, current, shared, lost-found and tmp-staging.
Name from a domain. A website's folder name defaults to its domain, made safe for a folder:
- Spaces and one trailing dot are dropped, and an international domain is turned into its
xn--form. - It is lowercased.
- A leading
*.becomeswildcard.. - If the result is longer than 63 characters, it is cut to 54 characters, then
-and eight characters of a fingerprint of the full domain are added, so the same domain always gives the same name. - If another service of the same owner in the same environment already has that name,
-2,-3and so on are added, up to-99.
A later domain change, an extra domain or an alias never renames the folder. A name you type yourself is never changed for you: if it is taken, the request is refused with directory_name_taken.
Choose how folders are named for your organization
An organization owner or manager picks how service and volume folders are named. The setting applies to every service and volume created afterwards.
| Setting | What it does |
|---|---|
Readable names (slug, the default) | Each service and volume has a folder name field, filled in for you (a site from its domain, anything else from its name). |
Ids (uuid) | The folder is named after the service's or volume's id. There is no name field. |
Both (both) | Each service and volume chooses, readable names by default. |
Environment folders are always the environment's name. Over the API it is GET and PUT /api/client/v1/organizations/{id}/directory-defaults (names: slug, uuid or both). It can change until the first folder is made anywhere in the organization. After that it is locked, and changing it returns directory_names_locked.
Shared (common) folders
By default a service or volume belongs to one environment and lives under that environment's folder. To keep something across environments, create it as common when you add it. It then lives under common/ and is not tied to an environment name.
- The choice is made at creation and cannot change afterwards (
scope_locked). - Any environment of any project in the organization can use a common service or volume of the same Hosting Account. An environment lists the ones it uses, and
POST /api/client/v1/environments/{id}/sharesadds one (serviceIdorstorageId). Removing the share stops the environment using it and leaves the asset alone. - Adding a share is refused with
asset_not_common(the service or volume is not common),asset_in_this_environment(it belongs to this environment already) orasset_has_no_owner(it has no Hosting Account yet). Adding the same share twice is harmless. - A common asset cannot be deleted while another environment uses it (
common_asset_in_use). - A common volume is mounted only by environments that use it, and only at the mounts they ask for.
Common folders never block an environment rename, because they do not contain the environment's name.
Share One Folder Between Containers
Two containers can use the same files when they mount the same volume.
- Create one storage entry of kind Directory (for example
media) for the Hosting Account that runs both services. Make it common if environments other than its own will use it. - Mount it in both services. Each one sees the same folder,
/srv/users/<owner>/<scope>/volumes/mediaon the server. - To use a common volume from another environment, add a share to that environment (
POST /api/client/v1/environments/{id}/shareswith thestorageId), then mount it there too. - If a service runs as a numeric user other than root, that user gets its own access entry on the folder (see Volumes and the user a container runs as), so both containers can write while the owner keeps access over SFTP.
The volume's backups cover everything in it, whichever container wrote it.
Site files cannot be shared yet. A site's public/ and shared/ folders cannot be mounted into a container, and a site cannot serve from a volume folder. So a PHP site's uploads (for example a WordPress media library) cannot be shared with a container or kept in step with another server today.
When a name is locked
Names that appear in a path stop changing once something exists on disk under them.
| What | Locked when | Refusal |
|---|---|---|
| A service's folder name | The service has a folder on any server | service_slug_locked (409) |
| A volume's folder name and its Hosting Account | The volume has a folder on any server | storage_slug_locked (409) |
| Common or not | Always, once chosen at creation | scope_locked (409) |
| An environment's name | Any service or volume folder exists under it on any server | environment_name_locked (409) |
| An environment's server | Same as its name | environment_server_locked (409) |
| A project's short name | Folders exist under its environments | project_slug_locked (409) |
| The organization's folder naming | The first folder is made anywhere in the organization | directory_names_locked (409) |
An environment's name is the folder name on disk, so it cannot be renamed while folders exist under it. The error lists up to 20 of the folders that block it, each with its server and a plain reason, for example being removed, waiting for server Beta to come back. Remove those services and volumes first, or keep the name. Moving an environment to another server is locked the same way, and an environment with folders cannot be deleted either (environment_has_folders) until they are removed.
What counts: a folder in the state planned, present, removing or orphan. What does not count: an empty environment folder with nothing in it, a service that has no folder (container-only), a managed database (it lives outside the owner's tree), and a folder marked missing. A rename also waits for a running deploy of the environment (environment_deploy_running).
What stop, delete and removing a service do
| Action | Files on the server |
|---|---|
| Stop an environment | The containers stop. Nothing on disk is removed, so a start brings the same files back. |
| Destroy an environment | The containers and networks are removed, and so are anonymous volumes (an image's VOLUME line or a bare - /path mount) and a top-level volume authored with its own name: and no external:. Docker named volumes, volume folders and relative binds survive. Every folder under /srv/users/<owner> stays. The environment's compose folder, /var/lib/turbopanel/deployments/<project id>/<environment id>/, is kept, with anything a relative bind such as ./data wrote there. Only what TurboPanel wrote into it is removed (the compose files, the overlay file, .env, deployment.json, previous/ and .staging/), and the next deploy writes them again. |
| Redeploy | A new sealed release is added; the previous releases stay for rollback (the newest five are kept) and shared/ is never touched. |
| Delete a service or volume | The folder is removed from every server that has it. If a server is offline, the folder shows as removing and is removed when the server returns; the name stays locked until then. |
| Delete an environment | Refused while any folder exists under it (environment_has_folders). Delete its services and volumes first; that removes their folders, and then the environment can be deleted. The delete also removes the environment's compose folder, with anything a relative bind wrote there. Deleting a project does the same for each of its environments. |
| Take a service out of the compose document | The folder is kept and marked orphan. Only an explicit delete removes files. |
| A server leaves an environment (the environment no longer runs there) | The environment's service folders on that server are removed. Its volume folders and its compose folder stay, because stopping never removes data. |
| Remove a Hosting Account | Refused on the server while any service or volume folder is left in any of its environment or common folders, while an older sites/ folder in its home still has anything in it, or while a TurboPanel unit file still names the account, whether that unit is running or not. Delete those services and volumes first. Then the whole /srv/users/<owner> folder, its SSH keys, its resource group and its build caches are removed, along with the Linux user. Some files outside the home outlive it; see below. |
Warning: a Destroy deletes anonymous volumes (an image's VOLUME with nothing mounted on it) and a top-level volume authored with its own name: and no external:. Docker named volumes, volume folders under the Hosting Account's home and relative binds (./data) survive a Destroy. Relative binds stay until the environment is deleted.
An empty environment folder is left in place when its last service goes. It costs nothing and does not lock any name.
Orphan folders
An orphan is a folder on a server that no service or volume owns any more: a service removed from the compose document (its files are kept on purpose), or a folder found on the server that the app did not make. The app raises an alert, lists the orphan with the reason no service or volume owns this folder on server X, and counts it toward the environment-name lock until an organization admin removes it or the service is added back. Nothing is deleted automatically.
The host also reports the folders it finds on its disk; any difference from what the app expects shows as an orphan (a folder only on disk) or missing (a folder the app expects that is not there), with an alert.
Volumes and the user a container runs as
A volume folder belongs to the Hosting Account. A container may run as any user and TurboPanel never refuses a compose document for that. When a service declares a numeric user other than root, that user is given access to the volume folder with a permission entry; the folder's owner is never changed to root or to the image's user, so you keep access over SFTP. For an image that must own its data as a fixed user, use a Docker named volume instead of a directory.
A Hosting Account's Files Outside the Home
Some of what a Hosting Account runs is kept outside /srv/users/<owner>, in places the account cannot write. <id> is a service, runtime or storage id.
| Path | Owner and Mode | What | Removed |
|---|---|---|---|
/etc/ssh/turbopanel/authorized_keys/<owner> | root | The account's SSH keys | With the account |
/etc/systemd/system/turbopanel-<owner>.slice | root, 0644 | The account's resource group; every unit below runs inside it. A - in the name becomes . in the slice name. | With the account |
/etc/systemd/system/turbopanel-app-<id>.service | root, 0644 | A native app (Node) | On every Destroy, and when the app is removed. The next deploy writes it again. |
/etc/systemd/system/turbopanel-cron-<environment id>-<service>-<job>.service and .timer | root, 0644 | A scheduled job | When the job is removed |
/etc/systemd/system/turbopanel-php-<id>.service, and turbopanel-php-<id>.socket in FastCGI mode | root, 0644 | A site's own PHP; see PHP modes | On every Destroy, and when the site is removed. The next deploy writes it again. |
/etc/turbopanel/node-app-env/<id>.env | root, 0600, in a root-only 0700 folder | A native app's variables, read by systemd as it starts the app | On every Destroy, and when the app is removed. The next deploy writes it again. |
/etc/turbopanel/php/sites/<id>/ | root, group the owner, 0750; files 0640 | A site's PHP configuration | On every Destroy, and when the site is removed. The next deploy writes it again. |
/etc/turbopanel/nginx/, apache/, openlitespeed/, site-caddy/ | root, group the web server, 0750; files 0640 | Web server configuration for the account's sites, including their decrypted variables and secrets | On every Destroy, and when the site is removed. The next deploy writes it again. |
/var/lib/turbopanel/deployments/<project id>/<environment id>/ | TurboPanel's account, 0750; compose.yaml and .env 0640 | The environment's compose files, with the last applied copy in previous/. A relative bind such as ./data in a compose document points inside this folder. Compose secrets are written to /run/turbopanel/deployments/…/secrets/, and generated config files to /run/turbopanel/deployments/…/configs/: files 0444 in a folder only TurboPanel's account can open (0700), on memory-backed storage, so every user inside the one container a file is bound into can read it and no other account on the server can. They are rebuilt when the server restarts and removed when the environment is stopped or destroyed. | When the environment or its project is deleted, together with anything a relative bind wrote there. A Destroy removes only the compose files, the overlay file, .env, deployment.json, previous/ and .staging/, and keeps the rest. |
/var/lib/turbopanel/storage/<organization id>/<storage id>/<copy id>/data | Given to the owner when the storage entry has one | A storage entry that has no folder in the home | Not removed with the account |
/var/lib/docker/volumes/<name> | Docker's | A Docker named volume | Not removed with the account |
/var/lib/turbopanel-build/work/<build id> | work/ is root, group tp, 1770 | Scratch space for one sandboxed build | After the build |
/var/lib/turbopanel-build/caches/<owner>/<project> | root, 0700 | The account's build caches | With the account |
/backup/volumes/<copy id>/ | TurboPanel's account, 0750; archives 0600 | Backups of a volume | Not removed with the account |
What outlives a removed account. Storage under /var/lib/turbopanel/storage, Docker named volumes, /backup archives, and access entries the account was given on other accounts' volume folders stay on the server, still marked with the removed account's user id. The control plane takes ids from the counter of the organization that owns the server and never gives a used one out again, but an id set by hand could get the same number and so reach those files. This is being fixed. Until then, delete an account's storage and backups before removing it.
Logs
Web server logs are kept for the whole server, not per site: /var/log/turbopanel/nginx/, /var/log/turbopanel/apache/ and the other web servers' folders mix the requests and errors of every Hosting Account, so a Hosting Account cannot read them. Errors from a site's own PHP go to the system journal. Logs per site are planned. Until then, logs/ in a service folder is only for the files your app writes itself; no web server writes there, and PHP's open_basedir does not include it, so a PHP app that keeps its own log files should write them to shared/.
Older Folders That Are Still Accepted
Servers set up before the layout above can still have folders from the older one, and the host, the Docker gate and volume backups still accept them:
| Older Path | What It Was |
|---|---|
/srv/users/<owner>/sites/<service>/ with shared/, webroot/ and releases/ | A site's folder |
/srv/users/<owner>/volumes/<storage id> | A volume folder |
/srv/users/<owner>/data/ | The owner's own data folder. New homes do not get one, but where it exists a container may still bind it, like tmp/. |
/var/lib/turbopanel/sites/<environment>/<service>/ | A site folder kept by TurboPanel itself |
New folders are never made there. Accepting the older layout is due to be removed, so move anything still in it to the layout above.
Can the Home Root Move?
No. Keep homes under /srv/users. Parts of the daemon and the host read a setting for another root (TURBOPANEL_PRINCIPAL_HOME_ROOT, and principal_home_root in the host's root-owned tp-host.conf), but the Docker gate, volume backups, the daemon's permission checks and the control plane are fixed to /srv/users, so a moved root does not work end to end.
Backups and TurboPanel's own folders
Backups and the platform's own state live outside the owner's tree.
| Path | What |
|---|---|
/backup/managed/<id>/ | Backups of a managed database |
/backup/volumes/<id>/ | Backups of a storage volume |
/backup/panel/ | Control plane upgrade backups and database dumps |
/var/lib/turbopanel/ | The daemon's state, including deployments, release records, the web server's and Docker gate's state, and managed databases |
/var/cache/turbopanel/ | Caches the daemon can rebuild |
/var/log/turbopanel/ | Daemon, web server and gate logs |
/var/lib/turbopanel-build/ | Scratch space for sandboxed builds; the one folder kept beside the others |
The path of a backup is stored relative to the backup folder (for example managed/<id>/<backup id>.dump), so moving the backup folder to another disk and pointing TURBOPANEL_BACKUP_DIR at it does not break restores. A volume restore stages its files inside the volume folder (.tp-restore-stage, .tp-restore-old and .tp-restore-done, all starting with a dot), so those names cannot clash with anything you create.
Errors
| Code | Status | Meaning |
|---|---|---|
invalid_environment_name | 400 | The environment's name cannot be a folder name. Rename it to meet the rules above before deploying. |
invalid_directory_name | 400 | A folder name is outside the rules above. |
directory_name_mode_forbidden | 400 | The organization's setting does not allow that kind of name. |
directory_name_taken | 409 | Another service or volume of the same Hosting Account has that name in the same environment (or in common). |
directory_name_typed_in_uuid_mode | 409 | The organization names folders after ids, so a name cannot be typed. |
service_slug_locked, storage_slug_locked | 409 | The service or volume already has a folder, so its name can no longer change. |
scope_locked | 409 | Whether it is common was chosen at creation. |
common_asset_in_use | 409 | Another environment still uses this common service or volume. |
environment_name_locked, environment_server_locked | 409 | Folders exist under the environment. The body lists up to 20 of them. |
environment_has_folders | 409 | The environment still has folders; remove the listed services and volumes first. |
environment_deploy_running | 409 | A deploy is running; rename when it finishes. |
invalid_project_slug | 400 | The project's short name is outside the rules. |
project_slug_locked, project_slug_in_use | 409 | The project's short name cannot change after folders exist, or another project already uses it. |
asset_not_common, asset_in_this_environment, asset_has_no_owner | 409 | A share could not be added: the service or volume is not common, already belongs to this environment, or has no Hosting Account. |
directory_names_locked | 409 | The organization already has folders, so its naming setting is fixed. |
Related
- Hosting Accounts and isolation — who owns each folder and how SFTP is locked to it.
- Storage, variables and secrets — volumes, copies and backups.
- Writing compose — how a site is served from
public/orcurrent. - System users — the Hosting Account.
Last updated on
Storage, variables and secrets
Persistent storage for an environment's services, the variable cascade from organization to hosting, secrets that never touch YAML, how the compose document references them, and every refusal code
Managed databases
PostgreSQL, MySQL and MariaDB clusters TurboPanel provisions on your servers — creating one, connecting, users and roles, replicas and promotion, backups, and every refusal code