Skip to main content

Complete guide to setting up your first virtual private server (VPS) at Hetzner

·10 mins
Recommended basics: Articles you should know

To get the full picture of this article, you should know about this topics:

(optional)

Effortless Website Hosting on a Budget with Namecheap

Discover how to effortlessly host your website on a small budget with Namecheap's shared hosting. Explore the process from selecting a plan to configuring SSL, and learn to upload your site for a seamless online presence.

Domain Name System (DNS)

Discover how the Domain Name System (DNS) works and why it's crucial for managing domain addresses. This guide covers DNS server hierarchy, zone files, entry types, and caching, making it an essential read for developers, sysadmins, and self-hosters.
(optional)

Node.js - JavaScript in Server Applications

Learn how to use Node.js to run JavaScript on the server side, from basic CLI applications to serving dynamic websites. Perfect for developers, sysadmins, and self-hosters.

You may also want to use the content map to find interesting articles that play into this one.


Ready to move beyond shared hosting? Setting up your first VPS opens doors to unlimited possibilities. You can host any application, run background services, and gain complete control over your server environment.

A virtual server, as the name can tell already, is not a physical / real server, but “a part” of it’s resources. So there’s a real server somewhere, and you get some of it’s resources as it would be a real computer with said resources. This is called virtualization. I will not go into details about virtualization in this article.

For many years I avoided VPS because they come (or at least came) with some caveats, but world has changed and also my style of administration. In this and future articles I’ll demonstrate how I manage my VPS in a way that I feel save enough to use them. My interest in using VPS is the cheap costs that allows me to run certain pet-projects without big worries.

Again: This is an intro article. On reliable.codes you’ll find (soon) more articles on this topic, just checkout the server articles or the content overview.

Receive high-quality, ad-free updates on software development. Sign up for our free newsletter today!

Criteria for selecting a VPS Package #

There’s a ton of service providers for VPS out there. If you need to pick one, dont do what everybody is doing (incl. me). Think about your needs and reduce every hoster on your list by this criteria. From what’s left, you can pick one.

Here’s my list of criteria for the current scope:

  • SSD storage
  • Traffic limits
  • Custom images
  • Console access (often called KVM / KVM over IP)

For this article, just the console is important (I’ll not cover SSH for now). Everything else is irrelevant.

Choosing the right VPS Package on Hetzner #

Visit hetzner.com and go to the “Cloud” section. Hetzner has multiple categories of VPS and within each category the offer multiple ressource configurations. Also, Hetzner is running Datacenters in different countries, you can select this as well.

For this demo I’ll go with the cheapest VPS, currently the CX22.

Order your first VPS #

To order, you’ll need to be logged in. I’m working with Hetzner since 2017, so I have an account already. After registration, login to “Console” to get an overview about your projects.

In many cases you can just go with the “Default”, but if you have clients or do run multiple businesses, you may wanna create multiple projects. Projects are free, you just pay the server resources you’re using. For this article I just created a new project “My first VPS”.

New, empty Hetzner console project
New, empty Hetzner console project

Now click the “Create Resource” button and select “Server”:

Add new server resource
Add new server resource

On this single screen now you can configure all needed settings:

Add new server to project
Add new server to project

First it can look overwhelming, but let’s walk through the several settings. In this article, I just talk about some settings, I’ll likely write in more detail in additional articles soon.

Receive high-quality, ad-free updates on software development. Sign up for our free newsletter today!

Location #

As said, Hetzner steadily increases their datacenters and spreads them across several countries. Click one of the listed locations and move on. I will go with Nuremberg (DE).

Be aware: Pricing differs between regions.

Image #

Now you can select which Operating system (all Linux by default) you want this VPS to be pre-installed with. You can also select from a list of apps so that the whole VPS will be pre-configured to run the selected app. I’d not recommend that.

With reliable.codes I work on explaining the several pieces of information that combine together so you can achieve complex goals. It would be easy now to let Hetzner pre-configure your VPS to run any of the listed apps, but you would not know anything about that system and after ordering the VPS you would be responsible to maintain it. I personally don’t think this is a good idea, if you’re not just testing around.

I will go with Debian 13.

Type #

One of the things I like at Hetzner is that they offer several needs. While hosters usually advertise premium tier always, with Hetzner you find also lower quality solutions and they will inform you about that. That’s ideal for my pet projects, because I don’t need to be highly available and what not, I just need a cheap VPS to play around.

In the “Type” section you can select between shared vCPU and dedicated vCPU. Also you can pick between architectures. I personally go with “Shared vCPU”, “x86” and the CX22 for less then $4 per month.

SSH keys #

In this article we’ll work with the VPS via the Console, so I do not cover SSH keys right now. If you want to access the VPS remotely, do not skip this part.

Receive high-quality, ad-free updates on software development. Sign up for our free newsletter today!

Backups #

If this is your first VPS and you plan to do some serious work with it, I’d highly recomment paying for daily automatic backups. They basically copy the full VPS in the background and in case of any big trouble, you can reset to the last backup with a click on a button.

If I’d had that in my early days, that would have helped me a lot. Nowadays I do not use this, I have my own solution.

Name #

Finally, you can define the hostname of that VPS.

Recap: Order VPS in 6 clicks #

You just clicked 6 times, defined a hostname and now you’re ready to go. Just confirm with “Create & Buy now” and your new VPS should be available within 3 minutes.

Confirm creating a new VPS
Confirm creating a new VPS

Manage your first VPS #

Once you have set up your first VPS, your Hetzner console should show the VPS with some basic information. The list would show multiple VPS as soon as you order additional instances.

Hetzner console project server list
Hetzner console project server list

