Posts in the Series
Part 1. Setting up Ubuntu Server with docker in Hetzner (this post)
Table of contents
In this post we will see how to setup a ubuntu server for our docker deployment.
- Hetzner cloud account
you can use the referral link here and get 20 Euro to play around. https://hetzner.cloud/?ref=ENhA4rCZ5JUM
Creating ssh key
we will use ssh key to login to the server. so lets first create a ssh key.
1ssh-keygen -t ed25519 -C "email@example.com"
this command will create a ssh key.
Create ubuntu machine with docker
For this we will the hetzner apps. Hetzner provides machine with docker CE. this will save us some time.
Add ssh key to hetzner project
Create the firewall for the server
IP address of our machine
Add DNS entry
Now you have to add a DNS entry for your newly created machine. you can fine the the IP address of the machine in the Hetzner server page.
We need to add
A record and a
1A XX.XX.XX.XX yourdomain.com 2CNAME * yourdomain.com
For example this is how my sample entry looks like
Record Host Value A youtube1 188.8.131.52 CNAME * youtube1.antosubash.com
This might take some time to reflect so wait for a while to verify it.
Verify DNS entry
To verify dns entry we will use a tool called dig.
you can find it here https://toolbox.googleapps.com/apps/dig/#A/
Make sure your domain is pointing to your ip and your subdomain is pointing to your domain
yourdomain.com -> XX.XX.XX.XX subdomain.yourdomain.com -> XX.XX.XX.XX
So both your domain and subdomain should point to the same IP Which is the IP of the machine we just created.
Update ssh config
ssh config file can be "~/.ssh/config"
In the config file add a entry for the newly created server.
1Host youtube1.yourdomain.com 2 IdentitiesOnly yes 3 IdentityFile ~/.ssh/yournewlycreatedkey # Not the pub file