Versions
- 9.5
- 9.4
- 9.3
- 9.2
- 9.1
- 9.0
- 8.19
- 8.18
- 8.17
- 8.16
- 8.15
- 8.14
- 8.13
- 8.12
- 8.11
- 8.10
- 8.9
- 8.8
- 8.7
- 8.6
- 8.5
- 8.4
- 8.3
- 8.2
- 8.1
- 8.0
- 7.21
- 7.20
- 7.18
- 7.19
- 7.17
- 7.16
- 7.15
- 7.14
- 7.13
- 7.12
- 7.11
- 7.10
- 7.9
- 7.8
- 7.7
- 7.6
- 7.5
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
- 6.10
- 6.9
- 6.8
- 6.7
- 6.6
- 6.5
- 6.4
- 6.3
- 6.2
- 6.1
- 6.0
- 5.16
- 5.15
- 5.14
- 5.13
- 5.12
- 5.11
- 5.10
- 5.9
- 5.8
- 5.7
- 5.6
- 5.5
- 5.4
- 5.3
- 5.2
- 5.1
- 5.0
- 4.14
- 4.13
- 4.12
- 4.11
- See all
Moving Bitbucket Server to a different context path
Advanced actions
- Running the Bitbucket Server installer
- Automated setup for Bitbucket Server
- Starting and stopping Bitbucket Server
- Install Bitbucket Server from an archive file
- Install and configure a remote Elasticsearch instance
- Running Bitbucket Server as a Linux service
- Running Bitbucket Server as a Windows service
- Bitbucket Server config properties
- Proxying and securing Bitbucket Server
- Enabling SSH access to Git repositories in Bitbucket Server
- Using diff transcoding in Bitbucket Server
- Changing the port that Bitbucket Server listens on
- Moving Bitbucket Server to a different context path
- Running Bitbucket Server with a dedicated user
- Bitbucket Server debug logging
- Data recovery and backups
- Lockout recovery process
- Scaling Bitbucket Server
- High availability for Bitbucket Server
- Clustering with Bitbucket Data Center
- Enabling JMX counters for performance monitoring
- Getting started with Bitbucket Server and AWS
- Disabling HTTP(S) access to Git repositories in Bitbucket Server
- Smart Mirroring
- Git Large File Storage
On this page
Related content
- Moving Bitbucket Server to a different context path
- Integrating Bitbucket Server with Apache HTTP Server
- Securing Bitbucket Server behind HAProxy using SSL
- Proxying and securing Bitbucket Server
- Securing Bitbucket Server with Apache using SSL
- Login and session conflicts with multiple Atlassian applications
- Changing the port that Bitbucket Server listens on
- Migrating Bitbucket Server to another server
- Specifying the base URL for Bitbucket Server
- You are accessing Bitbucket from a URL that does not match the configured base URL
There are various reasons why you may wish to change the context path for Bitbucket Server. Two of those are:
- You are running Bitbucket Server behind a proxy.
- You have another Atlassian application, or Java web application, available at the same hostname and context path as Bitbucket Server, and are experiencing login problems (see Login and session conflicts with multiple Atlassian applications).
Upgrade Note
Note that the location of server.xml
changed in Bitbucket Server 3.8. See the Bitbucket Server upgrade guide.
Changing the context path for Bitbucket Server:
- Navigate to your Bitbucket Server home directory.
- Stop Bitbucket Server. See Starting and stopping Bitbucket Server.
Edit
<Bitbucket home directory>/shared/server.xml
and find the element below:<Context path="" docBase="${catalina.home}/atlassian-bitbucket" reloadable="false" useHttpOnly="true"/>
Update the
path
attribute to reflect the context path that you want Bitbucket Server to be accessible at, e.g. "/bitbucket":<Context path="/bitbucket" docBase="${catalina.home}/atlassian-bitbucket" reloadable="false" useHttpOnly="true"/>
Then save the file.
- Start Bitbucket Server. See Starting and stopping Bitbucket Server.
Bitbucket Server should now be available at the same host as before under the new context path. For example a server that was at http://localhost:7990 will now be reachable at http://localhost:7990/bitbucket. Once Bitbucket Server has started, go to the administration area and click Server settings (under 'Settings'). Append the new context path to your base URL:
https://my-bitbucket-hostname:7990/bitbucket
Click Save.
Bitbucket Server + Apache
Note that if you are running Bitbucket Server behind Apache:
- You will need to make sure that the host or context path that Bitbucket Server is exposed on is not also being used by another web application that is listening on a different port.
- If you have updated the Bitbucket Server context path using the steps outlined above, you will need to update your Apache configuration, as described in Integrating Bitbucket Server with Apache HTTP Server.
Application Links
If you had Application Links set up before changing the context path in Bitbucket Server, you will have to recreate those using the new Bitbucket Server URL. See Linking Bitbucket Server with JIRA.
SSH
The context path does not affect the URL at which SSH operations occur. After changing the context path so that Bitbucket Server is accessible at https://my-bitbucket-hostname:7990/bitbucket
, SSH operations occur without the context path at ssh://my-bitbucket-hostname:7999
.
Related content
- Moving Bitbucket Server to a different context path
- Integrating Bitbucket Server with Apache HTTP Server
- Securing Bitbucket Server behind HAProxy using SSL
- Proxying and securing Bitbucket Server
- Securing Bitbucket Server with Apache using SSL
- Login and session conflicts with multiple Atlassian applications
- Changing the port that Bitbucket Server listens on
- Migrating Bitbucket Server to another server
- Specifying the base URL for Bitbucket Server
- You are accessing Bitbucket from a URL that does not match the configured base URL