Building My Own Private Cloud: A Homelab Powered by K3s, Cloudflare, and Tailscale

How I turned a spare Debian laptop into a self-hosted platform for cloud storage, media streaming, downloads, and Kubernetes management.
Introduction
I've always found the idea of self-hosting fascinating.
There's something interesting about being able to run your own applications, manage your own infrastructure, and access your services from anywhere without depending entirely on third-party platforms.
Instead of paying for a VPS or buying dedicated server hardware, I decided to make use of something I already had: an old laptop.
What started as an experiment with Kubernetes gradually turned into a small self-hosted environment running multiple applications, complete with domain routing, encrypted remote access, persistent storage, and centralized management.
My current homelab runs on a single Debian laptop using K3s, Cloudflare Tunnel, Tailscale, NGINX, Traefik, and several self-hosted applications.
This article isn't a step-by-step installation guide. It's an overview of how I've structured everything, why I chose these tools, and some of the challenges I've encountered along the way.
The Architecture
At a high level, my homelab consists of three main parts:
- The server: A Debian laptop running a single-node K3s Kubernetes cluster.
- Public access: Cloudflare DNS and Cloudflare Tunnel for exposing selected applications over HTTPS.
- Private access: Tailscale for securely accessing and administering the server from my Fedora laptop.
Everything runs on one physical machine, but Kubernetes allows me to organize the applications as separate workloads, each with its own configuration, services, networking, and storage requirements.
The overall architecture is relatively simple, but there's quite a bit happening underneath.
1. The Hardware: Giving an Old Laptop a Second Life
The foundation of the entire setup is a spare laptop running Debian Linux.
It has approximately:
- 8 GB RAM
- 285 GB of disk space
- A conventional laptop CPU
- A single Kubernetes node
It's not particularly powerful hardware, but that's part of what makes the project interesting.
For applications that aren't handling hundreds of concurrent users, a machine like this can be surprisingly useful.
I chose Debian because I wanted a lightweight, stable operating system without unnecessary desktop services competing for resources.
The machine operates as my home server, while my primary Fedora laptop is my development and administration workstation.
One advantage of using a laptop as a server is the built-in battery, which can provide a short buffer during power interruptions. However, it's not a substitute for a proper UPS or a reliable shutdown strategy.
Another consideration is power management. A laptop that automatically suspends when its lid closes isn't much use as a server, so sleep and lid-close behavior matter.
The hardware isn't impressive, but it has been enough for experimenting with a real container orchestration environment.
2. K3s: The Heart of the Homelab
Instead of deploying every application directly on Debian or managing a collection of standalone Docker containers, I wanted to experiment with Kubernetes.
However, installing and maintaining a full Kubernetes distribution on a single laptop seemed unnecessarily heavy.
That's where K3s came in.
K3s is a lightweight Kubernetes distribution designed to make Kubernetes easier to deploy and operate, particularly on smaller machines and edge environments.
It provides the Kubernetes components I need without requiring a large multi-node infrastructure.
My setup uses a single-node cluster where the same machine handles the control plane and application workloads.
Why Kubernetes for a small homelab?
To be clear, Kubernetes isn't required for a setup this small. Docker Compose would probably be simpler for many of the same applications.
But I wanted more than a place to host software.
I wanted an environment where I could experiment with concepts such as:
- Deployments and pod lifecycle management
- Kubernetes Services and internal networking
- Ingress controllers
- PersistentVolumes and PersistentVolumeClaims
- Namespaces and resource isolation
- Declarative configuration
- Helm and Kustomize
Each application lives in its own namespace, which makes the environment easier to understand and manage.
For example, Jellyfin, Headlamp, Nextcloud, and Gopeed each have dedicated namespaces. Nextcloud's database runs alongside it in the same namespace.
This separation doesn't turn one server into multiple physical machines, but it does create useful logical boundaries.
I can inspect logs, restart a deployment, troubleshoot networking, or modify one application's configuration without having to treat the entire server as a single monolithic service.
There's also something satisfying about having applications defined as Kubernetes manifests rather than relying entirely on manual installation commands.
3. The Applications Running on the Cluster
The cluster currently includes four main self-hosted applications, along with supporting infrastructure.
Jellyfin — My Personal Media Server
Jellyfin is an open-source media server that lets me organize and stream my own media library.
I use Kubernetes to manage the Jellyfin application while keeping its configuration, cache, and media files on persistent storage.
The actual media directory is mounted into the container from the server's filesystem.
This means that replacing or restarting the Jellyfin pod doesn't require recreating the media library.
Jellyfin also retrieves metadata such as posters, descriptions, and other media information, making the experience feel more like a personal streaming platform.
It's a useful example of how a containerized application can be disposable while the underlying data remains persistent.
Nextcloud — My Personal Cloud Storage
Nextcloud is another major component of the setup.
It's my experiment in running a self-hosted alternative to cloud storage services.
The deployment consists of two main components:
Nextcloud: The web application, responsible for the user interface, file management, and application features.
MariaDB: The relational database used to store Nextcloud's metadata and application information.
Both run as workloads in the Kubernetes cluster.
Nextcloud also uses persistent storage to keep its files independent of the container lifecycle.
This service has been one of the more challenging applications to configure, particularly around reverse proxy behavior, HTTPS, background jobs, and external access.
It's also been one of the most educational parts of the homelab.
Headlamp — Managing Kubernetes Through a Web Interface
While I can manage everything using kubectl, I also wanted a graphical way to inspect my cluster.
Headlamp provides a Kubernetes dashboard where I can view workloads, inspect deployments, check pod status, examine logs, and navigate resources.
It's particularly useful when I want a quick overview without opening a terminal.
Headlamp uses Kubernetes authentication and RBAC, which introduced me to ServiceAccounts, roles, role bindings, and access tokens.
It's important to distinguish a management dashboard from a full monitoring stack, though.
Headlamp is useful for inspecting the current state of Kubernetes resources, but it doesn't replace historical metrics, centralized logging, or alerting systems.
Gopeed — A Self-Hosted Download Manager
Gopeed is a more recent addition to the homelab.
The idea is straightforward: instead of relying on my main laptop to handle lengthy downloads, I can submit download tasks to a service running on the Debian server.
Gopeed supports regular downloads and BitTorrent tasks.
This is especially useful for files that take a long time to download or that I'd rather keep separate from my everyday computer.
The longer-term idea is to use the server as a central download location and transfer completed files to external storage when needed.
It's a relatively simple application compared with Nextcloud, but it fits nicely into the overall self-hosted environment.
4. Cloudflare Tunnel: Making My Applications Accessible
One of the most important parts of the setup is how the applications become accessible outside my home network.
Traditionally, exposing a service running on a home server involves configuring router port forwarding and directing traffic toward the server.
I wanted to avoid that.
Instead, I use Cloudflare Tunnel.
My domain's DNS is managed through Cloudflare, and I use subdomains to separate my applications.
For example:
| Application | Example domain |
|---|---|
| Jellyfin | jellyfin.server.com |
| Nextcloud | nextcloud.server.com |
| Headlamp | headlamp.server.com |
| Gopeed | gopeed.server.com |
These are illustrative domains rather than my real addresses.
On the Debian server, I run cloudflared, the Cloudflare Tunnel connector, as a systemd service.
It establishes an outbound connection to Cloudflare's network.
When someone visits one of my application domains, Cloudflare receives the HTTPS request and forwards it through the tunnel toward my server.
The request is then handled by the appropriate ingress controller and routed to the application.
The major benefit is that I don't need to open inbound ports on my home router just to expose these web applications.
Cloudflare handles the public-facing HTTPS connection, while the tunnel provides connectivity back to my infrastructure.
That doesn't automatically make every application secure, though. Individual application authentication, access policies, and careful exposure of administrative services are still important.
5. NGINX and Traefik: Routing Traffic Inside Kubernetes
Cloudflare Tunnel gets traffic to my home server, but Kubernetes still needs to know which application should receive each request.
This is where ingress controllers come in.
K3s includes Traefik by default, and that was the first ingress controller I used.
Traefik handled routing for applications such as Jellyfin, Nextcloud, and Headlamp.
The routing is based on HTTP hostnames.
For example, a request for jellyfin.server.com should reach Jellyfin, while nextcloud.server.com should reach Nextcloud.
Kubernetes Ingress resources describe these rules, and the ingress controller implements them.
Why I introduced NGINX
During the setup, I encountered intermittent external access problems, especially with Nextcloud and Headlamp.
At times, an application responded quickly when accessed locally but behaved very differently through its public domain.
Nextcloud, in particular, experienced Cloudflare 524 timeouts during some login and page refresh operations.
I tested different parts of the request path to narrow down where the problem might be occurring.
Eventually, I introduced NGINX Ingress Controller for Nextcloud and later used it in the Gopeed setup as well.
This gave me another routing configuration to experiment with, independently of the original Traefik setup.
The result is an environment where Traefik and NGINX have both been used for ingress management, with different applications assigned to different controllers.
I wouldn't necessarily recommend running two ingress controllers in every small homelab. A single controller is usually simpler.
In my case, the additional controller came out of practical troubleshooting and experimentation.
And importantly, changing an ingress controller isn't proof that the controller was the original cause of a timeout. It was one part of investigating a longer network and application request path.
6. Tailscale: Private Access Without Public SSH
Cloudflare Tunnel solves the problem of accessing web applications over the internet.
But I also need a way to administer the server itself.
For that, I use Tailscale.
Tailscale creates a private mesh network between my devices using WireGuard-based encrypted connections.
Both my Fedora laptop and the Debian home server are connected to the same tailnet.
This allows me to SSH into the Debian server and manage Kubernetes without exposing SSH directly to the public internet.
My typical administration workflow looks like this:
Fedora laptop → Tailscale → Debian server → K3s
Once connected, I can run kubectl, use Helm, inspect application logs, and manage Kubernetes resources.
I can also use SSH port forwarding when I want to access an application locally without relying on the public domain.
One of the things I appreciate about this arrangement is the separation of responsibilities:
- Cloudflare Tunnel handles public application access.
- Tailscale handles private infrastructure access.
These are two different networking problems, and using separate tools for them keeps the design easier to reason about.
7. Persistent Storage: Keeping Data Beyond the Pod Lifecycle
Running applications in Kubernetes introduces an important question:
What happens to the data when a pod is deleted or recreated?
Containers are designed to be replaceable, but the data stored by services like Nextcloud, Jellyfin, and MariaDB needs to survive.
My K3s cluster uses the default local-path StorageClass for persistent volumes.
Applications request storage using PersistentVolumeClaims, and K3s provisions storage on the Debian server's local filesystem.
For example:
- Jellyfin stores its configuration and cache persistently, while its media library is mounted from a host directory.
- Nextcloud keeps application files in persistent storage.
- MariaDB stores its database files on a persistent volume.
This allows Kubernetes to replace a failed or restarted pod without automatically losing the application's persistent data.
However, there's an important limitation.
Persistent storage is not the same as a backup.
Everything still lives on one physical server.
If the disk fails, the applications and their persistent data could be lost.
The setup also doesn't provide high availability. If the Debian laptop shuts down, the entire cluster becomes unavailable.
Those are tradeoffs I'm willing to accept for a learning-focused homelab, but they're important to acknowledge.
A more mature version of the setup would need a proper backup and restore strategy, particularly for the Nextcloud database and uploaded files.
8. What I've Learned From Running It
The most interesting lessons haven't necessarily come from deploying the applications.
They've come from troubleshooting the connections between them.
A running pod doesn't always mean a working application
One of the biggest lessons came from the Nextcloud issues.
Kubernetes could report that the pods were running, and the application could respond quickly when tested locally.
Yet accessing the same application through its external domain could still result in a timeout.
This demonstrated that application availability involves multiple layers:
- The container and its internal processes
- Kubernetes Services
- Ingress routing
- The Cloudflare Tunnel connection
- Application-specific proxy configuration
- Authentication, database queries, and storage operations
A healthy pod is only one part of a healthy service.
Networking becomes much easier when you understand each layer
Before working on this project, it was easy to think of an application as something that simply listens on a port.
Kubernetes adds several abstractions, and initially those abstractions can make things feel more complicated.
But understanding the responsibilities of Pods, Services, Ingress resources, ingress controllers, and external tunnels makes troubleshooting much more systematic.
Instead of randomly restarting applications, I can test different parts of the request path and determine where behavior changes.
Resource consumption isn't always the bottleneck
During some of my troubleshooting sessions, CPU and memory usage were well within the server's available capacity.
That was a useful reminder that a slow application doesn't necessarily mean the machine needs more RAM or a faster processor.
Problems can also originate from network routing, connection handling, application configuration, or individual requests.
Kubernetes is both convenient and complicated
There are times when Docker Compose would have made this project considerably easier.
Kubernetes introduces more configuration, more moving parts, and more things that can go wrong.
But it also provides a consistent environment for deploying, inspecting, and managing applications.
For me, that experience is part of the reason for building the homelab in the first place.
9. What I'd Like to Improve Next
The setup is still evolving.
There are several areas I'd like to improve as I continue experimenting.
Monitoring and observability: Headlamp gives me useful visibility into Kubernetes, but I would like better historical metrics, dashboards, and alerting. Tools such as Prometheus and Grafana could eventually become part of the stack.
Backups: Persistent volumes protect data from ordinary pod recreation, but I still need a reliable approach for protecting important data from disk failure and accidental deletion.
Security: I want to continue tightening access to administrative applications, reviewing Kubernetes permissions, and ensuring public services are exposed intentionally. A dashboard with powerful cluster permissions deserves especially careful access controls.
Storage: As the media library and downloaded files grow, the server's internal storage will become more limiting. External drives or network-attached storage could provide more flexibility.
Reliability: Because everything runs on one laptop, power management, disk health, and restarting services after reboots are all important operational concerns.
I don't necessarily plan to turn this into a large production-style Kubernetes platform. The aim is to make the current environment more reliable while continuing to learn from it.
Final Thoughts
What I like most about this homelab is that it has gradually become something genuinely useful.
It started with a spare laptop and the desire to experiment with Kubernetes.
Now that same machine hosts a media server, personal cloud storage, a Kubernetes management dashboard, and a download manager.
Cloudflare Tunnel makes selected applications accessible over HTTPS without conventional router port forwarding. Tailscale gives me private access for administration. K3s brings everything together under one orchestration platform.
The setup isn't perfect.
I've encountered networking problems, configuration mistakes, failed jobs, permissions issues, and more than a few confusing error messages.
But that's also what makes a homelab valuable.
It's an environment where I can experiment with real infrastructure, break things, investigate why they broke, and gradually develop a better understanding of how the different pieces fit together.
And the entire thing runs on a laptop that might otherwise have been sitting unused.
For me, that's a pretty good reason to keep building.
What are you running in your homelab? Are you using Kubernetes, Docker Compose, or something else entirely? I'd be interested to hear how other people approach self-hosting.