You can click any of the listed server instances to get more details and interact with it.

Review server information #

The default view for server details is the “Overview”. Here you’ll see the allocated resources, some price information and the outbound traffic (data send from server to public internet).

Also, you see a list of recent activities with this server.

Hetzner VPS Overview
Hetzner VPS overview

Also in some information you would like to review the “Graphs” tab, where you can see information about current (or past) CPU-, disk- and network usage.

Hetzner VPS Graphs
Hetzner VPS graphs

Power off / on your server #

In the “Power” tab you’ll find buttons to shutdown your VPS. This can become handy, if every other option is not possible for whatever reason.

Be aware to go with “Shutdown” first. This will technically inform the system to gracefully shutdown. This is a safe way to make the server shutdown. If this fails as well, you virtually can pull the power cord by clicking “Power off”. This will finally lead to your server is shut down, but may end up in some data loss / inconsistency.

Hetzner VPS power off options
Hetzner VPS power off options

For many interactions, Hetzner works with confirmation dialogs. If you are used to what you do, you can skip this dialog by holding Shift when clicking buttons.

Hetzner VPS power off dialog
Hetzner VPS power off dialog

If your server is powered off already, this view will offer you to power it on, for sure:

Hetzner VPS power on options
Hetzner VPS power on options

Rebuild server #

If you ever find yourself in a situation where you want to “start from scratch”, instead of deleting this server and create a new one, you can let Hetzner rebuild the system. The option to do so you can find in “Rebuild” tab.

Hetzner rebuild VPS options
Hetzner rebuild VPS options

Be warned: This will wipe all data on that VPS.

Access your VPS via console #

As said at the beginning, in this article we’ll access the VPS via the console. Normally this is an edge case and you rather would use SSH, which I’ll cover in another article soon.

Receive high-quality, ad-free updates on software development. Sign up for our free newsletter today!

Knowing how to use the console on the other hand can help you in some other situation where maybe SSH service is down. So let’s directly jump into it.

Once you click the “Console” button or select Actions > Console, a new tab opens.

Hetzner console button
Hetzner console button

Hetzner console view
Hetzner console view

Change password on first login #

You have received information about the login user and password by mail from Hetzner directly after you created the VPS. The initial user usually is “root” and the password is created dynamically.

Once you login for the first time, you need to change your password right away.

Change password on first login
Change password on first login

Be warned: The keyboard layout may not match to your computer.

Save the chosen password on a save place.

Change keyboard layout #

This is totally optional, but may save you some energy in the future if console is the only way to deal with your system. To ensure your VPS keyboard matches the one of your computer, you can configure it with this command:

1
dpkg-reconfigure keyboard-configuration

I’m working on a MacBook with germany keyboard (QWERTZ), so I select this options:

  • Keyboard model: Apple
  • Keyboard layout: Other > German > German
  • Key to function as AltGr: Default
  • Compose key: None

Now reboot the system with this command

reboot

Update your system first #

Once you changed the password, let’s ensure everything is up to date. You can do this by running these two commands:

1
2
apt update
apt upgrade

These commands are specific for Debian, if you select another operating system, commands can vary.

Deploy your first application on VPS #

The whole point of a vServer / VPS is to be able to run whatever you want. In the article about Node.js we’ve run a local webserver hosting “hello world” (with Node.js). Since it was running locally, it had no public access. Now let’s use this VPS to host it publicly.

In case you're interested, read more about Node.js

Node.js - JavaScript in Server Applications

Learn how to use Node.js to run JavaScript on the server side, from basic CLI applications to serving dynamic websites. Perfect for developers, sysadmins, and self-hosters.

First, we need to install Node.js:

apt install nodejs

Next, we need to create the application. The easiest way, since we work in console and keyboard layout may not work, is to download the file to a local repo, you can do this with this command:

1
curl -o app.js https://reliable.codes/2025-10-09/app.js

You can show the downloaded file content with this command, if you like:

cat app.js

If you copy the code instead of downloading, replace localhost with 0.0.0.0. Using 0.0.0.0 is important so Node.js really listens to incoming requests from the public internat.

If you're unsure what to replace, you should read a little about the URL schema

Finally, we can run the application now:

node app.js

You should see the output Server running at http://0.0.0.0:8080. To access the application, you need to open that URL, but to replace 0.0.0.0 with the IP of your VPS, that Hetzner is showing in the VPS details, in my case 91.98.20.225.

Access your application running on the VPS
Access your application running on the VPS

Using a domain, instead of an IP #

Accessing your app via an IP is very uncommon. You easily can use a real domain name by simply pointing towards your IP, using an A or AAAA record. There’s no need to change anything on Node.js.

If you're unfamiliar with DNS

Domain Name System (DNS)

Discover how the Domain Name System (DNS) works and why it's crucial for managing domain addresses. This guide covers DNS server hierarchy, zone files, entry types, and caching, making it an essential read for developers, sysadmins, and self-hosters.

Your (maybe bumpy) first VPS experience #

If today was your first day working with a Linux server, congratulations that you made it so far. I hope you saw that thanks to all the features that Hetzner provide for managing your VPS, you basically cannot do anything wrong.

The worst case would be you need to reset the VPS and start from scratch. For this article I did it three times (not because I failed but I wanted to redo and take better notes).

Get your handy dirty, as long as you’re learning, don’t hesitate to do anything wrong.

Oliver Lippert
Author
Oliver Lippert
I pay attention to the details. I think deeply about the purpose of functions, the clarity of variable names, and the importance of commit messages. Long-term thinking is crucial. Writing code is straightforward, but projects become more challenging as they grow. With over 15 years of experience, I’ve gained insights that I apply in coding, code reviews and business discussions.