Search...
ctrl/
Light
Dark
System
Sign in

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.

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.

Import the Gel packaging key.

Copy
$ 
  
  
  
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.gpg

Add the Gel package repository.

Copy
$ 
  
  
  
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.list

Install the Gel package.

Copy
$ 
sudo apt-get update && sudo apt-get install gel-6

Add the Gel package repository.

Copy
$ 
  
  
sudo curl --proto '=https' --tlsv1.2 -sSfL \
 https://packages.geldata.com/rpm/gel-rhel.repo \
 > /etc/yum.repos.d/gel.repo

Install the Gel package.

Copy
$ 
sudo yum install gel-6

The Gel package comes bundled with a systemd unit that is disabled by default. You can start the server by enabling the unit.

Copy
$ 
sudo systemctl enable --now gel-server-6

This will start the server on port 5656, and the data directory will be /var/lib/gel/1/data.

gel-server cannot be run as root.

To set environment variables when running Gel with systemctl,

Copy
$ 
systemctl edit --full gel-server-6

This opens a systemd unit file. Set the desired environment variables under the [Service] section. View the supported environment variables at Reference > Environment Variables.

Copy
[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.

Copy
$ 
systemctl restart gel-server-6

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.

Copy
$ 
sudo systemctl cat gel-server-6

Set a password by connecting from localhost.

Copy
$ 
echo -n "> " && read -s PASSWORD
Copy
$ 
  
  
RUNSTATE_DIR=$(systemctl show gel-server-6 -P ExecStart | \
 grep -o -m 1 -- "--runstate-dir=[^ ]\+" | \
 awk -F "=" '{print $2}')
Copy
$ 
  
  
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.

Copy
$ 
  
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.

Copy
$ 
  
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.

Copy
$ 
sudo systemctl restart gel-server-6

The command groups gel instance and gel project are not intended to manage production instances.

When you want to upgrade to the newest point release upgrade the package and restart the gel-server-6 unit.

Copy
$ 
sudo apt-get update && sudo apt-get install --only-upgrade gel-6
Copy
$ 
sudo systemctl restart gel-server-6
Copy
$ 
sudo yum update gel-6
Copy
$ 
sudo systemctl restart gel-server-6

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.