I think my last attempt at explaining how to set up a website for free was not detailed enough. Today my free one year trial of Google Cloud expired and I had to switch to a one year trial of Microsoft Azure. So here goes my guide on how to have a website like mine.


One Page Webpage

Most of you might just be happy with the sort of static page I have over at adityaarpitha.com describing your contact details, projects, etc. You don't even need to have access to a server to set this up. You can use a service like netlify and just point in the direction of your github repository containing the website.

img
Such a beautiful and free service! I highly recommend netlify.

But now you need to have npm installed in your computer and you need to google for gatsby themes and pick one that you like. I liked the one made by LekoArts.

I forked their repository and just made changes to the text. No need to do any coding here. You are working with plain HTML and the design is already done for you.

But then that is just a static site. I wanted to blog on my own subdomain. Among the options, I loved the design aesthetics of ghost, how it supported mathjax, lots of integrations (I am using disqus and zapier right now) and just the ease of setting it up.

So now how did I move from Google Cloud to Microsoft Azure,

img
I had exported all the posts in a single 1.4 MB JSON file.
img
Then I made sure to carefully close my billing account.
img
I can't have a 1500₹ monthly bill just to keep a small VM online
img
So I went over to my Github Student Pack and got it activated.
img
It was quick and easy, within seconds I had 7000₹ worth of credit in my account. 
img
You can go over and Bitnami has a free image of Ghost ready to deploy.

img
Now it is just a matter of clicking the blue buttons
img
I really should not be giving an image for these steps. But you are on the right track here.

img
Here you have to be a bit smart. I chose Asia region since I expect most readers of my blog to be from India. I took the B1s size since I want to stretch the 100$ credit all the way to 12 months.
img
Make sure you download your private key and save it somewhere safe (in fact it is best to make it secure)

Now that your Virtual Machine is up and running, you can go to Support + troubleshooting and then Boot Diagnostics, to click on the Serial Log tab.

img
Scroll down until you find the password

img
You can get the Public IP address for your VM from the Overview section.

Navigate to http://<YOUR PUBLIC IP ADDRESS>/ghost/ and use user@example.com as the username and the password you found above to log in.

Great! Now you should be seeing an irritating banner at the bottom right corner, you can get rid of that by

First connecting to this VM remotely by typing in,

ssh -i <FULL PATH TO PRIVATE KEY> azureuser@<YOUR PUBLIC IP ADDRESS>

The path should look like C:\Users\Aditya\GhostBlog2_key.pem' and your public address would be like 54.162.145.214.and then running the following command,

sudo /opt/bitnami/apps/ghost/bnconfig --disable_banner 1
the app name is ghost

and then

sudo /opt/bitnami/ctlscript.sh restart apache
since we are using apache server

Adding new DNS records

Now we need to make sure that people can reach the blog using an easy to remember name and not these weird numbers. So purchase a domain name from one of the many registrars out there.

I had done some searching and porkbun had both reasonable prices and good reviews, so I had gotten adityaarpitha.com for 5 USD in my first year and then they renewed it at 25 USD for two years. That is 360₹ then 900₹ per year.

img
You can save a bit in the long term compared to sites like godaddy where the price for renewal will be 1050₹ after the first 2 years. But it all depends on the name and extension you want.

So then no matter which registrar you pick. Once you own the domain, you can edit the DNS records to point your domain name to these public IP addresses.

img
Netlify would give you a custom subdomain to work with which you can override with your main domain. I chose the blog subdomain for my ghost VM, you can pick whatever you want.
img
Just set the domain you bought as your primary domain

By now your website is almost done. We just need to set up https redirection. So that we get a cute lock on all these modern browsers signifying all communication with this website is encrypted and no one can fake being this website.

Remember it can take up to 72 hours for the new IP address to propagate worldwide to all DNS servers, although it typically it only takes like 10 minutes. But don't worry if you see a warning like,

img
Just go to https://dnschecker.org/ and confirm which countries have not been informed yet

Once all the servers know to redirect people trying to go to your domain name to the public IP address of the Azure Virtual Machine, we can run the bitnami encryption tool.

img
Run the command sudo /opt/bitnami/bncert-tool

img
Now you should reupload the images for favicon, logo, author profile picture which would not be exported. You should have used imgur or embedded links to images on the web since the JSON just has text.

Now you can do so much more! You can check out integrations,

img
Download the default casper theme and add these lines to have comments available for all your posts.

Well with that you are ready to publish more blog posts! Let me know down in the comments if you faced any issue setting it up and what other modications you made to your website.