How to Uninstall Bitbucket Server

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Purpose

Instructions on how to uninstall Bitbucket Server. 

Solution

The below information refers to two variables: BITBUCKET_INSTALLATION and BITBUCKET_HOME.
BITBUCKET_INSTALLATION: The default installation path on Windows is C:\Atlassian\Bitbucket. On Linux it is \opt\atlassian
BITBUCKET_HOME: The default home path on Windows is C:\Atlassian\ApplicationData. On Linux it is \var\atlassian.  
(warning) The user can change these locations when installing; therefore, we use variables below as opposed to exclusive paths.

Windows

  1. If the application was installed as a service, stop the service via the Windows GUI. If the application was not installed as a service, use the stop-bitbucket.bat executable in the C:\%BITBUCKET_INSTALLATION%\bin directory.
  2. If application was installed as a service, uninstall the Bitbucket Server service. 
    (You'll need to know the service name for Bitbucket. If you are unsure of it, you can check it at the Task Manager, in the Services tab.)
    1. On the command prompt, navigate to C:\%BITBUCKET_INSTALLATION>\bin
    2. Remove the current Bitbucket and elasticsearch service by running:
      1. service.bat remove <Bitbucket service name>
      2. service.bat remove <ES service name>
  3. Remove %BITBUCKET_HOME% and %BITBUCKET_INSTALLATION% directories.
  4. If present, remove %BITBUCKET_HOME% environment variable from within the Windows GUI by going to Control Panel > System > Advanced Settings > Environment variables
  5. If one has been added, remove the atlbitbucket user.
  6. Remove any shortcuts or icons from Desktop or Start Menu.
  7. If Bitbucket Server was configured to use an external database, the corresponding database tables can be dropped or the database itself deleted.
  8. Delete Registry entry (Optional): Example for a 64bit system - From  Start Menu click Run. In the open field enter %systemroot%\syswow64\regedit. Click/Select HKEY_LOCAL_MACHINE. In Registry Editor menu click Edit > Find. In the "Find what" field type bitbucket. In the panel on the right select the Bitbucket entry. Choose Edit once more from the Registry Editor menu and select delete.

Linux

  1. If the application was installed as a service, stop the service by running service atlbitbucket stop from the host machine's command line. If the application was not installed as a service, use the stop-bitbucket.sh shell script in the $BITBUCKET_INSTALLATION/bin directory.
  2. If application was installed as a service, uninstall the Bitbucket Server service. 
    (You'll need to know the service name for Bitbucket. If you are unsure of it, you can check it by running service --status-all from the host machine's command line)
    1. On the command prompt, navigate to $BITBUCKET_INSTALLATION/bin
    2. Remove the current service by running:
      install_linux_service.sh -u remove_service <service name>
  3. Remove $BITBUCKET_HOME and $BITBUCKET_INSTALLATION directories.
  4. If present, remove $BITBUCKET_HOME environment variable from .bash_profile or /etc/profile
  5. If one has been added, remove the atlbitbucket user.
  6. If Bitbucket Server was configured to use an external database, the corresponding database tables can be dropped or the database itself deleted.

Mac

  1. In MacOS Bitbucket is intalled via ZIP or TAR method.
  2. To remove the application is enough to remove Bitbucket home and installation folders.
  3. If present, remove $BITBUCKET_HOME environment variable from .bash_profile or /etc/profile.
  4. If one has been added, remove the atlbitbucket user.

DescriptionInstructions on how to uninstall Bitbucket Server. 
ProductBitbucket
PlatformServer
Last modified on Mar 16, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.