Learning how to set up stash on a pc is a straightforward process that brings powerful version control to your local machine. Setting up a personal Stash instance on your computer allows for local version control of your code repositories. This guide will walk you through every step, from initial requirements to final configuration.
This local setup is perfect for solo developers, learning environments, or testing before a team deployment. You will have full control over your Git repositories without needing an internet connection or a cloud service.
How To Set Up Stash On A Pc
Before you begin the installation, you need to ensure your PC meets the necessary prerequisites. A successful setup depends on having the right foundation in place. Missing a single component can lead to frustrating errors later on.
Prerequisites For Installing Stash
Atlassian Stash, now known as Bitbucket Server, requires a few key software components to run properly. You must install these in the correct order for everything to function.
Java Development Kit (JDK)
Stash is a Java application. You will need a compatible Java Development Kit installed. We recommend using a long-term support (LTS) version for stability.
- Download the latest JDK 8 or JDK 11 from the official Oracle website or use an open-source version like OpenJDK.
- Run the installer and follow the on-screen instructions.
- Set the JAVA_HOME environment variable to point to your JDK installation directory. This is a critical step that Stash requires.
Git Command Line Tools
Since Stash is a Git server, your system needs Git installed. The Stash installer includes an embedded Git, but having your own is good for testing.
- Download Git for Windows from git-scm.com.
- During installation, choose the option to use Git from the Windows Command Prompt.
- After installation, open a command prompt and type `git –version` to confirm it’s working.
Database Setup
Stash needs a database to store its information. For a local PC setup, an embedded database is easiest for evaluation, but for longer-term use, an external database is better.
- For Evaluation: The installer includes an embedded H2 database. This requires no extra setup but is not supported for production.
- For Stability: Install PostgreSQL or MySQL. You will need to create an empty database and a user with full permissions for Stash to use.
Downloading The Stash Installer
You can obtain the Stash installer directly from the Atlassian website. Note that since its rebranding, you might find it listed as Bitbucket Server.
- Visit the official Atlassian download page for Bitbucket Server (formerly Stash).
- Select the appropriate installer for your operating system. For Windows, choose the 64-bit `.exe` installer.
- Choose a directory for the download, such as your `Downloads` folder. Avoid placing the installer in Program Files at this stage.
Running The Installation Wizard
The installation wizard will guide you through the core setup. The process is visual and mostly involves clicking “Next.”
- Locate the downloaded installer file (e.g., `atlassian-bitbucket-X.X.X-x64.exe`).
- Right-click the file and select “Run as administrator” to avoid any permission issues.
- The setup wizard will launch. Click “Next” on the welcome screen.
- Choose “Install” as the installation type (not “Upgrade”).
- Select the default installation and home directories, or choose custom paths. The home directory is where Stash will store all your repositories and data, so ensure it has ample space.
- On the component selection screen, leave the default options checked.
- Click “Install” to begin copying files. This may take a few minutes.
- Once complete, leave the “Launch Bitbucket” option checked and click “Finish.”
Initial Configuration And Setup
After the installer finishes, your default web browser should open to begin the configuration. If it doesn’t, open a browser and go to `http://localhost:7990`.
Step 1: Server Base URL
The setup will ask for a base URL. For a local PC installation, this will be `http://localhost:7990` or `http://your-pc-name:7990`. You can accept the default.
Step 2: Connect To Your Database
This is a crucial step. You will choose between the built-in database or your external one.
- Select “Built-in” for a simple test setup. For a more permanent install, choose “My own database.”
- If using your own database, select the type (PostgreSQL or MySQL) and enter the connection details: hostname (usually `localhost`), port, database name, and the username/password you created earlier.
- Click “Test connection” to verify everything is correct before proceeding.
Step 3: Application Properties
Here you will set the name for your Stash instance, such as “My Local Stash.” You can also configure the JNDI port if needed, but the default is usually fine.
Step 4: Create Your Administrator Account
You must create the first user account, which will have full system administrator privileges.
- Enter a username, full name, and email address.
- Choose a strong password and confirm it. Remember these credentials, as you will need them to log in.
Step 5: Review Your License
Atlassian requires a license for Bitbucket Server. You can request a free evaluation license for a limited time directly through this setup page by entering your details.
Step 6: Final Configuration
The system will now perform its final configuration, which includes creating tables in the database and setting up the internal file structure. This can take several minutes. Once it’s done, you will be redirected to the login page.
Creating Your First Repository And User
After logging in with your admin account, you can start using Stash. The first tasks are usually creating a personal project and repository.
Creating A Project
- Click the “Projects” dropdown in the top navigation bar and select “Create project.”
- Give the project a key (like “DEV”) and a name (like “Development”).
- Add an optional description and click “Create project.”
Creating A Repository
- Inside your new project, click the “Create repository” button.
- Enter a repository name (e.g., “my-first-codebase”).
- Choose the repository type (Git is the default).
- You can adjust other settings like branch permissions later. Click “Create repository.”
You will now see instructions for cloning your empty repository to your local machine using a command like `git clone http://localhost:7990/scm/dev/my-first-codebase.git`.
Adding A New User
To add team members (or a test user), use the admin interface.
- Click your profile avatar in the top-right and select “Manage account.”
- Go to the “Users” section in the administration menu.
- Click “Create user.” Fill in the details and set an initial password.
- You can then add this user to your project with specific permissions (read, write, admin).
Connecting To Stash From Your Git Client
With a repository created, you can now interact with it from your local Git command line or a graphical client like Sourcetree.
Cloning A Repository
- On your repository’s homepage in Stash, copy the clone URL. Use the HTTP URL for simplicity on a local network.
- Open your command prompt or terminal on your PC.
- Navigate to the directory where you want the local copy.
- Type `git clone [paste-your-url-here]` and press Enter.
- You will be prompted for your Stash username and password. Enter the credentials for the account that has access to that repo.
Making Your First Commit And Push
- Navigate into the cloned directory: `cd my-first-codebase`.
- Create a new file, like `README.md`.
- Stage the file: `git add README.md`.
- Commit the file: `git commit -m “Adding initial readme file”`.
- Push the commit to Stash: `git push origin main` (or `master`).
Refresh your repository page in the Stash web interface. You should now see your `README.md` file listed.
Essential Post-Installation Configuration
After the basic setup, tweaking a few settings will improve security and usability.
Setting Up SSH Access
While HTTP is easy, SSH is more secure for authentication.
- Generate an SSH key pair on your PC if you haven’t already using `ssh-keygen`.
- In Stash, click your profile avatar and go to “Manage account.” Select “SSH keys.”
- Paste the contents of your public key file (usually `id_rsa.pub`) into the box and click “Add key.”
- Now you can use the SSH clone URL for your repositories, which won’t require a password on each push.
Configuring Backup Strategies
Regular backups are essential, even for a local PC. Stash provides a built-in backup client.
- Find the `bitbucket-backup-client` in the Stash installation directory.
- You can run it from the command line to create a full backup archive of your instance.
- Schedule this backup script using Windows Task Scheduler to run automatically each night.
- Store the backup archives in a seperate location, like an external drive.
Managing Server Settings And Add-Ons
Explore the “Administration” section to adjust settings like email servers for notifications, hook settings, and system performance. You can also install add-ons to extend Stash’s functionality directly from the “Manage add-ons” menu.
Troubleshooting Common Setup Issues
Even with careful setup, you might encounter problems. Here are solutions to frequent issues.
Stash Fails To Start On Port 7990
This usually means the port is already in use by another application.
- Check for other services using the port with a command like `netstat -ano | findstr :7990` in Command Prompt.
- You can change Stash’s port by editing the `server.xml` file in the installation directory under the `conf` folder.
- Restart the Stash service after making the change.
Database Connection Errors
If the setup fails at the database stage, double-check your credentials.
- Ensure the database user has full rights to the database schema.
- Verify that your database server (e.g., PostgreSQL) is actually running.
- Check for any firewall rules on your PC that might be blocking the local connection.
Slow Performance On PC
Stash can be resource-intensive. If it feels slow, consider these adjustments.
- Increase the JVM minimum and maximum heap size in the `setenv.bat` file located in the Stash installation `bin` directory.
- Ensure your PC, especially if it’s a older machine, meets the recommended hardware specs (a multi-core CPU and at least 8GB of RAM).
- Close other demanding applications while using Stash to free up system resources.
FAQ Section
What Is The Difference Between Stash And Bitbucket?
Atlassian Stash was the original name for their self-hosted Git server. It was later rebranded to Bitbucket Server to align with the cloud product, Bitbucket Cloud. The software is the same; only the name changed. When you download “Bitbucket Server,” you are getting the product formerly known as Stash.
Can I Run Stash On Windows 10 Or Windows 11?
Yes, you can run Stash (Bitbucket Server) on both Windows 10 and Windows 11. The installation process is identical. Ensure your Windows installation is up to date and that you have the necessary prerequisites like the correct Java version installed.
Is It Free To Use Stash On My Personal Computer?
Bitbucket Server requires a license. However, Atlassian offers a free evaluation license that is valid for 30 days. For small teams (up to 5 users), there is also a free “Data Center” trial license that can be renewed. For larger or commercial use, you will need to purchase a license.
How Do I Update My Stash Installation To A Newer Version?
Updating involves downloading the new installer from Atlassian and running it over your existing installation. Always perform a complete backup of your Stash home directory and database before starting the update process. The installer will typically guide you through an upgrade path.
Can I Migrate My Existing Git Repositories To Stash?
Absolutely. You can easily migrate existing Git repositories. The simplest method is to clone your existing repository to your local machine, then add your new Stash instance as a remote and push all branches and tags to it. For example: `git remote add stash http://localhost:7990/scm/proj/repo.git` followed by `git push stash –all`.