Skip to main content
View rawEdit

How to install and initialize DBLab CLI

Reference​

Install CLI and connect​

  1. Install the DBLab CLI:
curl -sSL dblab.sh | bash
  1. (optional) Connect to DBLab Engine using SSH port forwarding
note

A DBLab instance might run behind a firewall where opening the required ports is impossible or prohibited. In this case, the SSH keys must be on the server with DBLab Engine to use this connection option.

In a separate terminal tab, launch SSH port forwarding. Use http://localhost:2344 as the URL in step 3 below.

ssh -NTML 2344:localhost:2345 ssh://USERNAME@HOSTNAME:22 -i ~/.ssh/id_rsa
  1. Initialize the configuration. Use the URL and verification token of your instance. Instead of a verification token, you can generate and use a personal access token. See details here.
dblab init --environment-id=ENV_ID --url=URL --token=TOKEN
  • --environment-id - an arbitrary environment ID for the DBLab instance's API
  • --url - URL of the DBLab instance's API
  • --token - verification token of the DBLab instance used to send API requests

You can also run dblab config at any time to change your settings or create a new configuration.

  1. Test your configuration with instance status request dblab instance status:
{
"status": {
"code": "OK",
"message": "Instance is ready"
},
...
}