Provision a Hetzner Server using our Custom Server Option

6 min read

Hetzner is a very interesting EU based hosting company that owns and operates several of its own datacentres in Germany and Finland. They’re solely EU based and their prices are very competitive. From what I’ve seen also have a very good reputation, and they’ve been around for a long time – founded in 1997.

Hetzner offers both dedicated servers and VPS servers (which they call “Cloud” servers), and they have VPS options that come with dedicated vCPUs and flexible storage.

In this article we’re going to provision a Hetzner Cloud Server (VPS) and then install GridPane from the command line. If you already have an account and servers at Hetzner you can skip to step 3.

Step 1. Create a Hetzner Account

Head over to https://www.hetzner.com and create an account if you haven’t already. I’m not 100% clear on whether approval is required to get started as I was almost immediately approved to start creating servers, but just know that there may be an approval process (and if there is, please do let us know and I will update this article accordingly).

Add your details and payment info and then we’re good to begin.

Step 2. Create a Project

Before you can create a server you first need to create a project.

From the dropdown in the top right, select “Cloud”:

You’ll be taken to their pretty cool dashboard, and here you can create a new a project:

Click the big red button and a modal will open to give your project a name – I’ve named mine GridPane, but feel free to choose whatever name makes sense for you:

And your project has been created:

Step 3. Create a Server

Now that we’ve created a project we can create our server. Click on your project and you’ll be taken to the following screen:

Click the red Add Server button to get started.

1. Location

Choose your preferred server location. Hetzner have server 2 locations in Germany and 1 location Finland. 

2. Image

Here it’s important to choose Ubuntu 18.04. GridPane will not work with any other platform/linux distribution.

3. Type

Choose your server type (VPS or dedicated) and plan.

4 and 5. Volume / Network

You can leave these two options empty.

6. Backups

We strongly recommend server backups. They’re excellent insurance, and they it’s entirely possible they may save you one day.

Backups cost an additional 20% of your server price (at the time of writing, but likely always), and do not include “Volumes”.

7. SSH Key

Add an SSH key if you wish to do so. This is the most secure way to connect to your server. 

As many new users don’t yet have an SSH key, I’ll provision this server with a password for demonstration purposes, and GridPane will lock down and prevent password logins in the future. In step 5 I’ll explain how to connect both via SSH and via password.

8. Name

Finally, give your server a name that makes sense for you and you’re good to go.

Finally check all your settings, check the price, and then when you’ve confirmed all is correct hit the Create & Buy Now button.

You’ll then see your new server in your servers page:

Step 4. Connect Your Server to GridPane

Back in your GridPane dashboard, click on Custom VPS from the servers page. Enter the name, IP, and the Datacenter name you wish to use.

Note: The Datacenter name is for your reference only, so feel free to give it a name that makes the most sense for you. As this examples server is in Falkenstein, we’ll go ahead and enter this.

Add Your Server IP

Add your server’s public IP address.

Choose Your Database

If you’re on the developer plan you’ll have the option to choose between Percona and MariaDB (currently BETA only) for your database.

Percona is based off the new MySQL 8. It has removed query caching (which was deprecated in 5.7 but was still available), and it has more advanced aspects for things like storing and managing JSON as a storage format. It will likely use more RAM than MariaDB.

MariaDB is still based on MySQL 5.7, which could mean fewer issues importing old WordPress websites from low-quality hosting environments. It will likely use less RAM than Percona.

Both are excellent options.

Create Your Server

Click the Create Server button when you are happy with your configuration choices.

Once you click Create Server, a popup modal will contain your root password and a command-line string. Copy that string and paste in into a text document – you’ll need it in a moment.

Step 5. Connect to Your Hetzner Server

If you added your SSH key, then you can connect to your server using your preferred terminal (Putty, Terminus, Powershell etc).

The first time you connect to any new server you’ll be prompted with a security alert about the servers fingerprint. Click Yes to continue.

If you didn’t add an SSH key then Hetzner will have emailed you the root password. You’ll need this now to login.

Connect Via Hetzner’s Console

Hetzner has an integrated console that you can use to connect to your server for the first time. You can find this on your servers page by clicking on the three dots on the right hand side of your server’s bar, and choosing console from the dropdown. This will immediately open the console in a new window:

Here first type:

root

And then enter the password that Hetzner emailed to you by right clicking inside the terminal and selecting Paste.

You’ll be forced to reset your password: –

  1. First re-paste the password Hetzner sent to you
  2. Enter your new password
  3. Re-enter your new password

You’re now good to go!

Step 6. Provision Your Server

Hetzner state that they now only ship with minimal images. We need to update it to full to ensure your server has everything we need, so before running our provisioning code.

1. Update Ubuntu from Minimal to Full

Run the following:
sudo apt-get update -y
Then run this to install full Ubuntu:
sudo apt install -y ubuntu-server

IMPORTANT

Hetzner sometimes changes the formatting of the code. For example, it will change https:// to https;//, or append http:// before https:// like this: http://https://provisioningcode….. If you receive an error after pasting, double-check that Hetzner hasn't made it's own changes to our code and try again.

2. Enter Your Provisioning Code

We’re now logged in as root and it’s time to paste in your provisioning code that you copied in step 4.

Right click > Paste and then press Enter. The code the will do the rest. A few minutes later you’ll see the following message in the image below, and you can then close the terminal by typing:

exit

Step 7. Wait for Approx 10 Minutes

You can monitor the rest of your servers provisioning progress inside the Servers page of your account. Approximately 10 minutes later it will be ready to use inside your GridPane account.

Congrats!