Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Deploy code to custom server

Hi, my servers are not in Amazon or some similar hosting. How can I deploy my code to a custom webserver? Is there some tutorial for this?

Now I am deploying from my dev server, where I am starting a script, wchich is copyng all the code to my prod server with scp. How to do this from bitbucket deployment?



1 comment

Marty Atlassian Team Feb 09, 2019

Hi Nikolay,

Just confirming that you're using Bitbucket Cloud ( rather than Bitbucket S Server (your own installation)?

If you are using Bitbucket Cloud, are you using Bitbucket Pipelines?

If so, you can set up custom deployment using Pipelines - here is a guide:

I hope that helps!

Like Nikolay Nikolov likes this

Hi Martyn, thanks!

I will play a bit with this deployment settings.

I have another question. When I use the steps for example for the branch feature/*

- step:
name: Build feature
- echo "done Tests"
- step:
name: Deploy to staging
deployment: staging
trigger: manual
- sh deploy/ "staging" $BITBUCKET_BRANCH
- step:
name: Deploy to production
deployment: production
trigger: manual
- sh deploy/ "production" $BITBUCKET_BRANCH

Then I can not deploy direct to production, without to deploy to staging. Is there some possibility, where the QA can choose, where to deploy?

For example I want to set 3 feature servers, where the QA can deploy to test the branch:

Deploy to qa_server1 

Deploy to qa_server2

Deploy to qa_server3

At this moment the QA can not deploy direct to qa_server3, without to deploy on qa_server1 and qa_server2 .

How can I solve this?

Marty Atlassian Team Feb 10, 2019

Hi Nikolay,


One option to try is to use a number of custom pipelines.

Each custom pipeline must be triggered manually, and when you trigger it you can select which pipeline to trigger. 

You can read more about custom pipelines here:

So you could have the following pipelines:

1. Build feature (automatic) - would have only one step from your existing pipeline above*

2. Deploy to qa_server1

3. Deploy to qa_server2

4. Deploy to qa_server3

5. Deploy to production


I hope that helps!

Hi Martyn, how can I add custom script only for the branches feature/* 

Is this possible?

Marty Atlassian Team Feb 10, 2019

Do you mean get a pipeline to run for only some branches?

Here is an example to do just that: 

Marty Atlassian Team Feb 10, 2019

If you're trying to get a step to run only for feature/* branches, you could run the custom script for every branch but add logic to the script that only executes certain steps based on the branch name.


Log in or Sign up to comment
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,210 views 2 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you