How to simply use Bastion Host(Jump Host) in your CircleCI(or any other CI/CD) pipeline without using an extension or complicated configs to deploy an app with/without docker-compose

2 min readSep 30, 2020

If you are using CircleCI as your CI/CD tool, probably you have already faced this puzzle or going to face it in the future if you have servers in a private network without a public network connection and you are connecting to them through the Bastion Host when you want to deploy these servers with CircleCI, you need to use extensions called orbs or you can use VPN as mentioned here:

But there is an easy way for this. I will show how to easily use your Bastion Host(Jump Host) to deploy to the servers which are in a private network. Of course, this is not limited to CircleCI. This approach can be used in any other CI/CD tool.

I will be using SSH port forwarding (SSH tunneling). I will be forwarding my local port 9001 through a bastion host, to a remote machine’s port 22 which is in a private network. For detailed info, you can take a look at this:

This is an example config.yml file for CircleCI but you can see that it can be used in any other tool too.


Head of Infrastructure at @sporttotal_tv