[Other doc versions]
[Doc downloads (PDF, HTML, XML)]
The Stash home directory is created automatically by the Stash installer – see Getting started to install and start using Stash.
The information on this page only applies if you are manually installing or upgrading Stash.
The Stash home directory is where your Stash data is stored. The home directory location is defined either by the STASH_HOME
environment variable, or in the STASH_HOME
line of:
<Stash installation directory
>\bin\setenv.bat
<Stash installation directory
>/bin/setenv.sh
Stash 3.5 and later versions no longer allow the Stash home directory to be the same directory as, or a subdirectory of, the
. The Stash home directory, as defined by the <Stash installation directory>
STASH_HOME
variable, must be in a separate location – Stash will fail on startup otherwise. And by the way, you'll need separate Stash home directories if you want to run multiple instances of Stash (when these are not nodes for a Stash Data Center).
Where possible, you should choose a location for your Stash home directory that will never need to be moved. Some home contents are location-sensitive, so moving the home directory may corrupt them. Stash attempts to update contents when it detects that the home directory has moved, but the safest approach is to avoid the issue altogether by leaving the home directory in the same location.
Your Stash home directory contains the following directories and files:
Path | Description |
---|---|
caches | Contains cache and index files. It should be safe for these files to be deleted between application restarts; however, these files must not be modified or deleted while Stash is running. |
shared/config | Contains application configuration. |
shared/data | Contains the Git repositories, project avatars, and the embedded HSQL database if an external database is not configured. |
export | Contains dump files produced during database migrations. |
lib | As of Stash 2.1, can contain third-party jars such as the MySQL JDBC driver. |
lib/native | As of Stash 2.1, can contain native libraries, such as Tomcat's APR-based native library. |
log | Contains log files for Stash. |
shared/plugins | Contains plugin related data (such as externally uploaded plugins) for Stash. |
tmp | Contains temporary files created by the system. Its contents can safely be deleted when Stash is not running. |
shared/stash-config.properties | Allows configuring various aspects of how Stash behaves, such as its database connection pool size and the location of the Git binary to use. This file will be created automatically during a database migration. It can be created manually otherwise. See Stash config properties for further information. |
Note that the Stash home directory is created automatically by the Stash installer – see Getting started.
Only when you are installing Stash from an archive file will you need to set the value of STASH_HOME
yourself, as described in this section.
The internal database files, the migration dump files and stash-config.properties
all contain information that may be considered secret (server settings, salted and hashed user passwords, database passwords, etc).
For production use, we strongly recommend that you secure this directory against unauthorised access.
We recommend the following precautions:
As noted above, data
contains the Git repositories being managed by Stash, where "managed by Stash" are the operative words. The repositories are for Stash to interact with, and they are configured and managed accordingly. They are not a mechanism for configuring Stash behaviour. We strongly recommend that customers never modify them, nor interact with them directly. They are intentionally structured in a way which does not lend itself well to direct interaction.
Being Git repositories, there are certainly standard aspects to how the repositories on disk are stored and how they function. However, the exact way they are configured can and does change between Stash releases. Stash makes no effort to preserve unexpected configuration changes which have been applied by customers, and such changes may cause failures at runtime or during upgrades. If there is an aspect of Stash's behaviour you wish to configure, please open a feature request on jira.atlassian.com rather than trying to modify the repositories directly.
Repositories are location sensitive. Moving your Stash home directory will result in the system being locked (briefly) on startup while Stash updates the repositories on disk. Assuming the updates are applied successfully, the system will then unlock itself for normal usage.
Where possible, please choose a Stash home location which will not need to be changed later.