SSH and SFTP4 min readUpdated

Where your files go: current, releases and shared

Pick your platform and see where the code, settings and uploads live, what a Git deploy replaces and which commands to run.

Every application lives in its own folder, /srv/apps/<app>, with the same few folders inside. Where a file should go depends on the platform, so pick yours below.

The folders every application has

FolderWhat it is
currentThe live site. This is where you work: the Files tab, SFTP and SSH open here.
sharedFiles that must survive deploys, for the platforms that deploy into new folders (Magento, Laravel, Node.js).
releasesOne folder per Git deploy, the last 5 kept for rollbacks (Magento, Laravel, Node.js). For those, current is a link to the newest one.
logsnginx and PHP logs of the application.
tmpTemporary files and PHP sessions.

Your platform

Which platform runs your application?

Magento runs from releases: current points to the newest folder in releases, and the files that must survive a deploy live in shared with a link inside every release.

WhatWhere
Code (app/code, vendor, themes)current, or your Git repository
Web rootcurrent/pub
Settings (database, cache, crypt key)shared/app/etc/env.php (also reachable as current/app/etc/env.php)
Enabled modulescurrent/app/etc/config.php, part of the code
Product images and uploadsshared/pub/media
Logs and reportsshared/var/log, shared/var/report
Marketplace keys for composershared/auth.json
Imports and exportsshared/var/import, shared/var/export and the other var folders

Commands

cd ~/current
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
composer require vendor/module

The Actions tab runs the same commands with a button.

Moving a store here

Put its env.php in shared/app/etc/env.php with the new database name, user and password, its media in shared/pub/media, then upload the code or deploy it from Git.

Working the classic way, in one folder

You do not have to use Git. Work inside current by SFTP and SSH as on any host: nothing replaces those files, because only a Git deploy creates a new release. env.php, pub/media and var/log inside current are links into shared, so the files land in the right place by themselves.

In the classic way, do not delete and re-upload pub/media, var/log or app/etc/env.php as a whole (that replaces the link with a plain folder or file), and do not mix it with Git deploys: a Git deploy builds the store from the repository only.

WordPress runs straight from current: one folder, as on any host. A Git deploy updates the files in place.

WhatWhere
WordPress, plugins and themescurrent (current/wp-content/plugins, current/wp-content/themes)
Web rootcurrent
Settings (database, keys)current/wp-config.php
Media uploadscurrent/wp-content/uploads

Commands (WP-CLI is installed)

cd ~/current
wp plugin list
wp plugin update --all
wp core update
wp cache flush
wp search-replace 'https://old.example' 'https://www.example.com' --dry-run

With Git

Keep wp-config.php and wp-content/uploads out of the repository (in .gitignore). A deploy overwrites the files that are in the repository and leaves the others alone, so uploads and settings stay as they are.

PrestaShop runs straight from current: one folder, as on any host. A Git deploy updates the files in place.

WhatWhere
Shop, modules and themescurrent (current/modules, current/themes)
Web rootcurrent
Settings (database)current/app/config/parameters.php (PrestaShop 1.7 and 8)
Product imagescurrent/img
Cachecurrent/var/cache

Commands

cd ~/current
php bin/console cache:clear
php bin/console prestashop:module list

The admin folder has a random name (for example admin123abc). Keep that name when you move a shop here.

With Git

Keep app/config/parameters.php, img, var and uploaded files out of the repository. A deploy overwrites only the files that are in the repository.

Shopware 6 runs straight from current, with the web root in current/public. A Git deploy updates the files in place.

WhatWhere
Shop, plugins and themescurrent (current/custom/plugins)
Web rootcurrent/public
Settings (database, app URL)current/.env.local (or .env)
Media and thumbnailscurrent/public/media, current/public/thumbnail
Private filescurrent/files

Commands

cd ~/current
php bin/console cache:clear
php bin/console plugin:refresh
php bin/console plugin:list
php bin/console theme:compile

With Git

Keep .env.local, public/media, public/thumbnail and files out of the repository.

Laravel runs from releases, like Magento: current points to the newest folder in releases, and .env and storage live in shared with a link inside every release.

WhatWhere
Codecurrent, or your Git repository
Web rootcurrent/public
Settingsshared/.env (also reachable as current/.env)
Uploads, logs, cacheshared/storage

Commands

cd ~/current
php artisan migrate --force
php artisan config:cache
php artisan route:cache
php artisan queue:restart

Run php artisan storage:link once if your app serves files from storage/app/public.

Node.js applications run from releases: each Git deploy builds a new folder in releases and the app restarts on it.

WhatWhere
CodeYour Git repository, deployed into releases
Environment variablesshared/.env, edited on the Node.js tab
Files your app writesOutside the release, for example a folder in shared, or they are lost on the next deploy

Commands

Deploys run npm ci and npm run build for you. Start, stop and logs are on the Node.js tab. Your app must listen on process.env.PORT. See Node.js applications.

A generic PHP application runs straight from current: one folder, as on any host, and current is the web root.

WhatWhere
Everything (code, settings, uploads)current
Web rootcurrent (the first of index.php, index.html or index.htm)

Commands

cd ~/current
composer install --no-dev

With Git

A deploy overwrites the files that are in the repository and leaves the others alone. Keep settings files with passwords and user uploads out of the repository.

The Files tab opens in current. Go up one level to reach shared, releases and logs. See also Folders and file ownership and Git deploys.

Did this solve it? If not, tell us what you see and we look at your server.

Open a ticket

Still stuck? Ask a person.

Tickets go straight to the engineers who run ShopWhizzy servers. Tell us the store, what you see and when it started, and we take it from there.