btunnel config

Use config file


Btunnel can take a config file to launch multiple tunnels simultaniously. This greatly reduces the effor in a server setup where automated invocation of multiple and different tunnels are needed after any kind of maintenance, reboot or update.


Btunnel accept .yaml files as config which is passed with -c or --config option. The first and madatory field of the config file must be the api key which is denoted with the key apikey.

Next you need to define all the required tunnels under the tunnels property. Each individual tunnel is defined under tunnel name and the required named properties.

A sample configuration file is shown below

apikey: <YOUR_API_KEY>
quiet: false
monitor: true
log: /home/darcy/logs/btunnel.log
    type: file
    dir: /home/darcy/shared
    type: http
    port: 5000

Here, we have passed the apikey at the beginning of the config (put the api key without "<>"). After that we define the tunnels uner tunnels property. There are two tunnels defined here - namely one and two.

The tunnel named one is of type file and exposed the directory /home/darcy/shared. The tunnel named two is exposing an http server running on port 5000.

upon running the follwoing command -

btunnel -c /path/to/btunnel_config.yaml

both the two tunnels will be up and running.

If you don't want to pass the config file over and over again through -c or --config option, then create a file in your $HOME directory (that is ~/ in unix, C:\Users\yourusername\ in Windows) named .btunnel.yaml, put all above configs mentioned like above and then you can run btunnel like :


This is quite useful if btunnel is used as a service.

Versions before 1.2.x

The btunnel client version which are < 1.2.0, could only use config along with the specified subcommand.

For example, the following config :

port: 5000

could be used with like this:

btunnel http -c /path/to/btunnel_config.yaml

and this will make btunnel up and running only with single unnamed http tunnel.


  • btunnel - btunnel client cli tool