Move to my own domain with OVH and Netlify
Welcome
Long time no see. Due to the last 2 months, I had some changes in my personal life. I’ve become a Solution Architect in a nice polish company. If you or your friends need some RedHat implementation here is the link. What will change here? I hope nothing. Still a lot of CI/CD topics, more Kubernetes(with OpenShift), maybe some serverless with Knative and quarkus. Ahh and some new tools. Linode as a cloud service and Pulumi as Terafrom’s replacement. Unfortunately, today I will be focusing on setting up my own domain on different hosting without Github Action.
Tools/services used in this episode
- ovh.pl
- netlify.com
- gitlab.com
- dig/curl/openssl
Buy own domain
Domains are cheap. Not all of them, but mine was - 14$. I’m based in Poland, so I decided to use OVH. Renewal prices are reasonable, a lot of people are happy with them, so it’s only 14$. The step-by-step guide looks like that:
Go to their site
Find a dream domain name
Just click ’next’ a few times, but read the text on the screen
Make sure that the provided data are correct
And just buy a domain
It’s an easy process, I was surprised how easy I can buy my first private domain
Netlify as free hosting
Netlify has four different pricing plans, but for small webpages, blogs or a pet project free plan is more than enough. It’s easy to run, the web console is clean and readable. Blablabla, nothing special. The biggest pros of Netlify is almost out-of-the-box integration with Hugo. I’d like to describe it:
Add just one small file into repo(copied from doc)
[build] publish = "public" command = "hugo --gc --minify" [context.production.environment] HUGO_VERSION = "0.78.2" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" [context.split1] command = "hugo --gc --minify --enableGitInfo" [context.split1.environment] HUGO_VERSION = "0.78.2" HUGO_ENV = "production" [context.deploy-preview] command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" [context.deploy-preview.environment] HUGO_VERSION = "0.78.2" [context.branch-deploy] command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" [context.branch-deploy.environment] HUGO_VERSION = "0.78.2" [context.next.environment] HUGO_ENABLEGITINFO = "true"
Login into service
Click
New site from Git
Connect with repo - I’m testing it with GitLab and it’s working
Then click
Deploy site
and that is it - deployment started
Connect app to domain
Netlify
- Open Netlify Web Console
- Go to
Domains
andAdd or register domain
- Add your domain name in my case
3sky.dev
(withoutwww
orhttp/https
) Click next
until you will see four DNS servers names.- Save it.
OVH
- Go to OVH web console
- Go to
Domain
andDNS zone
, thenAdd an entry
- Choose
A
record type - As a target put Netlify LB IP - now it’s 104.198.14.52
- Save the changes
- Now we need to wait for DNS propagation, it can take from 20minuts to 24h
Summa…SSL
Ahh the SSL, we need it. Especially because it’s *.dev domain, so we need https
.
Luckily Netlify takes care of that almost automatically. Just enable it in HTTPS
tab,
under Domain managment
section. That’s all. It’s a free Let’s Encrypt certificate.
Simple test
Dig it
$ dig 3sky.dev +short 104.198.14.52
$ curl -i https://3sky.dev HTTP/2 200 cache-control: public, max-age=0, must-revalidate content-type: text/html; charset=UTF-8 date: Mon, 15 Nov 2020 21:17:37 GMT etag: "6d2c65136f31d13166ffb3c6a5da2c77-ssl" strict-transport-security: max-age=31536000 age: 0 server: Netlify x-nf-request-id: d640bb4f-fdde-477b-88d5-3d142895ba23-24195284
openssl s_client -connect 3sky.dev:443 CONNECTED(00000003) depth=1 C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 verify return:1 depth=0 CN = *.3sky.dev verify return:1 --- Certificate chain 0 s:CN = *.3sky.dev i:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 1 s:C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3 i:O = Digital Signature Trust Co., CN = DST Root CA X3
So sweet, page is reachable, status code is correct and SSL looks valid.
SEO
It will be nice to be more visable. I’d like to invest some of time in SEO stuff. That’s really new thing for me, so I started from Google Search Console. Maybe that’s wrong way, but I’m fresh here. How to configure it? It’s easy.
Google Search Console
- Go to Web Console
- Fill
Prefix of URL
in my casehttps://3sky.dev
- Then get verifivation code started with
google-site-verification=
- copy it
OVH Console
- Go to OVH consol
- Navigate to your domain and
DNS zone
tab - Click
Add a Entry
- Choose
TXT
record type - Click
Next
- Leave subdomain filed (in my case) empty
TTL
set as default valueValue
- here past whole verifivation code from Google Site- Save it
Testing
We need to wait for the change. We can check it manually with dig
$ dig +nocmd +noall +answer 3sky.dev TXT @dns113.ovh.net
# 3sky.dev - my domain name
# TXT - record type, we can use A or MX as well
# dns113.ovh.net - DNS server for me it's dns113
3sky.dev. 600 IN TXT "1|www.3sky.dev"
3sky.dev. 600 IN TXT "v=spf1 include:mx.ovh.com ~all"
3sky.dev. 600 IN TXT "google-site-verification=rsddddddddddddddddddddddddddd"
When you see similar output you can go back to Google Search Console and verify you webpage. After that, you need to wait again… and try to learn about SEO in meantime - GOOD LUCK. Maybe I will post about that.
Summary
My own domain. It’s like home on the internet, my home. This feeling is definitely worth 14$.
Also, I’m very surprised by Netlify. I have read about it in past, but I linked it with
JavaScript ecosystem and npm install
on the workstation. Now it’s almost no-code
solution.
My workflow is growing. I started with manual git push
to GH Pages repo, then I add
custom scripts for deployment. Next, I tried some CI/CD tools, I fall in love with GitHub Action,
but I had some issues with publishing and building, especially after a long break. Now I have a stable
and easy maintenance solution, which allows me to focus on writing. In general, it’s an important
lesson. Only war never changes, the rest parts of the world do. The Tech industry changes even faster,
so good choices are critical in a long term project. Good design and planning are the keys. I
know - it is very hard, also nobody has a glass ball. On another hand that’s the reason why I’m here
on this blog. I’m trying to learn and be a better specialist every day, maybe that is the key?
I will see where I will be in 2025? or 2030?