Tutorial: Provision a Hetzner VM

Last updated 2 min read
Report issue

Overview#

This guide will walk you through the process of provisioning a Hetzner Cloud VM and onboarding it to GritivaCore in under 10 minutes. By the end of this tutorial, you will have a fresh Hetzner CX22 VM running GritivaCore-managed scopes.

Prerequisites#

Before you begin, ensure you have the following:

  • Hetzner account details
  • VM specifications (CPU, RAM, storage)
  • Operating system choice
  • Access credentials (SSH keys, passwords)
  • Network configuration details

Hetzner Account Setup#

  1. Sign up at hetzner.cloud and create a project.

Required Tools#

  • A terminal application for SSH access.
  • Internet connection.

Provisioning a VM#

Step 1: Log in to Hetzner#

Log in to your Hetzner account.

Step 2: Create a New VM#

  1. Navigate to the Console.
  2. Click on 'Add Server'.
  3. Select the following options:
    • Image: Ubuntu 24.04 LTS
    • Type: CX22 (€4.51/mo)
    • Location: Germany Falkenstein
  4. Add your SSH key.

Step 3: Configure VM Settings#

Wait approximately 30 seconds for the VM to boot and note the public IP address.

Step 4: Accessing Your VM#

Use the following command to access your VM:

BASH
ssh root@<ip>

Confirm the fingerprint when prompted.

Step 5: Onboard to GritivaCore#

Onboarding starts on the VM, not in the panel: you install the agent over SSH, and the agent prints a connect code that you approve while signed in to gritiva.com. Keep the panel open in another tab.

Step 6: Install GritivaCore#

Paste the installer into your SSH session:

BASH
curl -fsSL https://gritiva.com/install-gritiva.sh | sudo bash

(https://get.gritiva.com/agent redirects to the same script.)

Then enrol the machine:

BASH
sudo /opt/gritiva/gritiva-agent setup

It prints a connect code of the form GRTV-XXXX-XXXX. Open https://gritiva.com/connect?code=GRTV-XXXX-XXXX, approve the machine, and name it hetzner-fsn-1.

Step 7: Wait for Installation#

Wait approximately 60 seconds, then check the agent on the VM:

BASH
systemctl status gritiva-agent
sudo /opt/gritiva/gritiva-agent health

Refresh the panel to see that your VM appears as Online. If it does not, journalctl -u gritiva-agent -n 100 will say why.

Step 8: Create Your First Scope#

Create your first scope in the panel: INFRA → Scopes → New scope, name hello, pick hetzner-fsn-1, 1 vCPU / 1 GB, isolation medium, network mode bridge. It goes creating → starting → running, and you can confirm it from the shell too:

BASH
sudo /opt/gritiva/gritiva-agent scope-status

Cost Summary#

  • Total cost: €4.51/mo for the VM + GritivaCore Free tier (3 VMs free) = €4.51/mo.

Cleanup#

To delete your server, go to the Hetzner console and remove the server. There is no commitment required.

Important Tips

Important Tips
For advanced users, consider reviewing the [Hetzner API documentation](https://docs.hetzner.cloud) for additional features. Remember to secure your SSH keys properly and include screenshots for each step to enhance clarity.