Hosting blog.kushaagra.net from a Chromebook:- Setup and Architecture
Posted: 9/3/2025, 1:16:49 PM — Views: 36
This post describes how the blog, blog.kushaagra.net (or kushaagra.net) is built and self-hosted from a Chromebook. It summarizes the application stack, explains how the local server is exposed to the public via a Cloudflare Tunnel, and lists the operational constraints of running a site from a laptop.
This is a summary and explanation of:
* How the website backend works
* Local server tunneling
* Constraints of running a website from a laptop
1. Site and code overview:
This website is a Node.js application using express as the web framework. All the server sided templates are made and rendered using EJS, while static assets are served from a ~/public/ directory. Route handlers are housed in the ~/server/ folder and a small storage module (.json) file is used to persist posts (read and write) and uploads (handled using multer). Scripts include start script and dev script which uses nodemon for monitoring live updates during development (for longer-running or production-like runs, a process manager such as PM2 can be used). Additionally this website repository is available on GitHub- https://github.com/Kushagra000000/Blog-website. Feel free to create add features or create issues.
2. Local server, networking and Exposing with Cloudflare tunnel:
Locally, the express server listens on port 3000 (https://localhost:3000). Rather than opening router ports (which is impossible in my case, due to restrictions on accessing the router settings), cloudflared (Cloudflare Tunnel) is used to expose the local server securely.
Cloudflared opens an outbound TLS-encrypted connection to Cloudflare’s edge and advertises the public hostname. Incoming requests to the public hostname are proxied across that tunnel and delivered to the Express server on localhost:3000. This setup avoids manual router configuration and provides HTTPS at the Cloudflare edge.
(source https://developers.cloudflare.com/cloudflare-one/connections/connect-networks)
3. Domain and public hostname:
The domain blog.kushaagra.net (or kushaagra.net) is configured in Cloudflare DNS settings and associated with the tunnel so that custom domain resolves to the tunnel endpoint. blog.kushaagra.net (or kushaagra.net) points to the cloudflared tunnel, so the custom domain reaches the local site. DNS is like an internet’s phonebook, which is responsible in translating human-friendly domain names (like http://wikipedia.org) into machine-friendly IP addresses (like 93.184.216.34).
Once DNS and the tunnel are configured, public traffic to the domain is forwarded to the Chromebook over the cloudflared connection and served by the local Express app.
4. Operational considerations and constraints:
The server runs on a Chromebook (Series 500) for which we have the below constraints/features:
- The device uses Linux via Crostini (pre-configured in Chromebooks, and installed by enabling the developer mode), which provides a Debian-based environment for installing Node.js, npm, cloudflared and practically any other Linux package or development tool.
- The Chromebook must remain powered on, awake (disabled auto sleep/sleep when flap down), and connected to Wi‑Fi for the tunnel to stay active and the site to be reachable.
-Any network outage, system sleep, or shutdown will make the site temporarily unavailable. To monitor this, a discord bot application is currently in place called ‘UptimeRobot’ which constantly monitors for any outages and pings me subsequently.
- For a more robust deployment, considering to migrate to a small always-on machine (virtual private server (VPS) or a Raspberry Pi) might be more efficient.
5. Quick commands:
Start the app (dev)-
npm run dev
Start the app (node)-
node app.js
Start a one-off tunnel-
cloudflared tunnel --url http://localhost:3000
Check processes-
ps aux | grep -E "node|nodemon|cloudflared|pm2" | grep -v grep
Closing note:
This setup and configuration keeps the application and data on my own device (rather than GitHub pages, or google servers), while using Cloudflare to provide a secure public connection. It is well suited for low-traffic personal blogs (such as this one) and development demos.
I might consider creating new feature, uploading my resume, and building more onto this website as time progresses which might result in some maintenance breaks.
Comments
Leave a comment