Deploying Gel to a Bare Metal Server​
In this guide we show how to deploy Gel to bare metal using your system's package manager and systemd.
Gel Cloud: Reset the default password for the admin role
If you want to dump an existing Gel Cloud instance and restore it to a new self-managed instance, you need to change the automatically generated password for the default admin role - edgedb or admin.
The administrator role name and its password used in the dump/restore process must be the same in both the instance dumped from and the instance restored to for the Gel tooling to continue functioning properly.
To change the default password in the Cloud instance, execute the following query in the instance:
ALTER ROLE admin { set password := 'new_password' };Install the Gel Package​
The steps for installing the Gel package will be slightly different depending on your Linux distribution. Once you have the package installed you can jump to Enable a systemd unit.
Debian/Ubuntu LTS​
Import the Gel packaging key.
$
sudo mkdir -p /usr/local/share/keyrings && \
sudo curl --proto '=https' --tlsv1.2 -sSf \
-o /usr/local/share/keyrings/gel-keyring.gpg \
https://packages.geldata.com/keys/gel-keyring.gpgAdd the Gel package repository.
$
echo deb '[signed-by=/usr/local/share/keyrings/gel-keyring.gpg]' \
https://packages.geldata.com/apt \
$(grep "VERSION_CODENAME=" /etc/os-release | cut -d= -f2) main \
| sudo tee /etc/apt/sources.list.d/gel.listFor non-LTS releases of Debian/Ubuntu (e.g. Ubuntu Oracular), one can install
package for latest LTS release, because they are usually forward compatible.
To do this, replace the $(grep ...) with the name of latest LTS release
(e.g. noble).
Install the Gel package.
$
sudo apt-get update && sudo apt-get install gel-6CentOS/RHEL 7/8​
Add the Gel package repository.
$
sudo curl --proto '=https' --tlsv1.2 -sSfL \
https://packages.geldata.com/rpm/gel-rhel.repo \
> /etc/yum.repos.d/gel.repoInstall the Gel package.
$
sudo yum install gel-6Disable SELinux.
$
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config$
rebootEnable a systemd unit​
The Gel package comes bundled with a systemd unit that is disabled by default. You can start the server by enabling the unit.
$
sudo systemctl enable --now gel-server-6This will start the server on port 5656, and the data directory will be
/var/lib/gel/6/data.
gel-server cannot be run as root.
Set environment variables​
To set environment variables when running Gel with systemctl,
$
systemctl edit --full gel-server-6This opens a systemd unit file. Set the desired environment variables
under the [Service] section. View the supported environment variables at
Reference > Environment Variables.
[Service]
Environment="GEL_SERVER_TLS_CERT_MODE=generate_self_signed"
Environment="GEL_SERVER_ADMIN_UI=enabled"Save the file and exit, then restart the service.
$
systemctl restart gel-server-6Set a password​
There is no default password. To set one, you will first need to get the Unix socket directory. You can find this by looking at your system.d unit file.
$
sudo systemctl cat gel-server-6Set a password by connecting from localhost.
$
echo -n "> " && read -s PASSWORD$
RUNSTATE_DIR=$(systemctl show gel-server-6 -P ExecStart | \
grep -o -m 1 -- "--runstate-dir=[^ ]\+" | \
awk -F "=" '{print $2}')$
sudo gel --port 5656 --tls-security insecure --admin \
--unix-path $RUNSTATE_DIR \
query "ALTER ROLE admin SET password := '$PASSWORD'"The server listens on localhost by default. Changing this looks like this.
$
gel --port 5656 --tls-security insecure --password query \
"CONFIGURE INSTANCE SET listen_addresses := {'0.0.0.0'};"The listen port can be changed from the default 5656 if your deployment
scenario requires a different value.
$
gel --port 5656 --tls-security insecure --password query \
"CONFIGURE INSTANCE SET listen_port := 1234;"You may need to restart the server after changing the listen port or addresses.
$
sudo systemctl restart gel-server-6Connecting your application​
To connect your application to the Gel instance, you'll need to provide connection parameters. Gel client libraries can be configured using either a DSN (connection string) or individual environment variables.
Obtaining connection parameters​
Your connection requires the following components:
-
Host: The IP address or hostname of your server (e.g.,
localhost,192.168.1.100, orgel.example.com) -
Port:
5656by default, or the custom port if you changed it withCONFIGURE INSTANCE SET listen_port -
Username:
admin(the default superuser) -
Password: The password you set with
ALTER ROLE admin SET password -
Branch:
main(the default branch)
Construct the DSN using these values:
$
GEL_DSN="gel://admin:<password>@<hostname>:5656"Obtaining the TLS certificate​
If you configured Gel with GEL_SERVER_TLS_CERT_MODE=generate_self_signed,
your application needs the certificate to connect securely.
The generated certificate is stored in the data directory. You can find it at:
$
cat /var/lib/gel/6/data/edbtlscert.pemAlternatively, retrieve it using the Gel CLI:
$
gel --dsn $GEL_DSN --tls-security insecure \
query "SELECT sys::get_tls_certificate()"Using in your application​
Set these environment variables where you deploy your application:
GEL_DSN="gel://admin:<password>@<hostname>:5656"
# For self-signed certificates, provide the CA cert:
GEL_TLS_CA_FILE="/path/to/edbtlscert.pem"
# Or embed the certificate content directly:
GEL_TLS_CA="<certificate content>"Gel's client libraries will automatically read these environment variables.
Local development with the CLI​
To make your instance easier to work with during local development,
create an alias using gel instance link.
The command groups gel instance and gel project are not
intended to manage production instances.
$
gel instance link \
--dsn $GEL_DSN \
--non-interactive \
--trust-tls-cert \
my_bare_metal_instanceYou can now refer to the instance using the alias my_bare_metal_instance.
Use this alias wherever an instance name is expected:
$
gel -I my_bare_metal_instanceGel x.x Type \help for help, \quit to quit. gel>
Or apply migrations:
$
gel -I my_bare_metal_instance migrateUpgrading Gel​
When you want to upgrade to the newest point release upgrade the package and
restart the gel-server-6 unit.
Debian/Ubuntu LTS​
$
sudo apt-get update && sudo apt-get install --only-upgrade gel-6$
sudo systemctl restart gel-server-6Health Checks​
Using an HTTP client, you can perform health checks to monitor the status of your Gel instance. Learn how to use them with our health checks guide.