How I built this site
I built this site to learn, share and connect. To share and connect, a blog format made sense. To learn, I wanted to build it from the ground up, or at least as much as reasonable. I also wanted to keep costs low, ideally below 5 CHF/month, which is about 1/3 of the price of most site builders but without any of the limitations.
Tech stack
For the frontend, I went with Hugo, a static site generator written in Go. I feel like static sites are underrated these days. Raw HTML from the server is fast and efficient. I picked the beautiful hugo-paper theme and modded it a bit (contact form, multi-language support, sticky header, and a bunch of other tweaks).
I decided to add a backend for the contact form. I overengineered it on purpose and added an API layer with FastAPI and a database with PostgreSQL. The API backend will come in handy for future projects.
As a web server, I picked the industry standard Nginx. It serves the static files and acts as a reverse proxy, forwarding requests to the backend. I also added Certbot for free Let’s Encrypt SSL certificates.
To add some extra functionality and automation, I picked Umami as a free self-hosted web analytics solution that I put on a subdomain and Watchtower to keep container images updated. For email alerts, I used a SMTP relay in the API layer. Some shell scripts and cron jobs handle setup, certificate renewal, and backups.
For security, I set up an additional firewall with UFW and fail2ban for rate limiting and did some Linux hardening (SSH, users, etc).
Hosting and deployment
Infomaniak is a swiss based hosting provider and their VPS Lite solution comes in at 2.70 CHF/month. The Linux machine has 1 CPU, 2 GB RAM, and 20 GB disk space, with 500 Mb/s bandwidth. My domain with a couple additional security options cost about 60 CHF for 5 years, bringing the total to about 3.70 CHF/month. To deploy the site, I use containers with Docker compose, with every service running in its own container.
The takeaway
Building and VPS-hosting your own site is a great way to freshen up the basics. In data science and machine learning, infrastructure is often abstracted away by cloud providers, but understanding how the web works can still be important. And AI assistants really help speed up the process, although they have their limitations. They’re great to get started and to debug, but the moment complexity crosses a certain threshold, and even a small project like this did, they add a lot of noise and bugs and make things harder. As per my experience lately, it’s better to use them for the initial setup and then invest time to understand things properly.