Virtual Machine
Instructions for deploying the sandbox on a virtual machine
The DBNL sandbox can be deployed to a virtual machine such as AWS EC2, Google Compute Engine or Azure Virtual Machines. This is a good option for sandbox deployments that need to be accessible by multiple users or applications or deployments that need to be persisted for longer periods of time.
The sandbox deployment is not suitable for production environments.
Requirements
A domain name to host the DBNL sandbox (e.g. dbnl.example.com). This is optional for AWS EC2.
Installation
Create an AWS EC2 instance
Open the EC2 console and launch a Linux virtual machine instance (e.g. Amazon Linux, Ubuntu). The steps below assumes an Amazon Linux instance.
SSH into the instance using the instance public dns name.
$ ssh -i KEY_FILE ec2-user@INSTANCE_PUBLIC_DNS_NAME[Optional] Configure DNS
Add a DNS CNAME record mapping your domain name to the instance public DNS name.
Configure Security Group
Open the EC2 console, select the newly created instance and click through to the instance security group under Security > Security details > Security groups.
Add a Custom TCP inbound rule to port 8080 from My IP.
Install Docker
Install Docker.
$ sudo dnf install dockerStart the Docker service.
$ sudo service docker startAdd the
ec2-userto thedockergroup so that you can run Docker commands without using sudo.
$ sudo usermod -a -G docker ec2-userPick up new permissions by exiting SSH and logging back into the instance via SSH.
Install DBNL CLI
Install
pythonandpip.
$ sudo dnf install python pipInstall the DBNL CLI.
$ pip install dbnlStart DBNL sandbox
Start the sandbox passing the domain name or the instance public DNS name as the base URL.
$ dbnl sandbox start --base-url http://DOMAIN_NAME:8080Create a Google Cloud Compute instance
Open the Cloud Compute console and launch a Linux virtual machine instance (e.g. Debian, Ubuntu). The steps below assumes a Debian instance.
SSH into the instance using the instance name, project id and zone.
$ gcloud compute ssh --zone ZONE INSTANCE_NAME --project PROJECT_IDConfigure DNS
Open the IP addresses console, click Reserve external static IP address and create an IP address with:
Attached to: Instance name
Name:
dbnl-sandbox
Add a DNS A record mapping your domain name to the external static IP address created in step 1.
Configure Firewall
Open the Cloud Compute console, select the newly created instance, click Edit and under Networking set:
Network tags:
dbnl-sandbox
Open the Firewall policies console, click Create firewall rule to create a firewall rule with:
Name:
dbnl-sandboxTarget tag:
dbnl-sandboxSource IPv4 range: your IP
Target: TCP port 8080
Install Docker
Install Docker.
$ sudo apt-get install docker.ioStart the Docker service.
$ sudo service docker startAdd the current user to the
dockergroup so that you can run Docker commands without using sudo.
$ sudo usermod -a -G docker CURRENT_USERPick up new permissions by exiting SSH and logging back into the instance via SSH.
Install DBNL CLI
Install
python,venvandpip.
$ sudo apt-get install python-is-python3 python3-pip python3-venvCreate a virtual environment.
$ python -m venv venv
$ source venv/bin/activateInstall the DBNL CLI.
$ pip install dbnlStart DBNL sandbox
Start the sandbox passing the instance public dns name as the base URL.
$ dbnl sandbox start --base-url http://DOMAIN_NAME:8080Create a Google Cloud Compute instance
Open the Azure Virtual Machines console and launch a Linux virtual machine instance (e.g. Debian, Ubuntu). The steps below assumes a Debian instance.
SSH into the instance using the instance public IP address.
$ ssh -i KEY_FILE azureuser@INSTANCE_PUBLIC_IP_ADDRESSConfigure DNS
Add a DNS A record mapping your domain name to the public IP address of the instance.
Configure Firewall
Open the Azure Virtual Machines console, select the newly created instance and under Networking > Network settings > Rules > Create port rule > Inbound port rule add an inbound port rule with:
Source: My IP address
Source port ranges: *
Destination port ranges: 8080
Protocol: TCP
Install Docker
Install Docker.
$ sudo apt-get update
$ sudo apt-get install docker.ioStart the Docker service.
$ sudo service docker startAdd
azureuserto thedockergroup so that you can run Docker commands without using sudo.
$ sudo usermod -a -G docker azureuserPick up new permissions by exiting SSH and logging back into the instance via SSH.
Install DBNL CLI
Install
python,venvandpip.
$ sudo apt-get update
$ sudo apt-get install python-is-python3 python3-pip python3-venvCreate a virtual environment.
$ python -m venv venv
$ source venv/bin/activateInstall the DBNL CLI.
$ pip install dbnlStart DBNL sandbox
Start the sandbox passing the instance public dns name as the base URL.
$ dbnl sandbox start --base-url http://DOMAIN_NAME:8080Last updated
Was this helpful?

