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.

Requirements

  • A domain name to host the DBNL sandbox (e.g. dbnl.example.com). This is optional for AWS EC2.

Currently, the sandbox does not support being hosted from a subpath (e.g. http://example.com:8080/dbnl) or being served from a different port. If those are required, we recommend using a reverse proxy.

  • A set of DBNL registry credentials to pull the sandbox image.

Installation

Create an AWS EC2 instance

  1. Open the EC2 console and launch a Linux virtual machine instance (e.g. Amazon Linux, Ubuntu). The steps below assumes an Amazon Linux instance.

For anything but a test deployment, we recommend using a memory optimized instance such as an r7i.large or above with at least 1 TiB of gp3 storage.

  1. SSH into the instance using the instance public dns name.

$ ssh -i KEY_FILE ec2-user@INSTANCE_PUBLIC_DNS_NAME

[Optional] Configure DNS

  1. Add a DNS CNAME record mapping your domain name to the instance public DNS name.

This step is optional and the instance public DNS name can be used directly as the deployment domain name.

Configure Security Group

  1. Open the EC2 console, select the newly created instance and click through to the instance security group under Security > Security details > Security groups.

  2. Add a Custom TCP inbound rule to port 8080 from My IP.

To allow traffic from more than one IP address, define a Custom source. For more details, see working with security group rules.

Install Docker

  1. Install Docker.

$ sudo dnf install docker
  1. Start the Docker service.

$ sudo service docker start
  1. Add the ec2-user to the docker group so that you can run Docker commands without using sudo.

$ sudo usermod -a -G docker ec2-user
  1. Pick up new permissions by exiting SSH and logging back into the instance via SSH.

Install DBNL CLI

  1. Install python and pip.

$ sudo dnf install python pip
  1. Install the DBNL CLI.

$ pip install dbnl

Start DBNL sandbox

  1. Start the sandbox passing the domain name or the instance public DNS name as the base URL.

$ dbnl sandbox start \
    -p DBNL_REGISTRY_PASSWORD \
    --base-url http://DOMAIN_NAME:8080

Was this helpful?