Deploy to Vultr
This tutorial explains how to deploy LabxDB in the cloud using Vultr. For a few dollars per month, you can run LabxDB following the easy setup explained here.
Login to Vultr
Add SSH key
To connect to your server, an instance in DigitalOcean vernacular, your SSH login key will be installed by the installation script.
Generate your SSH key
If you don’t already have an SSH key, follow this guide to generate one.
Load your SSH key
After logging in, go to the SSH Keys tab of the Products section. Click on Add SSH Key, and copy-paste your SSH key and give it a name:
You can then see you added SSH key:
This process is further explained in this tutorial.
Add Startup Script
After logging in, go to Startup Scripts. After Vultr install a functional Linux distribution on your virtual server, this script will be used to install LabxDB automatically.
Click on the Add Startup Script button:
Input the LabxDB script in the form with the following parameters:
-
Name: LabxDB
-
Type: Boot
-
Script: Copy-paste one of the following scripts:
- Test version. Installs LabxDB:
#!/bin/bash bash <(wget -qO- https://git.sr.ht/~vejnar/LabxDB/blob/main/contrib/virt/labxdb_install.sh)
- Production version. Installs LabxDB with domain name and security (https+firewall):
NoteWith the parameter
ACME_STAGING="yes"
, the Let’s Encrypt Staging Environment will be used to sign the SSL certificate. The resulting certificate won’t be usable in internet browsers. This is intented to test deploying LabxDB. To use the regular Let’s Encrypt server, change the parameter toACME_STAGING="no"
as described in the post-installation section.- If you created a DuckDNS domain, set DUCKDNS_DOMAIN, DUCKDNS_TOCKEN and ACME_EMAIL (with your email) variables (see here)
#!/bin/bash bash <(wget -qO- https://git.sr.ht/~vejnar/LabxDB/blob/main/contrib/virt/labxdb_install.sh) export DUCKDNS_DOMAIN="labxdb.duckdns.org" export DUCKDNS_TOCKEN="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX" export ACME_EMAIL="you@domain.com" export ACME_STAGING="yes" bash <(wget -qO- https://git.sr.ht/~vejnar/LabxDB/blob/main/contrib/virt/dns_nft_caddy.sh)
- If you have your own domain name, set DOMAIN (with your domain) and ACME_EMAIL (with your email) variables:
NoteThe installation does not set the IP of your new instance to your domain name. In consequence, the certificate creation will fail. Once the instance installation, restart Caddy as described in the post-installation section.
#!/bin/bash bash <(wget -qO- https://git.sr.ht/~vejnar/LabxDB/blob/main/contrib/virt/labxdb_install.sh) export DOMAIN="labxdb.mydomain.com" export ACME_EMAIL="you@domain.com" export ACME_STAGING="yes" bash <(wget -qO- https://git.sr.ht/~vejnar/LabxDB/blob/main/contrib/virt/dns_nft_caddy.sh)
- If you created a DuckDNS domain, set DUCKDNS_DOMAIN, DUCKDNS_TOCKEN and ACME_EMAIL (with your email) variables (see here)
- Test version. Installs LabxDB:
Then click Add Script:
The new script should then be available:
Create instance
Configure instance
Go to Deploy New Instance by clicking on the Plus button (Deploy New Server):
Choose a node type:
Choose a region:
Choose the Debian image (and latest version):
Choose a node size:
Select the Startup Script you entered at the previous step:
Select an SSH key if you configured one.
Choose a Server Hostname and Label:
Then Deploy your new instance.
Start instance
Go back to main panel at https://my.vultr.com and wait for the new instance to be ready:
Post-installation
If you used your own domain name or created a staging domain name using ACME_STAGING="yes"
, follow these steps to create a valid certificate (be aware of limits):
- Only if you used your own domain name to install a production version: set the IP (in our example
45.77.154.27
) of your new instance to your domain name (at your domain name registrar or DNS provider). Wait a few minutes for the update to be applied. - Only if you are ready to create a production certificate, login to your instance, open with an editor
/etc/caddy/caddy.json
and update the ACME server from the staging to the production URL by replacing:by:{ "module": "acme", "ca": "https://acme-staging-v02.api.letsencrypt.org/directory" }
{ "module": "acme", "ca": "https://acme-v02.api.letsencrypt.org/directory" }
- Login to your instance and restart Caddy using (it forces creating a new certificate):
systemctl restart caddy
Connect to LabxDB
Test version
Get the IP from your new instance (in our example 45.77.154.27
). Open a browser and go to http://your ip:8081, i.e. http://45.77.154.27:8081
.
Production version
LabxDB is accessible at the domain you set in DUCKDNS_DOMAIN
or DOMAIN
. For our example https://labxdb.duckdns.org.
The password is defined in /etc/caddy/caddy.json
within the http_basic
module. To define a new password, it needs to be encoded using:
caddy hash-password
More help is available here.
More configuration
Connect to instance
Click on the new instance to get Server information. On this page, you can find the root password.
Connect with SSH to your instance using:
ssh root@45.77.154.27
Or, if you setup a domain name (labxdb.duckdns.org here):
ssh root@labxdb.duckdns.org
Troubleshooting
In case the installation is incomplete or failed, the log of install script is saved in /tmp/firstboot.log
.
Vultr documentation
Vultr documentation is available for further help.