Last updated on June 9th, 2022 at 06:00 pm.
Watch the video above to learn how to use Hetzner to deploy your server, SSH into the Hetzner server and so much more.
This Youtube video is a hetzner tutorial for beginners.
Video captions for Hetzner Tutorial
What is Hetzner
What is Hetzner? Hetzner Cloud is a cloud hosting provider. You can rent servers on Hetzner and use them to host your website, web application, mail server application, basically whatever you need to do with your web server.
Hetzner Server products
There are different types of servers that you can get from Hetzner . There are dedicated servers . There are also different types of dedicated servers that you can look at.
And then there’s cloud. If you’re interested in VPS(Virtual private Servers) come to Hetzner cloud. If you’re looking for VPS hosting then this is where you’d come. You’ll just go to cloud and then come down here where you can look at the different prices.
Under cloud there are also shared resources and dedicated virtual CPUs . With VPS there are usually two types ; there’s VPS whereby all the people in the same server, That is in the same virtualization network will be sharing the resources. And that is where you have the standard cloud servers which are shared VPS. Shared VPS is still better than shared web hosting, This is very different. This is a shared VPS. It’s like renting your own server and then installing whatever you want on the server.
Then Dedicated. Here you have dedicated virtual CPUs. These are virtual CPUs but they’re dedicated which means that the two virtual CPUs that you’ll get will be dedicated to you and you will not be sharing that with anyone else. You can look at the different prices for dedicated cloud.
We’re going to go into the Hetzner dashboard and we’re going to see how to deploy a server . And then see how to log into that server.
Other things that are available here on Hetzner. You have web hosting. This is shared hosting. You can get that from there. There are also other services. You can see there’s load balancing, domain registration and all these other options. If you want to use Hetzner as your DNS provider you can do that there.
If you don’t have an account, I’ll put the link in the description. You can then set up your account. Once you set up your account, you can log in. You can log into the dashboard and we’re going to see what the dashboard looks like in a moment .
Dashboard / Admin area
Just come down here and sign up. You can also go all the way to the top, and then you can log in if you click there on cloud. Unfortunately I’m already logged in. If you’re not logged in you can just create an account and then follow the processes that they will require from you to set up your account.
Before we even deploy a server, let’s talk about this dashboard because sometimes you may get confused when you’re in here. There are different services on Hetzner so if you want to go to any of the others, you can just click there and go wherever you want to go. For instance you can go to robot, This is where you’ll find the dedicated servers. If you want to deploy a dedicated server or you want to manage your dedicated servers you can find them under Hetzner robot.
If you come here under ordering you can see that my shopping cart is empty but you can choose all the different types of servers which are available here and deploy any one of them. That is under robot that’s where you get the dedicated servers.
And then onto DNS. If you want to manage your DNS using Hetzner you can set up your DNS records here just like you’d normally do on Cloudflare. you can add a new zone and then add all your DNS records if you want to use Hetzner to handle your DNS.
we can go back to cloud. Let’s go back to cloud. This is where you’ll find your VPS’s. if you want to set up a VPS this is where you’d come. The cloud. here if you want to deploy anything, you have to put it inside of a project. i’m going to set up a new project and let’s call it tutorials. I’m going to add a project. inside of this project if i click on it i can do different things. I can deploy any of these items that I want for this project. I want to first of all deploy a VPS cloud server. I’m just going to click on add server.
Choose a location for your server preferably choose a location that is most central for your visitors. And then the server image. you can deploy all these different types of linux operating systems, and you can also deploy these other applications. However if you want to host WordPress don’t deploy it through this, just follow my HestiaCP tutorial for how to install Hestia CP. That’s much better than this.
If you want a production environment, Debian or Ubuntu is okay . Or if you want to use a RHEL based operating system you can use RockyLinux or Centos. in this case let me just go with Ubuntu 22.04. if you deploy ubuntu 22.04 i have this post. you can come to my website bizanosa.com and just search for ubuntu 22.04 initial server setup. Then you can do all this to make sure your server is production ready. This is where I’m going to choose Ubuntu 22.04.
you can choose whether the server is going to be the standard cloud, which is basically shared or dedicated. normally you just want to start with one of these. This seems okay. I’m just going to select this which is three virtual CPUs and 4gb ram. then you can add a volume . volumes are basically additional disk. additional disk space for your server.
and then a firewall.o if you want to set up firewalls you can come somewhere here and create them. you can even do that later on. and then set up the various rules that you want for your server. Once you do that you’ll just attach it to the servers that you want for this firewall rules. For this you can just set firewall rules within your operating system or you can use the firewall feature that is available here on Hetzner. and this could be helpful if you’re running something like Kubernetes. you can set up the rules that Kubernetes requires and then deploy those rules across the different servers that you have on your cluster.
Additional features if you have some batch script that you want to run after the installation, you can do that there. if you want to enable backups you can enable backups. Note that backups as soon as they are enabled they will incur 20% additional cost on your server . I will deselect backups. I will also deselect user data.
And then SSH keys. if you come here you’ll see that i have a part for setting up SSH keys. you don’t have to do it here. The reason I usually don’t do it here is because I’m just going to disable the root user from logging into my server. So even if I set up SSH key for them, I would never log into my server using root. That’s one of the reasons why I usually don’t bother setting up the SSH key when I’m deploying a server. but maybe you want to use your root user for whatever application you want to run. that is on you. For me I usually don’t because I’m just going to set up a new user .And then for that new user I’m going to create SSH key authentication. and then I’m going to disable the root user from logging in.
Next, give the server a name. i want to do an example here just to see if this is going to change my server host name as well .if it changes the host name well and good. if it doesn’t then i will have to change the hostname later. The host name is important when you want to send email . and maybe you want to be removed from certain IP blacklists . You can set up your server hostname to be a fully qualified domain name and then use that domain name to link it back as reverse DNS and I’ll show you how to do that in another video. Sometimes when you get these IP addresses you’ll find that they’re blacklisted. The best way for you to go about it is just make sure that you set up DNS records for a fully qualified domain name. a fully qualified domain name (FQDN) is something like let’s say ubuntu4.example.com. you can use something like this as your server host name . I’m just going to leave this as a server name and I hope it changes the hostname as well. and I’m going to confirm that.
Once I’ve changed all the settings that I need to change. I’m just going to come back and see that I’ve selected everything the way that I want it. The server is okay. I didn’t set up any of that . I’m just going to deploy this server . You can also deploy multiple cloud servers. If you want to set up a Kubernetes cluster, you can deploy multiple servers with the same features like this. I’m just going to create and buy now .The good thing with Hetzner is that you’re charged on an hourly basis, monthly is about five euros but I will only be charged for the time that I’ve used it . If I use it for two days I will only be charged for the two days since I did not set up my SSH Key. I will have to go into my email and I will need to retrieve my username and my password so that I can log in via SSH. the next step, let’s login by SSH. Just a reminder, by the time you’re watching this video I will have deleted the server .don’t try to use any of these details because it will all be in vain. I will copy these details.
Copy. and I will paste them inside of this notepad for ease of access. I’ll just bring that on to the next screen. we want to log into the server. if you’re on windows you can log in by downloading and installing Git bash.
When you download git. Get Git from this website here gitt downloads. just search for Git downloads and go to this website. don’t download it from anywhere else. just from this website .Download it for windows . Once you install it just come into your windows start menu and then search for Git bash.
Search for git bash on your windows start menu. Open git bash and if you want to log into your server all you have to do is copy your IP address. and then we’re going to do SSH and the user was root
[email protected] IP address . Enter and then confirm.
Let me do that again. Enter and then I will have to type in yes.
When i type in yes, it’s going to add it to my host’s file. Your hosts file has all the allowed IPs and domains. basically trusted domains and ips. the next step, you have to enter the password and as i said, it was sent to your email. if you did it like i did it then it was sent to your email. and all you can do is paste it in here. when you paste it it won’t be visible it will be hidden. I’m just going to paste it. enter. you are now logged into the server.
As soon as you log in you need to change your password. i’m going to paste in the password again; for the current password. enter and then i’m going to put in a new password. use a new password.
retype the new password.
My password has been changed. Let me clear the screen by doing Ctrl + L. The next thing I can do is, I can try to update my server and since I’m already root I don’t need to use sudo. I can just do apt update && apt upgrade -y.
if there are any updates then it will download them automatically.
A new kernel is available. yeah of course i will update that one as well. enter. I’ll just leave it at default and i will press tab so that i can get to ok. Press tab and then enter .I’ve updated my ubuntu server. As I said if you want to do anything on the public environment with your ubuntu server or debian server then just come in here. I will add this link in the description and just follow the steps. I will create a video for all these steps for now. I still haven’t got the time but I will create that video for you. just follow all this and do all this because if you do this you’re going to make your server production ready. and that’s important otherwise you’ll make your server a bit vulnerable if you use it without doing most or some of these things. do everything on this list .
as a note if you do have debian .if you installed debian 10 or debian 11 you can follow with this post. I did try this with debian 11 from start to finish and everything worked well except for some places. I think it was the only one place where there was an application that didn’t exist for Debian . but it will work for debian. everything else on this list is going to work for debian. especially this will work for debian .all these other things will work. create a swap file. changing the SSH port ,all this will work on your debian environment .
Let’s come back here and I want to check my hostname to see if the host name is the same as that. If it is the same as that then when you’re creating your server, make sure you give your name something that is a fully qualified domain name. it could be a full domain or a subdomain. I used a subdomain. You can use a full domain if you want to. Let’s do host name.
This will show me my hostname. You can see that my host name has taken the first bit of this, but I actually want the hostname to be the entire thing. You can see that this is a problem for me. I can come here. Is there a place for changing the hostname? Change the server host name . i’m just going to copy this
Paste that in there and I want to copy this one as well.
Note that I’m using sudo but I don’t really need to use sudo since I’m still the root user.
Now if we do hostname, the host name should come back as that. Yeah that’s what we need to do . Once you do that you also need to come in here.
Let’s go into the Cloud server. Let’s do a bit more of this hetzner tutorial . You’ve seen the most important part; creating the server, logging into the server and you can follow along with the post I told you about if you want to set up your server and make it production ready.
You can see that there are all these other options. Let’s look at the most important ones. You can turn on or turn off your server. Maybe you’re experiencing an issue. Turn off the server for a while . However as long as it’s off and it’s still here you’ll still be charged . If you don’t want the server to be charged just come down here and delete it. This is also important you may need to log in with this. You can also log in with this. Use your ubuntu login. Right now I only have a root user.
Enter password for root.
There you go. You can also log in here and do stuff on this end. Get used to using terminal or git bash. It makes your work much easier.
Graph. You can look at the CPU usage and all these other things for your server backups. You can set up backups for your server . As I told you this is 20% more.
Then snapshots, you can also create a snapshot for your server. They’re charged at that per gb per month.
Then load balancers. If you want to load balance your applications you can look at that there.
Networking. I was telling you about reverse DNS . If you come here under networking for your server, you’ll edit the reverse DNS . You can change your reverse DNS to match the hostname that we chose for our server. I’m going to copy that. I’m trying to do all this as quickly as I can in this video. Paste and edit reverse DNS. Once you do this, copy. Let’s search for our rDNS.
I want to use mxtoolbox. It is here. I want to use the reverse IP lookup. I’ve just changed it now so i don’t know whether it’s going to register or I’ll need to wait. Let’s see if this is going to work now.
You can see that’s what we want . You want to make sure that your IP points to your domain hostname or your sub domain name. When you go to use something like Cloudflare you can add DNS records for that. That’s how you can change your reverse DNS . How you can change the rDNS for your server. Let’s see what else is here that we can look at. It’s very important to make sure you do that if you want to send mail on your server. This is important.
And then firewalls. You can set up firewall rules.You may set up rules that you can just attach on the different servers that you deploy . You can put firewall rules here. A good example is kubernetes. If you want to run kubernetes you know there are certain ports you need to allow, If you want to allow those ports you can just come in here add those rules. Example, TCP, maybe you want to allow port 1162 up to 1165. You can do that.
Let’s delete that and once we delete the empty one we can save. If you create your firewall rules you can add them onto the different servers that you have.
Volumes, if you want to add more space to your VPS you can use volumes.
Power, you can power off your server. You can shut it down or you can force it to shut down.
Under rescue you can rescue your server. Just go online and see how you can rescue an ubuntu server. I’m sure you’ll find some tutorials. You can also reset your root password if you forget it . Just come in here and reset it.
ISO images, maybe you want to install ISO images. If you have a specific operating system that you want to install. Perhaps you have a windows server. A windows server OS that you bought from somewhere else, and you want to use the license on Hetzner. You can do that and there are videos and tutorials for how you can do that to ensure that it is working with all the drivers correctly.
Perhaps you’ve outgrown your server so you want to increase the resources. You can do that. You can upgrade to 8gb. You may upgrade to that . You need to power off your server first so just click there and then you can upgrade to a bigger resource.
Maybe you’ve messed up. You know sometimes you mess up, you’re doing your initial server setup and you mess up. You try so many things. Then you consider that as a teachable moment and you tell yourself you know what, I’m just going to start again from scratch. That’s what this is for. You can come in here and reinstall the operating system. Let’s say I want to install debian.
Let me search for debian. I will choose Debian 11 and then I can choose to rebuild. All previous data on the disk will be lost . Everything will be lost. Add the name of the resource, copy that . Paste in there and then rebuild.
Down here we have delete.
If you don’t want to incur any more charges for your server, what you need to do is just come in here and delete the server. Once you delete it you will not be charged for anything for that server .
That’s pretty much the hetzner tutorial. If you want to use Hetzner, I hope this tutorial is going to guide you on how to use it .
If you have any questions feel free to let me know. I’m going to destroy the server. I don’t need it for anything else.
To delete the server just enter the name of the resource. I’m going to click delete server and as soon as I do that you’ll see that I no longer have any servers in my project.
And up here you can also switch to the different projects that you have on your Hetzner. That’s it for this tutorial. Most importantly once you set up your server, make sure that you come to this page and you set up your server from scratch. This is very important .
Also of note is that when you rebuild your server they will send you the email with all the login credentials of your root user. Your password, you’ll get that in your email and you can log into your new server once you rebuild it.
That’s pretty much it for this Hetzner tutorial for beginners. Until next time.
Recommended VPS Providers
Find out the VPS providers I recommend.